June 8, 2010

How to move a WordPress installation

by Karine in Wordpress with no response

It may sound obvious since WordPress has a powerful Import/Export option, but a lot of people still have a lot of trouble moving their WordPress installation from one folder to another or from one server to another. In my case, I never use the Import/Export tools and prefer to export/re-import my SQL database.

First, this method keeps all the IDs intact. So if your old URL was http://old.com/180/post, it will be http://new.com/180/post this is much simplier to set redirects no? :) In fact, everything will stay intact, except for the uploads: we will have to download them and re-upload them on the new server.

First of all, don't install WordPress on the new server yet.

Export your SQL database

Go to your current server phpMyAdmin (should be accessible from your domain control panel) and go to your database.

You should have some tabs at the top, click on Export. Check "Save as file" and click Go. You should now have a .sql file.

Now to to the new server phpMyAdmin and click on Import.

Edit the website URL

You should still be in phpMyAdmin of the new server. Go to the table wp_options (click on its name) and click "Browse" in the top tabs. You should see the first line: siteurl. Click edit and replace the old URL by the new one ! There is more so go to page 2 and you should see the line: home, again, edit and replace by the new URL.

"Install" WordPress

This is not really an installation since the database and tables are already created. Make sure to edit wp-config.php with your new server informations and upload WordPress on your new server. Go to the new website, everything is accessible as on the old one, but it's a new server and new URL. :) We're not done yet, you've probably noticed broken images or attachments.

Move the wp-content folder

You are almost done. Now you have to download your old server's wp-content folder (by FTP of course) and re-upload it on your new server (replace the existing one). If you had an uploads folder out of wp-content folder, repeat this step with this different folder, but make sure to re-upload it in the same hierarchy as in the old server.

Note: if you're using http://old.com/etc/ links in your posts or theme, make sure to replace them by new.com ! There are a lot of plugins to bulk edit posts, search and replace, etc. Just search for old.com and replace by new.com !

Tags

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>

Notify me of followup comments via e-mail. You can also subscribe without commenting.

↑ Back to Top