Apr
30
2012
Painlessly Migrate from Wordpress to Drupal
Published by Joel Steidl
In this tutorial, you'll learn how to migrate content from Wordpress to Drupal.
Versions in use: Wordpress 3.3.2 & Drupal 7.12
Video Screencast
Painlessly Migrate from Wordpress to Drupal from Aten Design Group on Vimeo.
Step by Step Instructions
- Login to your Wordpress Admin
- Navigate to Tools → Export
- Download WXR File containing "All content"
- Make sure your XML file is valid using xmllint on the command line (Wordpress Migrate is particular about having valid XML)
- xmllint comes preinstalled on OSX
- Open terminal and type xmllint mywordpressexport.xml
- All XML errors will be shown (line number and exact location)
- Make appropriate fixes to the XML
- If you run xmllint mywordpressexport.xml and the entire file prints to the screen, your XML is valid!
- Install the appropriate Drupal modules
- Migrate - robust Drupal module for migrating all sorts of content
- Wordpress Migrate - Migrate submodule that allows you to perform a Wordpress migration without writing code!
- Migrate Extras - provides functionality to import clean URLs using Pathauto
- Pathauto - provides functionality to have clean URLs in Drupal
- After logging into Drupal navigate to the Find Content screen & click the Wordpress Migration tab in the upper right
- Choose Import from a File
- Select your valid XML file from your computer
- If necessary, adjust import settings below
- Choose immediate import method unless you have a really large dataset (they have options for using Drush for a "background" import)
- Migration Complete!
- Navigate to Find Content to ensure your data was properly imported.
Caveats
- Authors are not currently migrated
- Wordpress images will still have the old path (this can be solved by doing a find and replace in your XML file before importing)

Nice post!
Also, if you have some basic PHP skills, you can use the Migrate module (and WP Migration sandbox module) and make this even easier, plus get the exact results you want.
If you install the Media module, it will also migrate in all your media - images, PDFs, files, etc.
Eric
Was happy to read this post and find it very useful. Unfortunatly, I missed to read this post almost two years ago. We needed to migrate a website and it was a struggle.
Buy it did worked eventually :-) http://online-behavior.com/migrating-wordpress-drupal
There's a typo in the title: it should be "upgrade" instead of "migrate" :)
Great post. FYI, wordpress_migrate uses fopen so some folks will get some odd failures or will see that the images in their migrated posts will still point to the original source rather than being moved to Drupal.
We ran across this with someone recently and posted on how to enable fopen in a custom php.ini on a shared cloudlinux based host with Cpanel.
http://blog.tech4him.com/2012/04/cpanel-and-custom-php-ini/
@Kevin Sounds interesting. Do you know if it allows migration of authors? Do you have a link to the sandbox? @Eric Great tip! @Alex Ha! @Tom Thanks for the tip. I'm sure that will help someone!
Great write up. I love Drupal Migrations!
We recently migrated an Alexa Top 1000 website from Vignette o Drupal and it wasn't as near as easy as this. However, we do have one common denominator. Or two I should say.
Migrate Module & Migrate Extras.
Id like to add that anyone needing to migrate authors need just set up a 'user migration class' prior to migrating everything else and then proceed w/ the steps here. Thanks for the write up!
You left out very important steps: 1) you mention something about setting up taxonomy. I have no idea how to do this; You didn't clearly explain how to use xml lint. An otherwise helpful video rendered useless for many, (beginners) unfortunately.
Daniel:
Re Checking XML: I just use http://validator.w3.org/. You have to have your file on-line somewhere, but it gives you the exact line number of any errors. The sites I have migrated have two lines starting with "> "Content types" >> "Blog entry" >> "Manage fields", I first added "Tags" by placing "Tags" in the "Label" field under "Add existing field" with "Term reference: field_tags (Tags)" as the "Field to share". I did not change anything under the "Edit" tab.
I then added "Category" in the "Add new field" as the Label. Then choose "Term reference" as the Type of data to store and "Autocomplete term widget" as the Form element to edit the data. Then on the "Field Settings" choose the correct taxonomy. "Categories" should come up for the "Vocabulary". This ties it to the Taxonomy. Under the "Edit" tab, I only changed "Number of values" to "Unlimited".
I hope I have not made an error in all this and hope it helps.
Hi for some reason am getting this error:
Could not prepare directory wordpress: - make sure your Drupal files directory exists and is writable
I checked the xml with xmllint and appears okay.
Not sure what could the reason be?
@Marin - Are you getting that error when trying to upload your xml file? It sounds like just a directory permission issue.
If you need to search & replace text after import, I've written a drush plugin that allows you to do that.
I'm on the way to move content from wp to drupal, I have already installed wordpress site and theme and everything stumbles upon content migration. I don't want to spend much time proceeding with that, so i found a source that offers to move it faster. Here's a tool http://www.cms2cms.com/supported-cms/drupal Is it worth to try? I really want to save time...