MT to Roller migration script

May 19th, 2004 by Hen

If anyone is interested, I’ve spent a bit of the evening [after teaching class], hacking in perl. I love perl, but as I use it fitfully I’m fully prepared to accept any criticisms on my perl skills. Still:

http://www.generationjava.com/mt2roller.pl

It currently has two ‘flaws’.

1) After setting up a new blog, you have to find your website id [located in the website table] and put this inside the script. Easy enough to fix as a command line argument.

2) It assumes it can start counting id’s from 1 for the various primary keys. This works, but isn’t perfect and if it’s the 2nd blog you’re putting in, you’ll need to increase these numbers. This could be a huge issue as Roller aren’t actually using simple sequences, but some other kind of generated id [from Castor?].

I invoke it as:

./mt2roller.pl blog-export | mysql roller -u roller -p

The important part being, it has no database handling code. That’s why 2 is so pathetic right now. ‘blog-export’ is the name of the file I exported from my MT blog by the way.

Still, as far as I can tell it correctly pulled over 350 or so entries and assorted comments without any errors, and apart from an ‘update-time’ field which just isn’t available so I use ‘create-time’, I think everything is covered.

Comments are closed.