December 21, 2003

Movable Me

I’m getting closer to the switchover to Movable Type. I have over 500 posts here, though, so I guess I can’t expect everything to happen overnight. I got the templates close to the way I want them (except for some details with the archives), and now I just have two big obstacles:

1. I have a separate directory for pictures. it’s the pictures directory under the weblog directory. With Blogger, all my archive files are in the weblog directory, so for two years now I’ve been using relative URLs to point to the pictures. <img src="pictures/photo.jpg" />. That worked fine with Blogger. With Movable Type, I’m screwed. I have a real directory structure now for archives, so that today’s posts will be in weblog/2003/12/21. But the posts still have the relative pointer to the images. So the browser tries to look for weblog/2003/12/21/pictures/photo.jpg, and of course it isn’t there. I also have monthly archive pages, that will be looking for weblog/2003/12/pictures/photo.jpg. Also, not there. The solution is to recode all my image links so they use root-relative URLs, ones that point to the same directory no matter what directory you’re pointing from. Like /weblog/pictures/photo.jpg. No problem. It works great. Now I have to go through 531 posts and change all the image tags. Yeah; sounds like fun to me too.

2. Comments. Blogger doesn’t have comments. So what you have to do is use a third-party tool that integrates into your page. I went a step further and wrote my own third-party tool in ASP. So now all my posts are held in Blogger’s database, and all my comments are in an Access database on my site. Now I have to merge them and import them both into Movable Type so that each comment gets associated with the correct post. I have to do this with over 300 comments. I have to do this when the only thing the Blogger and MT databases have in common are the timestamps. And for the last couple of weeks I’ve been double-posting everything, so those timestamps are all off by a couple of minutes. So much more fun.

So that I’m not overrun with new comments while I’m trying to wrangle the old ones, I’ve closed comments on this site. You can always head over to the Movable Type site at its temporary URL and post comments there, but comments here are now frozen. Hopefully I can get everything ready to go before the New Year, but the baby just seems to suck up all my free time lately. Which is how it should be, I guess. So let’s amend that estimate to New Year, 2005.

P.S. I’m also finally going to have comments for Sammy’s Baby Blog (sneak peek here). I’ll probably get more comments there then on this weblog!

Filed under The Computer Vet Weblog

Comments (3)

Comments RSS - Trackback - Write Comment

  1. Ade says:

    If you have Perl:
    perl -pi.bak -e ‘s#src=”pic#src=”/weblog/pic”#g’ *.htm
    (search/replace with a backup of each modified file – I’ve used hashes to delimit the strings)

    Posted December 22, 2003 @ 2:39 am
  2. Scott Schrantz says:

    I don’t have Perl, at least not command-line. Plus, the changes need to be made in Movable Type, which holds everything in a MySQL database. And those links aren’t the only thing that need changing. All my early posts need titles, and the HTML has to be cleaned up, and a bunch of other general housekeeping to get everything running smooth.

    I wish it was as easy as just one line of Perl.

    Posted December 22, 2003 @ 10:13 am
  3. Ade says:

    Ah, didn’t realise you were using the DB backend. You could export the entries to a local box, run the Perl and then re-import (incidentally, Perl is available for Win32). But you could also do that in an editor, and it sounds like you have other, more involved tasks anyway. Best of luck with it.

    Posted December 23, 2003 @ 2:22 am

Write Comment