Drupal to WordPress Migration Resources
This final part of the Drupal to WordPress Migration Guide provides a comprehensive collection of migration tools, including SQL queries, Python utilities, and detailed worksheets. It also features practical checklists for content auditing and SEO preservation, along with troubleshooting guides for common migration issues.
Other tools, resources and guides for CMS migration projects
Drupal to WordPress migration worksheet
It's important to gather as much information possible about your Drupal installation before starting the migration project. You can use my Drupal to WordPress migration worksheet to help structure your investigation process.
How to write a migration mapping document
Preparing a CMS migration mapping document before starting your project will save you time. It simplifies the project by giving everyone a clear idea about the type of content involved. This short overview will get you started with writing a migration mapping.
Preserving SEO during a Drupal to WordPress migration
Is SEO is important to the project? See my guide for preserving SEO during a Drupal to WordPress migration. I explain the differences between Drupal and WordPress URL structures and pitfalls to keep in mind. Read it on the blog section: Preserving SEO during a Drupal to WordPress migration.
Troubleshooting Drupal to WordPress migrations
If you're running your own Drupal to WordPress migration project and encounter problems, you might find some solutions in my migration troubleshooting articles.
Scott Anderson's blog post
Much credit goes to Scott Anderson and his blog post, How I migrated a client's blog from Drupal to WordPress 3.0. His set of MySQL queries were invaluable when I started migrating client sites from Drupal back in 2011. Scott cites Mike Smullin, D'Arcy Norman and Dave Dash as sources.
A Guide for Drupal Developers Migrating to WordPress
This guide from OnTheGoSystems gives Drupal developers an introduction to the WordPress interface. While it doesn't go through running a content export, it'll help if you want a quick introduction to using WordPress.
WordPress Codex
The WordPress Codex has a page on importing content form different sources, including Drupal.
Content migration tools for other platforms
Looking to migrate other types of content? Visit my migration tools page for utilities to migrate content from other platforms.
Download my Drupal to WordPress migration tools
CAUTION: Make a backup of both your Drupal and WordPress databases before running these scripts. USE IS ENTIRELY AT YOUR OWN RISK. I'm offering them with no warranty or support implied.
Description | Platform | Download |
---|---|---|
pyD2W, a command line Drupal to WordPress Migration Tool | Python | GitHub |
Web-based Drupal to WordPress Migration Tool | PHP & web front-end | GitHub |
Sample SQL queries for migrating content | MySQL | GitHub |
Important reminder
These scripts and tools run MySQL queries to read information from a Drupal database and convert the content to WordPress. They may write temporary tables and make changes to your Drupal content. With this in mind, it's imporant to avoid working on your live Drupal database. Above all, make backups before using these tools.
Web-based Drupal to WordPress export utility
This web-based utility, released in 2013, was my first attempt at building a Drupal to WordPress migration tool. It was based on my in-house scripts to migrate standard content types from Drupal 6 to WordPress 3.5. Although functionality is rudimentary and the tool is no longer being maintained, it might be useful for simple sites if you have a technical disposition. The code uses PHP 4 so you'll need to make changes to run on modern environments.
Feature list:
- Migrates content from Drupal 6 to WordPress 3 and 4 database
- Shows number of Drupal terms, node types and entries to be migrated
- Select Drupal content types to be converted into WordPress posts
- WordPress file directory setting
- WordPress permalink structure setting
- Select which Drupal terms will be used as WordPress categories
- Select the WordPress default category
Web-based content migration: Installation and use
- Copy the package folder to a web server.
- Edit the MySQL queries. (See below.)
- Run the drupaltowordpress.php script on your browser and follow the on-screen instructions to export content.
Both the Drupal and WordPress databases should be on the same server and share the same connection details.
Editing the MySQL queries
While the web front end works with very basic Drupal installations, anything more complicated will need custom SQL queries. These can found in the drupaltowordpress-custom.sql
file. The script contains sample values so don't run it without understanding what will be performed at each step. You'll need to edit the SQL queries to suit your own Drupal setup. For more information, see the SQL queries section below.
For post-export troubleshooting, please see Drupal to WordPress migration notes for additional help.
Command-line Drupal to WordPress migration tool I wrote a Python-based command-line tool because the web-based export utility proved too inefficient for complex Drupal configurations. Although it requires more manual editing of MySQL queries, you can more conveniently run heavily customised site migrations.
Command-line content migration: Installation and use
- You will need to install the Python modules in the requirements section below.
- Rename the
settings-template.py
tosettings.py
and edit it to match your migration project settings. - Edit the included SQL sample files in the
sql-sample
directory to suit your migration requirements. At a minimum, you will need the migration script itself (see the samplemigration_standard.sql
file). - Run the utility using the help flag to view the available commands:
$ python d2w.py -h
Customising the export script for your Drupal setup
The Python script itself won't perform the migration. To emphasise, you must supply it with an export SQL file containing the migration queries. See the SQL queries section for more information.
Required Python modules
- MySQLdb for accessing the backend Drupal and WordPress databases
- prettytable for displaying results in a table format
- phpserialize for unserializing Drupal fields
Note: all my latest versions of the command-line tool now include a requirements.txt
file which you can use with a pip install -r
command.
Drupal to WordPress Migration SQL queries
Both the web-based and command-line utilities are simply convenient wrappers for SQL queries. While you can run a migration by typing out individual queries in a database client, this will prove to be very tedious for all but the simplest of configurations. In fact, I built these tools precisely because manually entering SQL queries, line-by-line, quickly became unworkable.
It’s important to realize that these queries are the engine of the migration. Consequently, understanding your Drupal database and composing the right SQL queries are key to a successful migration. Because the interface wrappers are useless without the queries, I've included a sample set in both packages. For information about customising the export script to suit your Drupal setup, see my step-by-step explanation of the Drupal to WordPress migration SQL queries.
In general, you will need queries to migrate following:
- Vocabularies and taxonomies
- Drupal nodes to WordPress posts
- Users
- Comments and comment authors
You may additionally need to include queries to clear out unwanted content, merge terms, or export custom fields.
Sample Drupal to WordPress migration checklists
I use these checklists for my own Drupal to WordPress migration projects. Feel free to use them as templates for your own site migration.
Please note I update them from time-to-time to include new items that regularly come up.
Drupal to WordPress Migration requirements
These migration requirements will help you estimate a budget for your project.
General migration requirements
- Do you expect any data cleaning to be necessary?
- Are you merging multiple domains or sub-domains into a single WordPress installation?
- Did you already start developing the WordPress site prior to content migration? If so, we may need to merge content and configuration from your development site.
- Is there an e-commerce component to the migration?
Converting content types
- List the Drupal content types to export as WordPress:
- pages
- posts
- custom content types
- Will custom content type development be needed?
- List the content types that will be merged (if any)
Migrating Drupal taxonomies
- Do you plan to re-organize your categories and tags?
- List of terms to export as WordPress categories
- What will be your WordPress default category?
Exporting comments and users
- Do you want to migrate
- Drupal comments?
- Drupal users?
- How do you want to handle the Drupal legacy file directory?
- Are there any content sources outside of the Drupal database? (For example, static HTML files or external databases.)
Preserving SEO
- What are your SEO requirements? (We may need to complete the separate SEO To Do list.)
- What will be your WordPress permalink structure?
- How do you plan to handle URL redirects?
Design and theme template
- Will you be redesigning your site or do you plan to convert your existing Drupal theme to WordPress?
- If you plan to redesign your site, will you be using a ready-made theme or custom theme?
- Who will be responsible for developing and configuring your WordPress theme?
WordPress setup and configuration
- Do you have a developer who will install and configure WordPress on your server?
- Will your developer import the migrated database to your live server during go-live?
- If any problems occur with your hosting provider during the migration, who is responsible for troubleshooting?
Drupal content audit
Understanding as much as possible about your Drupal installation will help you come up with a more precise estimate for your migration project. The content audit may take some time to complete but the process will give you a better idea of how much work will be needed to migrate your site.
Your Drupal content
- What is the approximate number of Drupal nodes to migrate into WordPress. The number of Drupal nodes does not usually play a big factor in the complexity of the migration. However, it will still be useful to get an idea of the number since many nodes can have an impact on how long it takes to troubleshoot migration problems.
- Please list the following within Drupal that needs to be migrated into WordPress:
- Content types. Additional migration MySQL queries will be needed for each Drupal custom content type. WordPress supports page and post content types as standard. Additional development work will be needed to support other content types.
- Custom fields. As with custom content types, custom fields in your Drupal installation will need additional work to support them under WordPress. We will need to specify how the field content is stored in WordPress, for example, by setting post meta key strings or custom tables.
- Modules and site functionality. Can the functionality can be handled with existing WordPress plugins? Will you need to develop custom plugins?
- Do you have blocks, views and panes with important content? Many Drupal sites display content in this way. Your SEO may be affected if you receive lots of traffic to pages with blocks, views and panes.
- List and describe your user roles.
- How will you convert Drupal user roles into WordPress roles?
Drupal taxonomies
- Are any Drupal taxonomies particularly important? Some sites have taxonomy listings that attract valuable traffic so this may be important for SEO. Note that unlike Drupal which allows for multiple vocabularies, WordPress only offers one set of categories and tags out of the box. Replicating your Drupal taxonomy listings in WordPress may need additional development.
- What do you want to do with duplicate terms. Duplicate Drupal terms can cause problems during a migration.
- Describe what to do with problem terms. For example, WordPress has a 200 character limit for terms. Any Drupal terms longer than 200 characters will need to be truncated. This may impact SEO if you receive lots of traffic from term indexes.
- How many users do you have? The number of users doesn't play a big factor during a migration but it may be useful to know. On some sites, users have associated pages that may be important for SEO.
SEO configuration within Drupal
- Have you installed Drupal modules that generate metatag information contributing to your SEO?
- Does your Drupal site have a site map?
- Do you have on-page optimization coded within the Drupal theme templates that we need to preserve? This will be important for SEO. Usually, on-page optimization embedded into the content body will be preserved during a migration.
- Please briefly describe what to do with multiple aliases. Drupal supports multiple URL aliases for nodes. These will need to be resolved when migrating to WordPress. How we approach this will have an impact on your SEO.
- Are there URL structures in Drupal that you need to preserve for SEO?
SEO for Drupal to WordPress migrations
These are tasks for projects where SEO is a major consideration. If SEO is critical to your site, you should hire your own dedicated SEO consultant.
General SEO tasks
- Perform a pre-migration SEO audit
- How will changes to the following affect SEO?
- menu navigation
- breadcrumb navigation
- site hierarchy
- Crawl Drupal site to build database of URLs
- Crawl WordPress site and compare counts with results from Drupal
- Build database of authoritative content URLs and ensure these remain accessible after migration (e.g. via redirect if necessary)
- Ensure changes to WordPress theme template will not adversely affect authoritative content
- Identify how dynamically generated and statically set URLs will change (for example Drupal node IDs vs WordPress post IDs; Drupal URL aliases vs WordPress permalinks/post names)
- Build list of changed URLs for redirection
- Review title and meta description tags
- Migrate title and meta description tags to SEO plugin e.g. Yoast
- Identify top keywords and how they will be implemented in WordPress (e.g. do we manually set Yoast focus keyword for posts?)
- Add Open Graph social meta data (for example via Yoast plugin)
- Ensure theme is responsive for ‘mobile-friendliness'
- Review WordPress robots.txt file
- Check legacy Drupal site links to ensure WordPress redirects work correctly
- Assess how page speed will affect SEO (anecdotal evidence says that page speed improves after a move to WordPress but verification is necessary)
- Ensure live WordPress site is not set to noindex
- Ensure correct timezone is set in WordPress
- Perform a post-migration SEO audit
SEO plugins for WordPress
- Consider installing the following:
- Redirection plugin (or implement via htaccess)
- XML sitemap WordPress plugin
- schema markup (rich snippet) WordPress plugin
Acknowledgements
- Scott Anderson of Room 34 Creative Services. The original 2012 queries for migrating from Drupal to WordPress are based on a post at the Room 34 blog: How I migrated a client's blog from Drupal to WordPress 3.0
- David Coveney of Interconnect IT Ltd (UK). I used UI elements of Interconnect IT's WordPress Search and Replace Tool as a starting point to create the in-house scripts on which this tool is based. WordPress (and others) Search and Replace Tool
- Graphics courtesy of and copyright Free Range Stock, artists: mohamedhassan (checklist), Jack Moreh (all other graphics)