There are many reason why you would want to move your site to a new server, maybe you aren’t happy with a host or you want to upgrade, your site is getting busy and you need a faster server. Or maybe you built the site at a temporary location and you need to move it to its final destination server. This article shows you how it is done.
If you are moving from an already established position, we assume the domain name has had its nameservers changed to the new servers. It involves going to the registrar site where the domain name was originally purchased and altering the nameservers there. To find your namesevers search the website of the new hosting service you are migrating to. Usually the nameservers look like this:
1. Backup your site’s files:
Either use an backup wizard in the cPanel or use an FTP app to download all the files from the public_html directory. If you use an FTP application, you will need to enable your computer to show hidden files since many of the files in a wordpress home directory are hidden, including the important .htaccess file.
The cPanel backup wizard will download all your website files in the form a single zip file.
2. Export the SQL database file:
Your wordpress site uses a SQL database to store all its information and it needs to exported using the phpMyAdmin application in the cPanel.
Run phpMyAdmin and select your database file in the left column. If you have several to choose from, because you made several wordpress installs on this server and the filename is not obvious, you can look up the wp-config.php. Locate it in your backup files, open it a text editor and look for this line:
/** MySQL hostname */
‘name’ is the db file you should be selecting in the left hand column. With the file selected, go to the “Export” tab, and select export tables. The tables file will be downloaded to your computer, keep this for use later.
3. Creating a new SQL database, this needs to be done at your new server before you can restore your wordpress website. Log into the Cpanel at the new site, find the ‘MySQL®Database’ application and run it.
Give the new database a name, a new username, assign all permissions and create a password. Record all these and paste them somewhere because you will need the name, username and password in the next phase.
4. Import the database tables from your old server, which you had already downloaded to your hard drive at #2.
5. Copy all your website files from inside “public_html” folder to the new “public_html”
6. Update the wp-config.php file. Open it in the “public_html” folder with your text editor and go to each of these 3 lines replacing “old_names” with the new updated name, username and password info copied in #3
/** The name of the database for WordPress */
/** MySQL database username */
/** MySQL database password */
Save the wp-config file and upload to the new location.
7. Migration finished and your website should be up and running on its brand new server.