Blog Progress

The hard disk that my old blog entries live on (along with a few other web sites) is still looking rather ill. It’s apparently possible to prod it in a certain manner and get it to work for a few hours until it gets tired again. The hard part is persuading the tech support people at the hosting company to perform the prodding ceremony.

As a result, I seem to be getting three or four hour’s access to it every four or five days.

Last night it came back again and I used the time wisely be getting a dump of the database that contains the blog.

So I now have a backup of all of the previous entries together with the comments and trackbacks (remember trackbacks?) The next step is to get them into my new blog’s database.

Now there’s a slight problem there of course. I assume that the new blog entries will have been generated with the same primary keys as the first few entries in the old blog. And as there will be a unique index on the entries table I can’t just load the old data into the new database.

Currently I’m thinking that I should update the primary keys in the new database[1] so that they are greater than any of the old keys. But the Movable Type database is a large and complex beast. There will almost certainly be more than one primary key sequence to deal with and a large number of foreign key relationships to keep in step.

Sounds like a lot of fun. But it should be a reasonably mechanical task so I think there’s a good chance that I’ll have anything back by the end of the weekend. Don’t hold me to that though.

Is there anyone reading this who has attempted something like this before? Am I mad to do it the way I’ve described above? Is there a simpler method?

Any advice would really be appreciated.

[1] Thereby breaking one of the fundamental rules of database design – primary keys should be immutable.

2 thoughts on “Blog Progress

  1. Wouldn’t it be better to extract the old posts (with all their metadata) form the old database and then feed them into the new database as new posts with old dates? You might have to set up an old version of MT to do the extraction, but it’ll be cleaner and easier, and less likely to lead to subtle databasey bugs in the future.

  2. I’ve actually been thinking along the same lines myself. I might give that a go this evening.I’m not sure how much of the metadata (categories, tags, things like that) are exported using that method.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>