Steps to follow in moving a WordPress website from one server to another

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:

  1. 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.
  2. 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.
  3. On the new server, install the base WordPress package.  Check that the default WordPress screen comes up.
  4. 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.
  5. 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.
  6. 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 and 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, ‘’, ‘’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;
    • UPDATE wp_posts SET guid = replace(guid, ‘’,’’);
    • UPDATE wp_posts SET post_content = replace(post_content, ‘’, ‘’);
    • UPDATE wp_postmeta SET meta_value = replace(meta_value, ‘’, ‘’);
    • When complete click on the Home icon and log out of phpMyAdmin.
  7. 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.
  8. 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.
  9. That should be it.

Copyright © 2024