The WordPress Migrate module supports the import of WordPress blog exports (WXR files) into Drupal. It will create Drupal taxonomy terms, user accounts, nodes, and comments from the WordPress export. WordPress Migrate is built on top of the Migrate module, a general framework for migrating content into Drupal, and requires Migrate 2.4 or higher. Although not strictly required, Migrate Extras is also highly encouraged, particularly if your Drupal target includes the Pathauto, Media, or Redirect modules.

Specifying the import source

After installing WordPress Migrate, you will find a Wordpress migration tab when you visit the Administration->Content area. This brings up a form prompting you for the source of the WXR export file, as well as several options affecting the import. You may either provide the address and credentials of your WordPress blog, or upload a WXR file you have already exported (from the Tools area of the WordPress administration interface). In the former case, WordPress Migrate will login to your admin area and perform the export itself - your credentials are used immediately for logging in, and are not saved anywhere. Note that earlier versions of WordPress do not support Export - to import them with WordPress Migrate you must upgrade WordPress first.

Import settings

In the lower area of the import form, you can make several choices on how your WordPress content is to be imported:

Convert WordPress pages/posts to - These options list all your Drupal content types, and allow you to choose how to import your WordPress pages and blog posts respectively.

Field for attachments - If the Drupal content type you chose to receive blog posts has any file fields, you will have the option of selecting them here. If you do select a file field, then any WordPress attachments associated with a given blog post will have their resulting Drupal images associated to this file field.

Field for Blubrry PowerPress podcasts - Similarly, selecting a file field here will cause it to be populated with any Blubrry PowerPress podcasts associated with the WordPress blog post.

Default format for text fields - This selects the Drupal text format to be set for migrated node bodies.

Convert WordPress tags/categories to the vocabulary - WordPress supports two kinds of taxonomy vocabularies - tags and categories. Here you may select how each of them is mapped to your Drupal vocabularies. Available vocabularies will be those attached to the Drupal content type which WordPress Posts are mapped to.

Path alias handling and Generate redirects - What options are available here depend on whether you have the Path, Pathauto, and/or Redirect modules enabled. With both enabled, you have all the following options for dealing with the public addresses of your migrated content:

  • Do not set path aliases - The final addresses of your content in Drupal will be the default node/<node ID> form.
  • Set path aliases to their original WordPress values - With path alias handling (the Path module) enabled, you can set your aliases in Drupal to exactly match those in WordPress - once you switch your domain from your WordPress blog to your Drupal site, bookmarks and search engines will automatically be pointing to the right place.
  • Have pathauto generate new aliases - With Pathauto enabled, you can have new aliases generated according to patterns you define.
  • Generate redirects - With Redirect enabled, you can set up 301 redirects from your old WordPress addresses to your new Drupal addresses (this cannot be used with the Set path aliases to their original WordPress values setting). This means that, although the addresses are different on the Drupal site, anyone (including search engines) trying to access the old WordPress addresses will automatically be directed to the new addresses, and will be told to update their bookmarks or search engine data to reflect the new address.

Performing the import

Once you've specified your source, and established your import settings, click Import WordPress blog. The import process will begin using the Batch API - do not close the window or tab the import is running in, or browse to another page, it must be allowed to complete in place.

Imported blogs

When the import is done, you will find yourself at the Imported blogs tab. This lists WordPress blogs that you have imported into your Drupal site (yes, you can go back and import more than one blog), and shows how many of each kind of item have been imported. Also, you have the opportunity to undo the import - by selected a blog, making sure Remove imported content is selected, and clicking Update, your imported content will be deleted, along with the data used to track the import. You may wish to do this if, for example, you realized that your blog included HTML Markup not allowed by the Filtered HTML format, and you want to go back and try again with the Full HTML format. Once you're sure you want to keep the imported content, you can choose Remove migration bookkeeping, which will remove the tracking data without touching the imported content.

Comments

spadooky’s picture

when i click the tab, all i get is "File upload failed: Directive 'register_long_arrays' is deprecated in PHP 5.3 and greater. Please make sure the file you're trying to upload is not larger than 32 MB" in a green box, with a green check mark (which i have always attributed to success, but i'm not feeling very successful here) and below that, "A private file system path must be configured to securely store your uploaded WordPress file."

i have zippity-doo-da idea what any of that means. an attempt to make a private file system path as was requested resulted in tears, pain, and sorrow.

21tech’s picture

Use the instructions on this post to create a private file system automatically through the drupal GUI: http://drupal.org/documentation/modules/file

Once you create that the from should be there. It worked for me on d7.14.

lcsi’s picture

I'm missing something. I tried following your directions, but is there a special content type to create in order to make it appear on the WordPress Migration tab? I tried creating a new type and also added the file type to article since that's what I was going to use for the import. I still have no prompt for specifying the file.

What am I missing?

Thanks.

texas-bronius’s picture

I needed to pull in a small, Old old old WordPress 1.5.2 site which is not supported by Wordpress Migrate. I pulled in a copy of the site locally, gave it its own vhost and db in MAMP, and followed WordPress upgrade instructions at wordpress.org.

WordPress is not a joy to move across domains, but it's not too bad: update the database `options`.`siteurl` and `options`.`home` urls, and you should be home-free.

Then I pointed my Drupal WordPress Migrate source to this local vhost, followed the other steps and default options, and voila, 15 pages (Basic Page) and 75 posts (Article) were in faster'n you could shake a stick at it.

--
http://drupaltees.com
80s themed Drupal T-Shirts

texas-bronius’s picture

What is the oldest version of WordPress that supports Export that WordPress Import supports?

--
http://drupaltees.com
80s themed Drupal T-Shirts

orizonmedia’s picture

Hi,
in your post you say «WordPress supports two kinds of taxonomy vocabularies - tags and categories.»
In fact, I have custom taxonomy vocabularies in wordpress to group article each other. Is there a way to import those vocabularies in addition of tag and category and map them to drupal vocabularies? I have a blog to import with 5000 more articles...

thank you very much

caspervoogt’s picture

The instructions say "Once you've specified your source, and established your import settings, click Import WordPress blog. The import process will begin using the Batch API - do not close the window or tab the import is running in, or browse to another page, it must be allowed to complete in place.".

I am using Drupal 8.7.7 and see no 'Import WordPress blog' link. Is that link perhaps just a D7 thing?

ttamniwdoog’s picture

Hi @caspervoogt,
This page is pretty specific to the D7 experience. While the D8 docs are not helpful yet, I recommend the README.txt file.