My new project: Tact, a simple chat app.

Migrating content from pMachine to another blog system, take 2

December 10, 2008

A while ago I wrote this post that explains how to migrate content from pMachine to Wordpress. All I had to do at the time was to use the script posted here and make minor changes.

Now someone approached me asking for help doing the same A.D. 2008. That is, get content from pMachine to a recent version of Wordpress. I took a closer look at the state of things and a lot has changed with Wordpress. Namely, they are no longer using the “post2cat” table to store post<>category relations; instead, there is a more complicated table structure to store the taxonomy (apparently so that it also scales to tags and other stuff).

So, I had now two choices. a) go and try to figure out the new Wordpress table structure and fix the export script, or b) find another, higher-level approach.

I did not feel like Wordpress hacking: I wanted something that’s cleaner and easier to maintain. So instead I wrote a new script (borrowing heavily from previous work) that dumps your pMachine content into… tada!… Movable Type import format.

Movable Type import format is IMO a fairly obscure and crappy format, but it has stood the test of time and been around for a while. As a result, many blog systems including MT itself as well as Wordpress support importing from it. So, once you dump your content from pMachine into this format, you should be able to import it into other systems.

Download the script

One thing to note is that in the BBcode converter, I changed

'<img src="$1" alt="" />',

to

'<img src=$1 alt="" />',

Because otherwise I was getting double quotes for image paths. YMMV.