A Quick Migration of WordPress to Drupal 8
I recently discussed a DIRECT workflow for migrating WordPress to Drupal 8.
That process assumes you want to install WordPress on your local computer. But, remember that WordPress, being a CMS like Drupal, also requires Apache, mySQL and PHP. Below I'll show you how to get that local WordPress environment setup. BUT, the thought of setting up a new development environment for Wordpress might make you cringe, especially if you love Drupal the way I do. If so, skip that part, you really don't need it.
Since your customer already gave you the WXR file, Drupal purists might just want to keep their local computer "clean". If that's the case here is a really quick way to get Wordpress into Drupal 8 without having to become a WordPress guru along he way :-)
My Starting Point
Say all the customer gave you was a WordPress WXR file.
I’ve already documented “A Quick Migration of Drupal 6 to Drupal 8”. That way was essentially one Drush command once your SOURCE D6 and TARGET D8 sites are setup.
Building on that infrastructure, just one more drush command will make additions to your D6 site so it can be used to quickly import WordPress to Drupal 6.
Then just use the same quick import previously described to get you all the way to D8!!!
Preparing your WordPress SOURCE site
(If you already have WXR file you can skip this section if you want. I’m including it here because it is helpful to know exactly what it is you are dealing with when it comes to performing migrations successfully.)
For this demo, first I describe how to get WordPress setup on your local workstation. The quickest way I know to do this is to grab the bitnami stack from https://bitnami.com/stack/wordpress/installer.
This is a well documented ‘one click’ type install for Win, Linux, and Mac operating systems. For this demo I’m working off a MacBook Pro with a fresh install of OS X El Capitan Version 10.11.3.
From my Bitnami WordPress Stack 4.3.1-0, just “Go To Application” to Access WordPress …
… and login as the Site Admin.
Towards the bottom of the left menu open up “Tools” (by clicking on it) and you’ll see the Import and Export tools for WordPress. If you don’t have the source site yet, you’ll need to coordinate to get that of course, but its accomplished using the Export Feature. On your local then you want “Import” WordPress.
So far, we’ve looked at working with the SOURCE WordPress content. Getting that onto you local provides a safe place to tweak and explore, which is especially important when you are dealing with larger, complex WordPress sites. I some cases you may want to edit the WordPress content before you import it to Drupal.
Moving WordPress to Drupal 6 on your local
In an earlier post, I already documented a quick way to setup Drupal 6 on your local environment. On that setup, we need to get it ready to import your WordPress site. For that we’ll need to load two Drupal contributed modules into our D6 site. The modules needed are “Wordpress Import” and “Ctools”.
We’ll load those up using drush, so from the Drupal 6 root directory typing in the following drush command to your terminal will install the modules you need.
drush dl ctools-6.x-1.14 wordpress_import-6.x-2.2
At this point you need to go into
and enable the two modules you just installed.
Once enabled, navigate to
and Upload your WXR file to import Wordpress into Drupal 6
WXR stands for “Wordpress extended RSS” and the file you are looking for will have a .xml extension it.
After choosing that file and selecting “Next” a series of screens will guide you thru the import process that lets you be pretty specific about what exactly you want to bring in, by who, and when. A simple import might take a couple minutes to complete and Drupal provides a nice summary detailing what exactly it imported.
Then, getting that into D8 is really just one more drush command … BUT REMEMBER … the D6 site is now your SOURCE.
So, you need to navigate to the root directory of your DESTINATION Drupal 8 site. From there you can run the following command (which we already looked at in the earlier blog post).
drush migrate-upgrade --legacy-db-url=mysql://root:@127.0.0.1:33067/drupal_6_38 --legacy-root=http://drupal-6-38.dd:8083
Ooops, this brings us to something very interesting, as of the time of this writing drush migrate-upgrade, “drush migrate-upgrade” is not compatible with the most current version of Drupal 8.1.x-dev, which will be released around mid April 2016.
The plan is for the drush support to be added to drush itself at some point - at that point the contributed module (Drupal Upgrade aka:migrate_upgrade) will become obsolete.
So we’ll just work with the Drupal Upgrade UI provided with Drupal 8.1.x. It is accessed via /upgrade. The values shown in the form are the same ones used in the drush command of the other d6-d8 blog (and shown above for easy reference).
Clicking “Review upgrade” will tell you pretty quick if you entered the required info in correctly. If not, keep trying, it actually does work when you get it all exactly right.
When the upgrade completes you will se a screen like this …
You’ll note that the Drupal 8 site name now reads “drupal-6-38.dd” because that is the name of our SOURCE D6 site that we just imported!!! You can go in and check your content and various other settings to make sure you got what you were after.
Here is what we just did …
1. Setup a new local install of Wordpress to review your Source WXR content
2. Installed a couple contrib modules to Drupal 6 to manage the content import
3. Imported the WXR file (content) into Drupal 6
4. Reviewed the Drupal 6 migration
5. Migrated the content from Drupal 6 to Drupal 8 using the UI
We built on the work accomplished in our earlier blog so D6 and D8 were already installed and setup to a point. We used one drush command with D6 to download the contributed modules needed. We used the Drupal Upgrade UI to import the data into Drupal 8.
With this workflow, and a little practice, you can easily migrate your Wordpress content into Drupal 8 in 15 minutes or less.
Planning is a very, very important part of performing migrations, and can save a lot of time and headaches. Sometimes, its just easiest to do it to see what you are really getting into, and the various things you need to plan for that may have been overlooked.
Depending on the level of complexity and the amount of content on your WordPress site, you may find it too much for your in-house content managers to accommodate. That is when its time to look for a full service Drupal shop with Developers who know how to extend Drupal core migration capabilities with custom modules to help make the conversion experience accurate and manageable for all parties involved. Remember also, that while well formed content is a valuable business asset, it is the talented Designers that make the site "pop" and experienced Themers that assemble the great user interface!!!