migrating wordpress

I’ve found a few threads on this, and wanted to recap my experience here. It is possible to move wordpress – and quite easy actually, but there are several steps that are not completely obvious. My move was from the root of my site, brentphillips.com, to a subdomain – blog.brentphillips.com which required some extra work with the database, but you can also migrate servers/hosts with little effort. This is intended for folks who manage their own domains, by the way. If you don’t, your administrator or host will need to assist.

1. text widgets
For either scenario, the non-obvious step was to remove any ‘text widgets’ from the current installation, before copying down the database, then re-install them once the new site was in place. For IE users, this is somewhat of a headache because you are unable to select all text or cut and paste out of a text widget (so far). An easy way to get around this, however, is to ‘view source’ on the blog site where the text widgets sit, find the widget code then cut and paste into notepad or other document editor. I kept mine in notepad and minimized the file while working through the rest of the exercise.

2. copy files (and keep the originals where they are)
Regardless of destination, you’ll want to copy all files from current location to new location.  In my case, from the root, to the folder that holds my subdomain. You can also run a new install of wordpress but make sure it is the same version as your current. In the new location, you will also want to ensure that the DB is setup and that your wp_config.php is updated to access the new database. My host uses ‘fantastico’ which automates the wordpress install.  In my case the config file and db were setup automatically.

3. export the database.
My host offers phpMyAdmin which I used to export the database onto my desktop as a SQL script.

4. moving to a new server/same domain name
If all else is equal and you’re simply moving to a new server, you will want to log into your database control panel (new server), then delete all the tables in the new wp database (not the db, right?). Your script will install them all.  Import the script (or in my case, I cut and pasted the script) and executed it against the new database.  If you have no errors with the script, and the config file can see/access the db, you should be in good shape. Note. If you’re going through a dns update to point to a new host – and viewing the new site via an IP address and/or to a temporary redirected site, the links within wp might not work until the domain name redirect is complete.

5. moving to a new directory
An extra step is needed with the database export. The URL of the domain is hardcoded in the database in a few places. In my case ‘http://www.brentphillips.com.” To fix this, I did a find/replace on the SQL script, basically replacing ‘http://www.brentphillips.com’ with ‘http://blog.brentphillips.com.’ Once complete, I executed the script against the database as noted above and had a fully installed wp site.

6. things to consider
- links: If you linked to media on your site from within wordpress, the step above may break some of those links. I found one image link broken (had forgotten to pull that directory into the new subdomain folder).
- syndication: if you use a tool like feedburner, make sure you update the feed URL.
- other third party tools: any other tools that link to your blog will need to be updated. I use clustrmaps which required a net new account.

7. wish list
eager to find, or work with someone on a SQL Server port for Word Press. If you know of anyone who has done it, or anyone interested to work on it, let me know.

Leave a Reply

You must be logged in to post a comment.