The united-coders.com blog migration was my motivation to update a non-technical, german blog from a serendipity blog (short s9y) base to wordpress. The reason of switching to wordpress are different and will be reported here only from the technical view: Regularly updates, many themes and an active development community – but php.
First step for a blog migration (content and hosting) is a clean new installation on the target host. Use a dummy domain (and not a sub-folder) and configure a theme and some necessary plugins.
content migration
I found an open-source plugin from abdussamad.com (*ops* – he switched to offer a commercial s9y migration service) for serendipity blogs (comes from a blog article on snowulf.com and his svn, issue for update). It has the possibility to read from the serendipity database all users, articles, tags and comments and convert/import into the wordpress database.
First problem: I can’t access from hoster2 to the MySQL from hoster1 – but I can access from my workstation to both. With this line you can “COPY” all data (precondition: you have mysql and mysqldump as command line tools available).
mysqldump --host=mysql.hoster1.com --user=admin1 --password=test12 s9y_blog | mysql --host=mysql.hoster2.com --user=admin2 --password=test12 --database=wp_blog
With this line the complete database schema and data are exported and with the pipe the import is started directly.
Now the s9y tables are accessible from the s9y import plugin – the tables are seperated by the s9y prefix. I started the s9y plugin and after some auto_increment-preparing SQL’s (read the readme from plugin) the content is now wordpress content, but all non us-ascii character was broken. The reason was the iso-8859 encoding in the old s9y-database (or only latin1), the new wordpress tables are using utf-8 encoding. Using the --default-character-set
option doesn’t helped.
It could be fixed by setting on the php database connection (adding this helper function inside the migration plugin)
function connect_s9ydb() {
$s9ydb = new wpdb(get_option('s9yuser'),
get_option('s9ypass'),
get_option('s9yname'),
get_option('s9yhost'));
$s9ydb->set_charset($s9ydb->dbh, get_option('s9ycharset'));
set_magic_quotes_runtime(0);
return $s9ydb;
}
geo location migration to wordpress
I used a s9y plugin to store geo locations to articles. They are located in the entryproperties
table and named “geo_long” and “geo_lat”. A wordpress plugin with a compatible usage is WP Geo. It offer an edit form for every article and some view option like a google map for the last n=100 geo-tagged articles (see example). The properties are saved into the post_meta
table as "_wp_geo_longitude"
and "_wp_geo_latitude"
entries. I extended the s9y import plugin with a fifth step for this data.
problems after migration
The default sitemap plugin from wordpress doesn’t escape “&” in the urls (it is correct migrated from s9y). The resulting sitemap.xml has plain &-characters and the reader reports syntax error in xml. I edited the 5 articles with “&” in title (and so in the url) – correct bugfix should be xml-escaping for reserved characters (read more about escaping).
Username and user_nicename
are different in wordpress. The migrated usernames from s9y are formatted "firstname lastname"
, but the internal links used for author links without escaping and dont work. The user_nicename
is not editable from wordpress and I changed the item directly via sql console. Or you can use php-admin (described like wpcanada.ca) or edit the sy9 plugin (if you can many user accounts).
One funny part was the missing admin emails. You can register your normal (extern) email adress, but if your domain has no wordpress@mydomain.com
no emails will be sent.
Links to other articles or s9y typical locations can be redirected with several redir plugins and are useful to find broken links to your migrated content. In your articles you can find/replace old links directly with a offical plugin (names Search & Replace Plugin). One warning: one empty replace field and you replaced your search string with nothing and your content is lost!

Christian Harms

Latest posts by Christian Harms (see all)
- google code jam 2013 – tic-tac-toe-Tomek solution - April 16, 2013
- Google code jam 2013 – the lawnmower - April 14, 2013
- code puzzles and permutations - April 11, 2013