This blog is now live at

Tuesday, November 13, 2007

How I moved a blog from Serendipity to Wordpress

I had a blog using the S9Y framework aka Serendipity but obviously since Wordpress is THE blogging framework around I had to move to it.

Unfortunately S9Y is not one of the supported import modes of Wordpress. Fortunately, a quick Google search pointed me to the following page, which gives one ! You just need to drop the file in the wp-admin/import directory of your wordpress installation, and use the standard import mechanism.

After that, I ran into the following error beause of my hosting provider ( : "failed to delete and flush buffer. No buffer to delete or flush". After lots of goggle search which led nowhere since this is a classic PHP error happening on lots of blogs, I decided to tackle the problem myself. After some good old "echo debugging", I found out, that the problem was the following line of the serendipity.php file :
$cats = $this->get_s9y_cat_assoc($ret_id);

I commented it out and replaced it by :
$cats = array();
Now, you might say "cool, but this has to have some side effects!". And you're right. Apparently with the posts category, but since there was none on the imported blogs... Who cares ;-)

Don't hesitate to post, if you know a better solution !

1 comment:

Simon said...

A friend told me I stilla had a problem with the accents ... I think I now have solved the problem adding the following line :
$s9ydb->query('SET CHARACTER SET latin1;');
I guess you should put it right before the get_results calls, and I'm not sure if it should be a one time thing or if it should be done before any query.
The reason behind that is encoding : Serendipity is in latin1 and PHP in UTF8 by default, thus messing up accents !