I currently run by blog using Subtext and I’ve been wanting to test out some features in WordPress for a while. So naturally I don’t want to lose all of my blog posts and I’m not keen to write a whole bunch of code to read from the one database and write to the other.
Fortunately Subtext has the ability to export to BlogML and WordPress apparently has the ability to import from anything (if you believe the rumors) Unfortunately both the export and the import don’t really work.
Firstly, Subtext’s export doesn’t work. BUT since I had started my day thinking about moving from Subtext to BlogEngine.Net, I’d found a forum post where a friendly person showed how to make SubText export to BlogML successfully (Its the post by Harold on 2 Dec 2008). He links to the binary of SubText.BlogML.dll – you just replace the one on your site (make sure you have a backup of your version, just in case there’s some issues with newer versions of Subtext)
There are a few things that seem to have changed. Aaron’s post uses “XPath.class.php” which you can get from Sourceforge. It suggests that you put the file in the /wp-admin/import folder, but that just seems to cause issues. So I’m going to lay out the steps that I took over here:
- Download “XPath.class.php”
- Put the file in your /wp-admin/ folder
- Edit /wp-admin/admin.php and add a line at line 27 so that the file looks like:
require_once(ABSPATH . ‘wp-admin/includes/admin.php’);
- I’ve modified Aaron’s blogml importer and you can get blogml.php.
- Upload it to your /wp-admin/import folder
The original blogml had a few issues:
- It couldn’t handle or > or even < in any of the blog posts
- Categories were not imported correctly at all
- It didn’t, and still doesn’t, handle draft posts at all.
- It didn’t work with WordPress 2.7
I managed to fix the problems with the escaped html, the categories and the WordPress 2.7 issues, but didn’t quite get to fixing the issue with the draft posts. Let me know if you manage to fix that part – I only had one draft post so it didn’t really matter. Hopefully this will help someone else though.