Moving your WordPress installation to another location

It’s actually very simple to move a WordPress website/blog to a new location…
Be it to a different path on the same server, or to a totally different server.


Steps:

  • Create a backup of the current site files (i.e. if WordPress is installed in the root of the webserver this will be the public_html directory). You can use the File Manager functionality in you site’s Control Panel to zip the directory and contents and download it to your desktop. Or you can use an ftp program… but zipping it will halve its size and you will be able to download it a lot quicker.
  • Create a backup of the MYSQL database that your site is currently using. You can use the MYSQL manager in your Control Panel to do this. The backup file that you end up with must have the .sql extension.
  • Go to the new location where you are moving the site to and upload the backup of the sites files. If you used File Manager to zip the files, you can upload the zipped directory and use File Manager in the new location to unzip the files. If you are moving to the root of the new location, then once again, you will be uploading the files into the public_html directory.
  • Create a MYSql database on the new server. You can use the MYSql admin functionality in Control Panel to do this.
  • Create a new user and add it to the new database that you have just created. Make a note of the database name, the user name and the user’s password. You need this information in a later step.
  • Open your database backup (the .sql file) with a text editor. Do a search and replace all to change all reference of the old URL with the new one:
    I.e: if your old url was joeblog.com and your new location is erniesmith.net… you do a search for joeblog.com and replace all instances of this with erniesmith.net. Note: there may be thousands of replaces done, depending on the number of pages/posts in your site.
    If your not moving to the root of the new location, then adjust the replace url according ly (i.e. you may be moving it to erniesmith.net/blog).
  • After you have finished editing the .sql file, you must import it into your newly created MYSql database to ensure that the relevant tables are created to match your site files. You can use PHP MY Admin to do this. Simply view the database and select the Import option and point to your .sql file on your computer. The .sql file will be run in the new database and the relevant tables will be created.
  • Using File Manager or and ftp program, you need to open the wp-config.php file for editing: you need to edit the database reference, the user reference and the user password reference with the information that you noted in a previous step. 
    WordPress uses this information to locate the correct database when the website launches. So this new info must be correct or you will receive the message: Unable to establish a database connection when you try to launch the website.


If you don’t find these steps clear, you can watch the two videos below. They go through the process in detail. I have used this method to move numerous WordPress installations and it has worked every time.


Good luck… and happy moving!!


[youtube]http://www.youtube.com/watch?v=6hCH3FQhiBI[/youtube]

[youtube]http://www.youtube.com/watch?v=qZ10dufMAVY[/youtube]


.

One Response to Moving your WordPress installation to another location

  • Bert says:

    Brilliant!
    Thanks for this explanation… it worked perfectly.
    I’ve seen many explanations on how to move a WordPress site, but none of the worked… and after doing it this way, I can see why! They missed the key pints that needed to be followed.
    Thank You!

Leave a Reply

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

*


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>