I am quite often having to move WordPress installs from one web server to another. There are several ways to go about doing this. One way that is pretty easy, is to just back up your entire cPanel and restore it on your new server using WHM.
There are quite a few WordPress plugins that can achieve this and the used to use was Duplicator, but after a while it started throwing errors and there was always an issue with a restore. This is around the time that I started doing manual backups and restores through one of two ways, with a full cPanel restore or manually exporting/downloading the database and files and restoring them into your new cPanel.
Moving your website with a full cPanel restore in WHM
Backing up and downloading
This is my preferred way of restoring a site, WordPress or not. If you have access to WHM at your new host you can do this yourself. If you have a reseller account, VPS or dedicated server you may have WHM. Otherwise you will have to give the file to your new host and see if they will restore the file for you. Many will and have no problem with it, others will charge you extra.
First you are going to want to log in to your current host’s cPanel for the site you are wanting to move. Under the files section look for “backup wizard”. Choose this option and proceed to do a full backup to your home directory and receive an email when it’s complete.
Once it is complete, go back to the files section and click on “file manager”. You should see the compressed back up file in the home directory, most likely a tar.gz file. Next you will right click on the file and choose download, or highlight the file and choose the download option near the top.
Uploading and restoring in Whm
If you do not have WHM, then this is where you contact your new host and provide them with the file you downloaded. They will be able to restore the cPanel in it’s entirety and all you will have to do is point your domain to the new host.
If you are doing this on your own, then log in to your new host’s WHM. In the left sidebar search bar, search for “restore”. Choose the option for restore from cp move file. On the next screen near the bottom, choose restore from file rather than username. Choose the compressed cPanel backup file that you downloaded, and click on the restore button
It could take just a few seconds or several minutes depending on the size of your site. Once complete and assuming there were no errors, then all you will have to do is go to domain registrar and change your name servers to your new host.
I recently received an error after a restore complaining about the database user name being longer than 16 characters. If you get this then simply go to the newly restored cPanel through WHM and go to databases. Choose the rename option on database for your site. Edit the name so that the it is 16 characters long or less.
Make sure there is a user created with sufficient privileges for the database. If there isn’t you will need to create a new user and assign him to the database. Make sure to keep note of the database user name and password here, you will need them for your wp-config.php file in your WordPress directory. You can go in using the cPanel file editor or through an FTP client. Update the db user name and password to reflect the new settings and save the file.
You can check a who is tool to check for when your name servers have switched over. Once they have then your copied site should now be displaying. I like to wait a day or so before disabling the old site and make sure to save your cPanel back in case anything goes wrong.