How To Migrate Content from a Wordpress Blog to Drupal 7

Submitted by david.reagan on Mon, 01/16/2012 - 13:03

As you can see, I have migrated my personal blog to this site. It's now here: Personal Blog. I tried a couple methods, I used Feeds and was able to easily import posts, but I couldn't figure out how to get the comments as well. After a bit of searching, I found the Wordpress Migrate module. And it worked quite well. The only thing I don't like is that it requires Drush to be installed on your server. Not a problem for many people, but it could be an issue for those on shared hosting. Anyway, the following directions assume you can use Drush. Be sure to read the entire post before doing anything. I've started following steps before reading the entire thing many times, and I've usually screwed up something because of that. 

First get the following modules:

If you use Pathauto:

Download them with drush:

drush dl wordpress_migrate migrate migrate_extras features

Enable them with drush:

drush en wordpress_migrate migrate_extras_pathauto migrate migrate_extras features

Next, create a taxonomy vocabulary for your Wordpress categories, or use an existing one. You'll need this before you create a content type for your import.

Then create a basic content type with title, body, and term reference fields. Set the term reference field to whatever taxonmy vocabulary you want to use for the Wordpress categories.

Creating a taxonomy vocabulary and a content type could be skipped if you wish to import into an existing content type or vocabulary. Totally up to you, this is just what I did.

Configure Wordpress Migrate at admin/content/wordpress/configure. Make sure to configure the drush path. Wordpress Migrate doesn't seem to import large Wordpress sites very well without it. This is where you tell Wordpress Migrate what Content Type and Taxonomy Vocabulary to import into. You also can set what text format to use. I had to set mine to Full HTML, my first couple tries had html tags being displayed in my imported posts. 

Go to your Wordpress site and export it into a WXR file. Alternatively, you can give Wordpress Migrate your site's url, username, and password. But I didn't test that feature.

Go to admin/content/wordpress. You can find it via the main Content view as well as using the url.

Use the upload file field to upload and import your WXR file. This can take a while, and if you have a large site to import, it will likely say that you will get an email telling you when it's done. Aparently it uses Drush in the background to finish the import process.

The final step I took was using Views to create a new view for my Personal Blog content type. You may or may not need to do this, depending on how you set your content types up.