How to migrate your WordPress site to a new host
The most reliable way to migrate your site is the manual method in this article. The manual method can be tricky for less-technical users, so I also cover the UpdraftPlus approach below.
The Duplicator plugin promises to make this easy, but I have found it to be buggy and it has failed me on numerous occasions. Because of this, I use UpdraftPlus for easy migrations. You can make this simpler by buying the UpdraftPlus Migration extension, but it is also possible to do it for free fairly easily using the guide below along with a search/replace script which covers the functionality provided by the Migration extension.
If you are moving a very large or busy store, read Migrating huge WordPress sites reliably for the extra care needed to keep a live database consistent during the move. If you are moving onto managed hosting, Migrating your WordPress website to Cloudways safely and quickly covers that path specifically.
Migrating your site using UpdraftPlus
Create a backup of your live site
- Log into your live site
- Install UpdraftPlus
- Create a backup
- Download the backup files (there will be 4 or more files)
Restore to your dev/new site
Note: Restoring to your dev site from your live site will copy across all user accounts from your live site, replacing any existing user accounts you have on your dev/new site. If you have just set up your new/dev site, you will probably have just an admin account for WordPress. You need to use this for the steps below, but after the restoration is complete that admin account will be replaced by the credentials from your live site.
- Log into your new dev site
- Install UpdraftPlus
- On the Existing Backups tab for UpdraftPlus, click the link to Upload backup files and choose your backup files
- Refresh the page once it has completed uploading
- Click to restore and tick everything to restore
- Because you have a different domain in use, it will warn you it is a migration, not a restoration – just skip that, we will search/replace manually below to complete the migration
Migrating your site manually
This is a technical checklist. If you are unfamiliar with SSH/Putty, you should use the UpdraftPlus approach to migration above. If you are comfortable at the command line, set up passwordless access first with How to use SSH keys to access your WordPress servers.
- SSH to your old site, navigate to the webroot folder
- Run: zip -r backup.zip wp-content
- Run: mysqldump -u username -p dbname > backup.sql (then hit enter and then enter password)
- SSH to your new site
- SFTP oldipaddress
- Navigate to webroot
- Run: get backup*
- Extract these zip files to somewhere then copy the wp-content/* to your new wp-content folder
- Then replace the DB using: mysql -u username -p dbname < backup.sql
Note: The above approach presumes everything custom in your site is in wp-content. If it is in /assets/ or somewhere instead, you will also need to copy those files over.
Search/Replace in your database to change all www.yourdomain.com references to dev.yourdomain.com
If you visit your copied website now, you will see everything from your live site, but if you click any links you will end up back on your live site. This is because the backup you copied across has references to your live domain name. The tool and steps below allow you to search/replace all the correct places to change these hyperlinks to point to your new dev hyperlinks.
This is the only tricky part about using UpdraftPlus and in fact if this is too tricky for you, you can go UpdraftPlus premium and it includes this functionality in the plugin.
- Download the interconnect/it Search Replace DB script from here: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
- Extract the files, upload the folder to your /var/www/yourdomain/ folder using Filezilla or Cyberduck or similar
- Visit your sitedomain.com/searchfolder in your browser, e.g. https://staging.superspeedyplugins.com/searchreplace
- It will automatically pick up database credentials
- Enter www.yourdomain.com in the search box and dev.yourdomain.com in the replace box
- Hit Live run and wait
How to make your dev site live
Test your new host under real load before you switch DNS. Only flip the A records once the new server clearly outperforms the old one, so no visitor ever lands on the slower box.
Once you are happy that the performance of your new host outperforms your old host, you can flip the switch. Here is how to do it with zero downtime:
- Run the search replace script again by opening https://dev.yourdomain.com/searchreplace
- Enter dev.yourdomain.com in the search box, www.yourdomain.com in the replace box
- Hit live run and wait
- Visit your DNS and edit the A records for www.yourdomain.com and yourdomain.com to point to your new IP address
- Once you have completed this final search replace and confirmed you are live, you should delete the searchreplace folder using Filezilla as it is a major security hole leaving it there
Leaving the searchreplace folder on your server after going live is a serious security hole. Anyone who finds it can read and rewrite your entire database, so delete it the moment the migration is confirmed.
That is it – you are live!

Not so detailed instructions but I'll try them.
I understand the basic concept of a WordPress site migration and with the help of your tips i'll try and migrate one of my WP sites now.
Even though I can always ask the Rosehosting guys to do the migration, i want to learn to do this manually. I might even consider using a plugin. But first things first, I'm off to my first manual migration attempt.
Thanks for the article.