Helping a friend migrate from Blosxom to WordPress

A friend of mine (who I hope to convince to move off his shitty hosting) has been using Blosxom for a while and wants to move off it. I googled for a bloxsom to wordpress importer, and found a variety of information. The consensus seems to be that your nested categories (but perhaps not main ones?) won’t be moved, unless you use the RSS importer (which is what halvorsen.org recommends and gives instructions on). There’s another thing, a bloxsom posts and comments importer on insanum.com that nobody has referenced as far as I can tell. A few sites link to the nozell method, but it looks pretty hackish from first glance (unto.net agreed and made a better importer because of this). (Note: The previous two links, unto.net and insanum, are linked from the codex) A selfish bastard at serpentine.com wrote a post about how he wrote a python script to do it, but didn’t share.

While I knew about the codex (which was sadly very far down in google results, considering how authoritative it should be on the subject), I like to make sure that I’m not missing something just because I went straight to the codex. Sometimes good things can be missed, and after doing this digging, I can approach it with a little more confidence than before. I don’t wanna fuck up someone’s work, I take even a free favor seriously because I want good word of mouth. Of course, having a blog titled MBILF might make me look like a bad guy (hopefully the content can speak for itself, it’s not like my blog’s title is motherfucker, right Mike Lee?).

I use parentheses way too goddamn much. I’m going to investigate the two linked from codex (since they do seem to be the best) a little more, determine the differences, and go from there. Too bad python guy didn’t share his script, it might have imported categories properly, but maybe the ones that I haven’t looked into deep enough do as well, so… yeah. I’ll try to update this later (unlike forgetful Adam).

edit: i have to use the insanum one, because the unto one is a perl script and he doesn’t have shell access :(

On using the Insanium script (I might end up trying the other one on my own server using a copy of his backup later, as this appears written by a madman):

To even get to see the screen where it tells you that you need to set up your special rss20 theme (which the official page on flavours doesn’t even detail very well), you have to have the script in a directory below the directory holding wp-config.php. I’d have fixed this in the script, but it doesn’t matter, so I stuck it and the saved rss.xml in wp-content.

I found out soon after that the reason I shouldn’t have used /index.cgi/index.rss to generate a file and save it as rss.xml, is because all the title fields were empty (no titles!) and there were no dates.

I tried setting up a copy of the backup on my dreamhost server so I could use the perl script from unto.net, and the way it works is you run the perl script against the blosxom directory holding all your .txt files (this is great). It is supposed to then output the data in a well formed rss file. I got a blank RSS file:

[dalitz]$ ./bloxwp.pl blosxom/
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel></channel></rss>

Oh well. Now I’m going to keep trying to work on the Insanium stuff to try to get Bloxsom to use the flavour, this is going to be a bitch.

I DID IT! Here’s how.

I used the Insanium php file, because it worked once (but didn’t get titles or dates). I was trying to figure out how to set up flavors, but knew that /index.cgi/index.rss (where the main Blosxom cgi file creates the alternate RSS) was generated by index.cgi. I checked the bottom and there were several lines starting with RSS. I added a pubDate section after description in the RSS area, and changed the title from $title to $fn since that’s the file name (and no titles were set). This worked!

Here’s the line, it’s right above rss date \n which happens to do nothing apparently:

rss story   <item>\n    <title>$fn</title>\n    <link>$url/$yr/$mo_num/$da#$fn</link>\n    <description>$body</description>\n  <pubDate>$dw, $da $mo $yr $hr:$min:00 EST</pubDate>  </item>\n

After that, I saved the results of going to index.cgi/index.rss to rss.xml, put that into the wp-content directory along with the import-blosxom.php from insanium, and ran the import. It worked beautifully. That was much easier than figuring out how flavours work.

WP Greet Box icon
Hello there! If you are new here, you might want to subscribe to the RSS feed for updates on this topic.

1 Comment »

  1. Julian had this to say,

    July 21, 2009 @ 5:27 pm

    Strange…I still don’t get what you mean, maybe I should translate it =.=

Leave a Comment