Migrating from wordpress.com to .org – data migration

This post covers the my experiences of data migration from wordpress.com to a self-hosted wordpress.org blog.

WordPress supports a customised RSS based XML format known as WordPress eXtended RSS (WXR) for exporting and importing content from wordpress blogs. It also supports import from a number of other blog platforms, as covered in great detail on the wordpress codex entry.

The WXR file will contain all your posts, comments, categories and custom fields. It won’t contain your blogroll.

On the wordpress.com blog the manage option on the dashboard has an export option. From here you can generate the WXR file for import into the new blog. However, before you do, be sure to go in and delete any spam comments that Askimet has hanging around. There’s no point in transferring them and doing so just increases the size of the WXR file. I forgot to do this first time around, and ran into a PHP error which I suspect was caused by excessive attempts to allocate memory when importing. Re-exporting without the spam comments solved it.

Importing is just a case of going to the admin, manage, import option on the new blog and browsing to the WXR file.

My posts on the old blog were all made by a user with the name “Adrian Spender” and userid aspender. On the new blog the userid was admin. On importing this didn’t appear to cause any problems. However it did mean that new posts appeared to be from a different user to the migrated ones. To solve this I created a new user with the same name (but as it happens a different userid) I’d suggest that before importing you create the same userid/user name user on the new blog as was on the old, and give them administrator access. I suspect this might have got around the issue I then hit.

Looking at the imported entries, and comments or pingbacks I’d made had my name linked back to the old .com blog. I had to go through and edit each comment to update the link to the new blog address to avoid inadvertantly redirecting people back to the old blog if they happened to read old comments.

The final step was to migrate over the blogroll. WordPress has a nice facility to import a blogroll from an OPML file, but unfortunately there doesn’t appear to be the equivalent export capability (at least not on wordpress.com) Thus, and as I only had a short blogroll I did it manually. If all your blogroll links happen to be in del.icio.us for example then you could create an OPML from there.

I hit the same PHP memory error when the default wordpress.org template tried to display any blogroll entry. Initially I thought this might be because I had too many, but it then happened when I pared my blogroll down to just one entry. I got around it through the subject of my next post, namely changing the template.

Leave a Reply