December 11, 2004

Moved web host

My web host is shutting down my old server and so I had to move to a new server. It's much faster, the administrative service is much nicer, and it supports SSL, but moving is always a pain.

The process includes setting up lots of configuration info on the new server to match the old one. I have almost no config, but I still had to figure out what it was then re-do it. Then I copied all my files over, thankfully made easier because the old server generated a backup archive every day which I could download.

The hard part was Movable Type. The old server had only Berkeley DB, the new one on MySQL. So I exported all my entries with MT's export functionaly, then had to configure a totally new install of MT on the new server and import the entries. The config, again, was a pain but straightforward. Import worked perfectly, except for one thing: URLs. I care that my old URLs are the same on the new server. Well, it turns out that MT uses the ID column in the database to generate its archive URLs--a decent idea, but not portable across servers. So here's the process I used.

1) Export all old entries.
2) Review titles of old entries sorted by ID order--I had a huge gap in the middle when I imported old entries from another system, so I had to re-order the exported data so that instead of being sorted by date (MT export does this sensible thing), it was sorted by ID. Luckliy this was one huge chunk plus about 3 transpositions, but it's still a PITA. If I had to do this again, I might automate it, but that would take longer than just doing it the first time.
3) Test import. Review results and notice that there's 2 gaps which need to be fixed.
4) Fix them in the import file and notice that everything is now wrong--the IDs kept growing.
5) Go into the MySQL administrative tool, drop and re-add the entry table. Thankfully there are no foreign keys.
6) Re-import. Everything was fine.

One nice thing about MT import is that it pulled in my categories, at least well enough to use. It also somehow got most of my templates, they must have been stored in the filesystem, and when I used the same name, everything matched up.

Hopefully I won't have to do this again, or if I do it will be to something which has better support for this process. At least I hope MySQL data is more portable than BerkeleyDB data.

Note: I spoke too soon... the comments got imported strangely. And the templates didn't get imported right either... now that's all done.

Posted by MBlain at 04:23 PM | Comments (5)