« That gooey stuff in the middle | Main | Note to Powerbook owners »

One guy and a hot laptop

There’s a moving company in Amherst that goes by the name, “Four Guys & A Big Truck.” They have more than one truck now, and I suspect more than four guys (though there’s always some daydreaming about a complicated scheduling scheme, like the Greek theater three-actors-on-stage rule, which prevents more than four guys working at once.) The point is, they specialize in household moving.

Tonight, I picked up A’s blogs and moved them from one domain and one web host to another domain on another host. It took a bit more than three hours, all around. Here’s how it played out:

  • We had the new domain already running on the new host. I installed Movable Type there this afternoon.

  • I did a “dump” of the MySQL database from the old host. The “dump file” is a lengthy string of SQL commands needed to recreate the database on another server; it weighed in at 38MB, but downloaded surprisingly quickly.

  • I then imported that dump file at the new host. If I was doing this on machines I’d set up myself, I’d be using the command line mysqldump and then using the dumpfile as stdin for a mysql run, but in this case I used the provided phpMySQL, which may have slowed things down a bit. At any rate, this process is slow: something on the order of half an hour.

  • Meanwhile, I slowed it down even more by going through the old directory tree via FTP and downloading all the files which wouldn’t be part of the database download: graphics files, generally, but occasional static HTML files as well. I created empty directories for each blog on the new server and started uploading these extra files into those directories.

About midway through this process, I realized it would be faster if I jacked an ethernet cable directly into the network rather than using the wireless, and sure enough, things picked up at that point. With two FTP processes running, plus the MySQL import, my machine was getting downright hot, not because it was doing a lot of computing, but because it was squeezing a lot of data through the network stack. Isn’t it Boyle’s law which explains how compressed data is warmer than uncompressed data?

  • Once the database and all the files were uploaded, we were able to log in to MT (with all user logins and passwords intact!) and simply issue a “rebuild site” command for each blog to regenerate the main pages, archives, etc. Some of these took longer than others, but once they were done, we had working weblogs on the new server.

  • At this point, I dropped an .htaccess file on the old server with a block of mod_rewrite directives which send any traffic headed for the old site to the correct new address. Result: no broken links.

  • Then I spent some time checking to make sure everything more-or-less worked, comments were going through, and I’d found most of the non-database pages.

I think that’s the fastest address change I’ve ever been involved in.

Update 5/18: Bonus: because the mod_rewrite block causes the old server to return a “301 Moved Permanently” error along with the new URL, NetNewsWire has automagically changed my subscriptions. I’m betting Bloglines does the same.

Comments

Ya done good! I got on Alison’s site this AM and until I read her post, had no idea anything had changed.

Post a comment