Moving a WordPress website from one server to another is quite an easy process but there are a few steps that need to be followed:
- In the existing website, go into the Admin area and in the Settings/General Settings area change the WordPress Address URL and Site Address URL to the address that it will be on the new site. Save the changes, but don’t try to go back into the website because it won’t work.
- Using PHPMyAdmin or similar product, export all the database tables into SQL format and save the exported backup file down onto your local PC. Make sure that you check the option to include the “DROP” commands.
- On the new server, install the base WordPress package. Check that the default WordPress screen comes up.
- Using PHPMyAdmin go into the database on the new server that you have just created. Select the SQL tab at the top of the screen. Open the SQL backup file that you just downloaded to your PC and copy everything in the file to the clipboard. Paste all from the clipboard to the SQL tab in PHPMyAdmin and execute the SQL. This will completely rebuild the tables in the database so that they are identical to the database on the old server.
- Using FTP (try Filezilla) copy the WP-CONTENTS directory and all sub-directories and files on the old server down to your PC. Then copy the WP-CONTENTS directory and all sub-directories and files to the new server, overwriting the files that were there.
- Now, if the URL to the WordPress site is changing at all, you need to run three SQL statements in the new database. Copy and paste, one at a time, the following 4 strings of code into the Run SQL query box, replacing the words olddomain.com and newdomain.com with your domains, and strike Go. Each time you run a query you should get a green check indicating the database was successfully updated.
- UPDATE wp_options SET option_value = replace(option_value, ‘http://www.olddomain.com’, ‘http://www.newdomain.com’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;
- UPDATE wp_posts SET guid = replace(guid, ‘http://www.olddomain.com’,’http://www.newdomain.com’);
- UPDATE wp_posts SET post_content = replace(post_content, ‘http://www.olddomain.com’, ‘http://www.newdomain.com’);
- UPDATE wp_postmeta SET meta_value = replace(meta_value, ‘http://www.olddomain.com’, ‘http://www.newdomain.com’);
- When complete click on the Home icon and log out of phpMyAdmin.
- UPDATE wp_options SET option_value = replace(option_value, ‘http://www.olddomain.com’, ‘http://www.newdomain.com’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;
- If you are changing hosting companies you will probably need to move your domain name. Go to the company that you registered your domain name with and change the DNS servers to the DNS server provided by your new hosting company. Once this is done it could take a little while for the change to filter through the internet so that your domain name will bring you to your new server, but it has been my experience that this has been happening in about half an hour of late.
- Once your domain is working and you can see your site setup on your new server, go in and check it out. If you find that your permalinks are not working, go into the Permalinks screen in the Settings and resave the Permalinks option that you want to use. I found that the setting in the Permalinks option selection was correct, I just needed to press the Save button to get it all working correctly.
- That should be it.