Migrating from Serendipity to Wordpress

Posted on January 25, 2008
Filed Under development, mac osx | 3 Comments

This blog is really a note to myself and anyone else interested in doing the same thing. Basically, I wanted to move off my old blog based on Serendipity 1.1 and onto the latest version of Wordpress (2.3.2 as of yesterday evening!). After picking my way through doom and gloom posts, it’s impossible, I chanced upon a great post by TechnoSailor who had written a wordpress importer script to do this. Bliss! His script worked for me (with the exception that all my posts were put into the uncategorized category, but no big deal). However, other people were have different problems that SoGua fixed and posted out an updated version of the wordpress serendipity importer. Nice man!

The import process goes something like this:

  1. Download and unpack wordpress into a directory.
  2. Create database to hold wordpress content.
  3. Get wordpress up and running by following the instructions /wp-admin/install.php
  4. Unpack and copy the serendipity.php from TechnoSailor from into wp-admin/import directory.
  5. Import the posts by clicking on the Serendipity import from the site admin's Manage | Import menu.
  6. Follow the instructions and be sure to keep a note of the new admin login details.
  7. Log into wordpress AND change your admin password.

Now that should all work for you, but , my hosting provider (1and1), given that I’m in a shared environment, hides its databases behind a firewall. Which is fair enough. However, the also prevent users that try to access the database from 1and1 trusted servers to access the database directly. Really annoying. Why is this a problem? The serendipty importer is useless to me if I cannot access both the database from 1and1 web servers. Ahhhhh!

So, i did the following:

  1. Created a local instance of wordpress.

    For Mac OSX users with MySql you need to specify 127.0.0.1 within the wp-config,
    not localhost otherwise you get a failed connection

  2. Used 1and1's phpAdmin SQL tool to export a dump of my Serendipity database and re-create the database locally
  3. Imported posts stored in this local Serendipty database into the local wordpress instance using TechnoSailor's script
  4. Exported the local wordpress database, with all the juicy serendipity posts, as a SQL script

     e.g. mysqldump --opt  -u  -p

  5. Tweaked the exported SQL script.  In particlar, the stuff within the wp_options table needs to modified.
     Namely the siteurl which needs to be changed from your local wordpress instance (http://localhost/~clevegibbon/blog)
     to the target wordpress instance (e.g. http://www.clevegibbon.com/wordpress.  If you don't do this, when you click
     around your target site it re-directs you to your local wordpress instance's url.
  6. Use the phpAdmin SQL screen to run the exported SQL script.
  7. Log into your new blog.

Job done. Time for a coffee…

Comments

3 Responses to “Migrating from Serendipity to Wordpress”

  1. Greg on January 25th, 2008 10:10 am

    wordpress is indeed fantastic blogging platform that offers lots of flexibility while ensuring quality and stability. Good to know there is another true follower :)

    on the side note: in RSS you posts are signed as published by “admin”. maybe a little change/configuration might be in order?

  2. cleve on January 25th, 2008 11:05 am

    Thanks for that. Fixed!

  3. Gigu on January 25th, 2008 10:23 pm

    Well done. Looking at your last blogging engine was horrible. I’m using WordPress since you told me about it and I was surprised you stopped :)
    Good job anyway :)

    Greg

Leave a Reply