When you develop a site on a test server, it's tricky to make sure that none of the old links get carried over to the live site. This tutorial also works if you're moving to a new domain. While using a WordPress export is easier, this method catches everything, which can be important if your theme links to specific pages, since WordPress exports don't preserve post ID's
- Download the exisitng
/wp-content/directory (all of it ( some plugins (cforms, wp-eCommerce) contain modified or uploaded files)). - Install wordpress on the new domain. Very few of the settings matter, because they're all going to be overwritten. Nonetheless, it's easiest to use fantastico or Simplescripts to set up the database, and create the basic file structure.
- Delete the new
/wp-content/folder, and upload the existing /wp-content/ folder. This step may take a long time, so you can do the next few steps while it's uploading. - Export the old database, using PHPMyAdmin:

- Open the exported
*.SQLfile, using a code editor (Eclipse/Aptana, Notepad++, or (god forbid) Dreamweaver), and find and replace the old domain name with the new one.

- After step 4 has completely finished (so that all of the plugins and themes exist before WordPress attempts to use them), use PHPMyAdmin on the new host to delete the newly created database tables

- ... and import the new ones.

- On the existing install, set the blog address to the new URL. this ensures that any google juice that the development server may have picked up will be transfered to the new domain (this isn't necessary if the development server doesn't face the internet).










4 Comments
Thanks for putting this up. I’m not planning on moving anytime soon, but I’ve bookmarked it. Who knows what the future will bring.
In some instances, the SQL data will not contain the http prefix, so it’s better to just find and replace without the http://
Also, it is imperative that the prefix used while creating the database both on your local server/old site and online/new site are the same. WordPress by default uses wp_ as the prefix (in wp-config.php), but if your any reason you changed it, you should use that very prefix on the new install. Adam, correct me if I am off here.
@HSO -
interesting, i’ve never seen a setup that didn’t include the http:// prefix. The reason I included the http:// is to make sure that there aren’t www’s left over. if you’re find/replacing without the http://, you should replace
'dev.site.local/tempwith
'example.comAnd yes, it’s very important to make sure you have the same database prefix.
Awesome guide, just what I’ve been looking for. I’ve found migrations a little tricky in the past, and this will really help me.
One Trackback/Pingback
10 Apr 2008 at 2:20 pm
How to migrate a wordpress blog to your own domain « one cool site: wordpress blogging tips
[...] How to migrate a wordpress blog to your own domain I was interested to find this illustrated blogging tips tutorial which describes an alternative method for migrating a wordpress blog to a domain. When you develop a site on a test server, it’s tricky to make sure that none of the old links get carried over to the live site. This tutorial also works if you’re moving to a new domain. While using a WordPress export is easier, this method catches everything, which can be important if your theme links to specific pages, since WordPress exports don’t preserve post ID’s … -> Read the whole article. [...]
Post a Comment