7 Easy Steps for moving your WordPress site onto a different server

It feels like a horrible day when you move your WordPress blog onto a different server, maybe after you’ve been testing it on a local server, open up the home page url, and … there’s nothing there. You can’t log in to the admin centre because, well, it’s not there either!

Here’s the seven steps to moving your WordPress site onto a different server, and making it work.

Step 1

Back up the site files and the database. It’s obvious, I know.

Step 2

Load the database onto the new server, keeping the database name and user the same.

Step 3

Load the site files onto the new server.

Step 4

Edit the functions.php file to update the site url.
Your functions.php file is in the wp-content -> themes -> yourthemefolder.
If you don’t have a functions.php file in there you can just create one with the

1

<?php

opening tag.

Put the following code into your functions.php file, and re-upload it to the site:

1

2

update_option('siteurl','http://www.yoursiteaddress.com/');

update_option('home','http://www.yoursiteaddress.com/');

This tells WordPress where to look for the siteurl, even though the database contains the previous url. When the WordPress settings detect it, the database content is updated with the new url. (Once you’re up and running you should comment this out as the WP settings page will take over).

Step 5

Check all is well by reviewing “WordPress Address (URL)” in General Settings in wp-admin at the new site’s url.

Step 6

To avert permalink misbehaviour, use a WordPress plugin to edit the internal urls. A convenient plugin for this is “Velvet Blues Update URLs”. Once it’s installed, you’ll find it in wp-admin’s Tools. Enter the old root url and the new one, and off you go.

Then go to Permalinks in WP Settings, and set the permalinks to Plain to reset everything. You can change them back to your preferred setting later, if you wish.

Step 7

Check internal links are working properly. If you’ve added any to site files in your theme (such as a splash page), you will need to edit them and re-upload the files.