If you’ve been running a website for any length of time you’ve probably had occasion to become dissatisfied with your hosting provider and thought about moving to another.
That’s happened to me 3 times in the past 10 years.
In the first case it was because the hosting provider I used did not support SFTP, and in the other two cases it was because their service level and support deteriorated so badly that I had to move.
Initially this may seem like something you wouldn’t want to take on, but it’s actually pretty straightforward.
There’s no need to feel trapped into putting up with poor service!
Many hosting providers offer to transfer your existing website to their service for free, but there are usually two restrictions:
- The host you are moving from must be using cPanel
- The receiving host will only transfer one website (for free)
So this article describes how to move your WordPress website, using the same domain, in cases where those conditions are not met.
The steps you need to go through
Here, in summary, are the steps that must take place for a WordPress website to be moved successfully:
- A new database must be set up on the new host, which you can do through cPanel (MySQL databases). Make sure to keep a copy of the database name, database user and user password because you’ll need them later
- Using PHPMyAdmin, export the site database files from your current host to a location on your computer (they will be in a .sql file)
- Download the website files from your current host to your computer, using an FTP client or file manager. Select the entire contents of the
public_htmlfolder to ensure all folders and files are moved
- Go to your new host and import the database file you exported from your old host. You need to select the new database in PHPMyAdmin and import the .sql file you downloaded earlier
- Upload the WordPress files from your computer to the new host (usually to the
public_htmlfolder, but check that with your new host)
- Edit the
wp-config.phpfile on your new host by replacing the old database name, database user and user password with the ones you used earlier when creating the new database
- Go to your domain registrar and change the DNS settings to those of your new host
If you are changing the domain, as well as the hosting provider, then there is an additional step you will need to take: Edit the new database to change the file paths throughout the site to reflect the new domain name.
It’s a straightforward process but it does require close attention to detail, particularly when working with the
wp-config.php file and the database, to ensure everything goes smoothly.
Getting anything wrong will result in a blank white screen.
Therefore, if you’re not too comfortable working with those files, I recommend using a plugin.
Move WordPress using BackupBuddy
The easiest way to move your site is to use a plugin, and I’ve used BackupBuddy from iThemes to move WordPress websites from server to server, and domain to domain, for nearly 8 years.
Here’s the process for moving WordPress if you’re using BackupBuddy:
- Install BackupBuddy on your current host (if you aren’t already using it)
- Using MySQL Databases in cPanel, create a new database on your new host, remembering to keep a record of the database name, database user and user password
- Take a Complete Backup of your site with BackupBuddy. The ‘Complete’ backup includes both your database and your site files
- Download the backup file to your computer (it will be a .zip file)
- Go to the BackupBuddy > Migrate/Restore screen and click the link to download the Importbuddy.php file to your computer. Adding a password in the field that’s presented and clicking OK will start the download
- Go to your domain registrar and change the DNS settings to the settings of your new host. Wait an hour or so for the DNS change to take effect – you can check it using this website
- Upload both the backup zip file and the Importbuddy.php file to your new host (most likely to the
public_htmlfolder, but check)
- Make sure the DNS change has propagated and, if so, navigate to the importbuddy file on your domain using this URL:
https://yourdomain.com/importbuddy.php. If the DNS change has taken effect you will be presented with the ImportBuddy screen asking for the password you set up before downloading it
- Insert the password and follow the steps. There will be two items you need to add or confirm when prompted:
- You will need to add the new database name, user name and user password. You can also change the database prefix in this step, which would be a good security step
- You can check the domain name (which you should not change unless you are moving to a new domain)
- The final screen will invite you to check that your site has imported properly. Do so in a new tab
- If everything is OK click the ‘Finish’ button. This will delete the working files used in the process
If you’re moving to a new domain as well as a new host, then you can change the domain name in point 2 of those two items you need to edit or verify. BackupBuddy will then make the necessary edits throughout the database.
I’ve used BackupBuddy for 8 years to backup and move WordPress websites. I’ve managed sites up to 12 GB in size with it and it has always performed flawlessly.
I reviewed BackupBuddy on my WP Security Basics website, so if you’re interested to read more details please click here.