Everything you Need to Know About Moving a WordPress Site

Moving a WordPress site from one directory to another, or even from one server to another is actually really really easy. Although it isn’t as easy as simply copying your files across, its pretty damm close. In this article I will give you a step by step guide from a real world example on how to move a wordpress site from server to another.

Note: I am assuming that you know how to login to your websites control panel and that you can use a FTP program such as FileZilla. If this isnt the case then watch these videos and say a few hail Marys – you should be ok

cPanel Video Tutorials

FileZilla Video Tutorials

 

Background – Understanding how WordPress Works

The most important thing to understand is that WordPress is a database driven application. All of your site’s pages, posts, comments etc live inside your database. WordPress accesses your database through the wp-config file. This file tells WordPress what the databases name is, what the database user’s name is and what the password is. When moving WordPress sites it is essential that you move this database across as well!

 

Step 1 – Download Files

FileZilla in Public HTML Folder
FileZilla open inside my clients public_html folder.

Open up FileZilla and connect to your website. You should be inside the public_html folder (root directory of your site) and see at least three folders (wp-admin, wp-content and wp-includes). We want to copy everything in the public_html folder. Importantly we want to make sure to include the wp-config file and the wp-content folder.  Copy these files and save them somewhere safe on your computer.

 

Step 2 – Upload Files

This is a pretty straight forward step. Login to your new site in FileZilla and upload all of the files into the public_html directory.

[dt_highlight color=””]Bonus Tip!

I just realised that for many people when moving your wordpress site you wont be updating your name servers right away. This way when someone goes to www.yoursite.com they will continue seeing your (old) site. If this is the case then this little tip might help with filezilla:

If you have setup hosting and haven’t changed the nameservers to your new hosting, just enter your new hosting accounts IP address in the host field of Filezilla [/dt_highlight]

 

Step 3 – Download database

Login to your old site’s control panel (cPanel). Go to the backup section. Download a backup of your database. Save it somewhere safe on your computer.

[dt_highlight color=””]Bonus Tip: Some databases are prefixed with the domains first 8 letters or something similar. Take note of this if it is the case with your website[/dt_highlight]

 

Step 4 – Checkout your WP-CONFIG file

Sample wp-config showing the various settings
Sample wp-config file open

Open up the wp-config file which has been uploaded to your new server. Note the database name, database user name and password.

 

Step 5 – Restore the database to your new server

Adding new database users to our MySQL wordpress database
Adding new database users to our MySQL wordpress database

Login to the control panel of your new server. In the control panel of your new server. Go to the Backups icon. Click on restore a MySQL button (browse on most cpanels). Select the database that you downloaded earlier and upload it.

Now that your database has been transferred across all you need to do is add a new user to the database. To do this go to the MySQL databases icon on the home of the cpanel. In the section titled ‘Add New User’ add the user name and password that you noted earlier. The final thing left to do is to assign the user to the database which is completed using the section below titled ‘Add User to Database’. When prompted give the user full permissions.

[dt_highlight color=””]Bonus Tip: Remember the username and password that you noted earlier? Well these values will be exactly the same in the new database you are creating[/dt_highlight]

 

Additional Step – Update Name Servers

Dont forget to update the Name Servers for your domain name. If you dont know how to do this – dont fret we will be publishing an article about name servers soon which will explain how to do this and more.

You have now successfully copied your entire wordpress installation from one server to another. This same process can be applied for any situation where you are moving wordpress including moving an installation from one directly to another i.e. www.example.com/wordpress to www.example.com.

 

As always please feel free to leave comments if there is anything that I have missed or if you get stuck and I will be happy to help.

About The Author

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top