I’ve just spent the arvo moving my data over from MoveableType to Pebble, and after some gotchas it should all be good.

I took a longer route than most since I had to go via phpMyAdmin to get an XML dump of my MT data first (since I don’t have shell access to the mysql box, and I can’t get to it from remote hosts).

The basic operation was:

  • Work out the naming of Pebble entries (all good, turns out to be a simple Calendar.getTimeInMillis() deal)
  • Work out the file format of Pebble entries (only two gotchas here - some custom formatting of Date entries which can be handled by SimpleDateFormat, and the CDATA sections in blog comments - where MT used PCDATA here. There were also some issues in swapping MT cr/lfs with first class br elements, but that’s another story).
  • Write some XML Pull to make the glue happen.
  • I also learned about File.makeDirs() which turns out to be a very useful little comment for making all required parent directories to a particular location. Useful, say, if you need to create /2004/06/13/ in a directory tree. BTW, took me a while to work out the “06” story, and not “6” which causes all sorts of pebble issues when trying to browse to a particular entry.

So I have to say it again, XML Pull Parsers are very, very handy for hacking together some parsing code. The XML stuff was the easiest part of the port - which was not always the case for me in the past. And, of course, Pebble - just rocks.