Importing my old blog

by Michael Burns around March 6th, 2010

Finally got around to it. I tweaked the updated Drupal -> Wordpress sql script to migrate blog posts and pages over without having to delete existing posts in my Wordpress MU blog. And Success! My blog posts dating back from ‘07 and earlier are now nicely imported from my old Drupal 6 site and into Wordpress.

INSERT INTO mburns_drupal.wp_posts
(post_author,
post_date,
post_date_gmt,
post_content,
post_title,
post_excerpt,
post_name,
post_modified,
post_modified_gmt)
SELECT node.nid,
FROM_UNIXTIME(node.created),
FROM_UNIXTIME(node.created),
node_revisions.body,
node.title,
node_revisions.teaser,
concat('node/', node.nid),
FROM_UNIXTIME(node.changed),
FROM_UNIXTIME(node.changed)
FROM mburns_drupal.node, mburns_drupal.node_revisions WHERE node.nid = node_revisions.nid;

From Code, Geek

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS