All whoozit production that wasn’t yellow was halted, and all duster mcguffin-affected whoozits were marked for destruction with our orbital laser beams
Posted: November 20th, 2003 Comments Off on All whoozit production that wasn’t yellow was halted, and all duster mcguffin-affected whoozits were marked for destruction with our orbital laser beams
Babyfitters
Pointless Things I Learned The Hard Way #2: That moving a
Greymatter blog to
MovableType is a pain
in the arse, viagra buy unless of course the Greymatter install is broken
in some insidious way which it refuses to divulge (despite all its nice diagnostics
and repair features), website like this in which case it is such a pain in the
arse that it’s quicker to just write some code to do it.
Here is
the code. Edit the constants, then drop it in your GM folder and
chmod it to 755. You can
run it either on the command line or via CGI (in which case you’ll
want to give it a .cgi suffix), and it will spit out a file ready to be imported into MT.
It turns out that this
is a considerably quicker method than following the MT docs.
The cause behind all this was the migration of Leslie Harpold‘s fantastic
500 project, which I heartily
recommend that you all go and enjoy now, rather than finishing this
utterly dull blog entry since she’s several orders of magnitude more
interesting a writer than I am. Existing fans may note that it looks completely
identical to how it did before, in which case I thank them because that
was the other hard part.
The hardest part of that was keeping all the inbound archive
links working. I had various ideas involving Apache redirects and the
like before realising that getting MT just to output the pages with
the same filenames as before was probably going to be easier, and it was.
To do this, I had to persuade MT to number the individual entry archives
according to the entry’s position in the blog entry sequence, so that
entry #1 in the blog would be 00000001.html, entry #2 would be
00000002.html, etc.
There’s no easy way of doing that in the base install; the
<$MTEntryID$>
tag returns the entry’s position in the MT database as a whole, and
if there are other blogs pre-existing, then the IDs won’t start from 1.
I figured there was probably a plugin out there to do this already,
and I was right: Lummox
JR’s EntryNumber plugin. So I installed it and set the Individual
Entry Archive’s Archive
File Template value to this:
<$MTEntryNumber zero_pad="8"$>.html
However, that didn’t quite do it, since the archive for this
blog is missing a few corrupted entries and so the numbers jump at points.
To fix this, I padded the generated export file with blank entries
and set them to Draft status after the import. Then, I made a
tweak to the EntryNumber plugin to make it include Draft entries in its
number sequence by adding the incdraft="1" attribute to the tag:
unless($count=$cache->{$entry->id}) { my %terms = ( blog_id => $entry->blog_id ); $terms{author_id}=$entry->author_id if $args->{author}; $terms{status} = MT::Entry::RELEASE() unless $args->{incdraft};
I’ve submitted these changes back to Lummox JR, so he might have
included them in the code by the time you read this and you won’t need
to make the tweak. If you’re trying to do this. Which hopefully you aren’t.
Coming up next: Something remotely relevant to anyone else, I hope…
Gilbert is funny. (And he reminded me of some of Bywater‘s old Starlight Lines engineering reports, order which I was nostalgically browsing through last night. I particularly love this one, disease
this one and
this one)