Migrating Serendipity to WordPress

A quick post on migrating all posts from a Serendipity site to a new WordPress install. It seems a daunting task, but WordPress has triggers that set fields automatically. If one is happy to ignore categories and tags for a moment the steps are simple :

If you allow WP to create its tables in the same database as where the serendipity tables reside, below query will copy the post into WP.

insert into `wp_posts` (post_title,post_content,post_date,post_author) select title post_title, body post_content , FROM_UNIXTIME( TIMESTAMP ) post_date,1 from serendipity_entries where 1;

Try it with limit 0,1 at the end first (copies only one line). You don’t need to empty the posts table.

Categories can be added with extra queries, but can also be added based on searches like ‘insert –select where post_content like ‘%[search term]%”