After importing my Drupal database into my WordPress database, a single MySQL query imported all of my articles from Drupal to WordPress (without comments). All that’s left is to add categories and tags, and build URL redirects from thedouglasclan.com over to iandouglas.com. I simply got tired of some of the imitations I found in Drupal, and find WordPress a much friendlier interface to use.
For anyone curious enough, here’s the query I used to migrate from Drupal 6.8 to WordPress 2.9:
INSERT INTO wp_posts (id, post_author, post_date, post_content, post_title, post_excerpt, post_name, post_modified, post_status)
SELECT DISTINCT 120+n.nid, 1, FROM_UNIXTIME(created), body, n.title, teaser, REPLACE(REPLACE(REPLACE(REPLACE(LOWER(n.title),' ', '-'),'.', '-'),',', '-'),'+', '-'),FROM_UNIXTIME(changed), "draft"
FROM drupal6_node n, drupal6_node_revisions r
WHERE n.vid = r.vid;
The 120+ vaue in the ID field is because I currently had 120 items in my wp_posts table already, and each post must have a unique ID. So, I simply added a value of 120 to whatever ID value was in Drupal. The ’1′ value in the post_author field assigns my WordPress user ID as the author of each article. I also added a post_status of “draft” so I could go through the articles, verify their integrity, and then publish them.
Recent Comments