Howto migrate s9y blog to WordPress

Migrate s9y posts
– use import from RSS, rss =

And then update to whole body:

UPDATE wp_posts w, sp_entries s 
  SET w.post_content = CONCAT(s.body , '<!--more-->', s.extended) 
    COLLATE utf8_general_ci
WHERE w.post_title = s.title COLLATE utf8_general_ci ;

Migrate s9y comments

INSERT into wp_comments
  (comment_ID, comment_post_ID, comment_author, comment_author_email, comment_author_url, 
   comment_author_IP, comment_date, comment_date_gmt, comment_content, comment_karma, 
   comment_approved, comment_parent, user_id)
SELECT, wp_posts.ID,, email, url, ip, 
  FROM_UNIXTIME(sp_comments.timestamp), FROM_UNIXTIME(sp_comments.timestamp),
  sp_comments.body, 0, 1, parent_id, 1
FROM sp_comments
INNER JOIN sp_entries ON (sp_comments.entry_id  =
INNER JOIN wp_posts on (sp_entries.title = wp_posts.post_title COLLATE utf8_general_ci ) ;

Generate HTTP rewrite rules
(some articles ID’s may have be changed during migration)

  'Redirectmatch permanent ^/archives/',, '-(.*).html$ /',
  REPLACE(LEFT(w.post_modified, 10), '-', '/'),
  '/', w.post_name, '/') AS new_url
FROM sp_entries AS s
INNER JOIN wp_posts AS w ON (
  w.post_title = s.title COLLATE utf8_general_ci
  AND w.post_type = 'post') ;