Phew, redirects are good!

So I think I’ve got all the old articles appearing at their old urls using .htaccess Redirect rules. This is a modification of a method described in the WordPress MT-Redirect method.

I had a directory of the old numerically-named MT archives, so I used the following script to create a .htaccess file:

for f in 000*html
do
 v=`basename $f .html`
 g=`echo $v | sed 's/^00*//;'`
 echo 'Redirect Permanent' /blog/archives/$f 'http://scruss.com/blog/index.php?p='$g
done

which looks like:

Redirect Permanent /blog/archives/000001.html http://scruss.com/blog/index.php?p=1
Redirect Permanent /blog/archives/000002.html http://scruss.com/blog/index.php?p=2
Redirect Permanent /blog/archives/000003.html http://scruss.com/blog/index.php?p=3
 ...
Redirect Permanent /blog/archives/000322.html http://scruss.com/blog/index.php?p=322

I put this .htaccess file in the root (top level) directory of my domain, and it all works! Everything I set out to do when reindexing my old MT entries has been completed — see, lookit: http://scruss.com/blog/archives/000214.html

Saved by the hat!

Last week, I rather foolishly left my wallet in the company truck when I came off site. Not merely did it contain all my money and cards, but it also had my TTC pass, so without it I couldn’t get home. It didn’t contain my GO train pass, which meant I could get an inconvenient distance from the office truck before realising I could get no further.

Stranded on the platform at Union Station, I suddenly remembered the advice in my Tilley hat‘s manual about putting “a $10 bill into the plastic bag in the pocket of the crown“. Hurrah!

Sometimes it does pay to read the manual …

gum mug

What have they done with Wrigley’s Extra Peppermint Gum? It’s got a big Improved Flavour banner, but it tastes kinda cinnamony, kinda soapy to me.

At least it doesn’t taste like Thrills Gum, the tagline of which is “it still tastes like soap!“. But Extra Peppermint gum was one of my favourites, and now I’ll have to try something else.

Reindexing old MT entries

I’m not quite there yet, but I’ve got all my old MT articles with the same IDs as they had under that CMS. I basically used DrBacchus’ More about migrating from MT to WP method, but tried to integrate Scott Hanson’s Export from WordPress. It was not a complete success, but I’ll document what I did here in the hope that it’s useful.

DrBacchus was using an older version of MT, while I’m using the most recent version. I found that the file you have to edit to insert IDs is lib/MT/ImportExport.pm — not lib/MT/App/CMS.pm.

If you can avoid the temptation of adding blog entries to WP before importing from MT, do so. It’s a royal pain to add them later.

I used the WP MT-export module to export all my blog entries, then trimmed out the existing entries which had been entered in MT. I then added entry IDs to the export file (an awk one-liner: awk 'BEGIN{id=323;} {print;} /^STATUS: / {print "ID:", id; id++;}' worked for me, as my highest MT article ID was 322). I then joined the export files from MT and WP in one big ‘export.txt’ file.

If you have existing WP entries, you’ll have to get rid of them. I found that going directly into the database, and doing:

delete from wp_posts;
delete from wp_comments;

would do it.

Don’t forget to patch import-mt.php as per DrB’s instructions before importing.

Here’s where the pain comes in — WP wouldn’t import the text from the entries created in MT. It restored all the metadata, but not the content. So I had to manually patch in the entries from the export file.

I still have to work out rewrite rules for permalinks, but at least everything’s on the server where it should be. Maybe John’s Moved To WordPress rewrite rules will help me, as I think that my host (1and1) may not be doing entirely halal things with .htaccess support.

Normal Service Resumed, I think

I just got my blog working pretty close to the way I want it to be again. I should be back up and posting.

Big huge apologies to Catherine, with whom I was quite unnecessarily grouchy while this was not working. Sorry, Hen!

ping!

Still alive, incidentally. Just been on site, and had lots of visitors.

two companies that don’t get it

Please, online companies, whatever you do, don’t send users’ usernames and passwords in clear over e-mail. I’ve just ordered from Future Photo and delivery.ca, and both do this. Worse still, delivery.ca (or at least their Pizzaville service) allows you to save credit card information on their site.

As one who is just recovering from more than $8000 of fraudulent transactions on his card, this does not inspire confidence.

Steve Weber abides

Judith & Steve called me again. Steve treated me to a great version of ‘Skin Game’ (from Too Much Fun!) over the phone. I think having one of the elder statesmen of psych-folk play a personal concert for me while I waited for the Bathurst streetcar to take me to the CNE must be one of the weirder episodes in my life.

Published
Categorised as General Tagged

best … Leonards … EVER!!

best mini traffic cones ever

I found we had some of the best mini traffic cones ever in the office. They’re really tough, made of a kind of squishy plastic. We also have full-sized ones of the same material. Don’t know where we got them, but if Robyn Hitchcock ever starts up his cone artwork again, these would be perfect for miniatures.