This project is not covered by Drupal’s security advisory policy.

Migrates a WordPress site to Drupal by reading the WordPress database directly. No XML export, no plugin to install on the WordPress side. Run it from an admin page or with Drush.

What it migrates

  • Content: posts, pages and custom post types, with categories, tags, featured images and the WordPress URL as the path alias.
  • Gutenberg and classic content: block editor markup is converted to clean HTML; reusable blocks are expanded and embeds become links.
  • Media: images, documents, video and audio, each to its own media type. Files are copied from a local copy of wp-content/uploads (fast) or downloaded. Optionally only the media your content actually uses.
  • Users: with their WordPress passwords (including WordPress 6.8+ hashes) and roles.
  • Menus with their hierarchy, comments (threaded), taxonomy.
  • SEO: Redirection plugin redirects and Yoast SEO titles and descriptions (to Metatag).
  • Page builders and plugins: WPBakery content to Paragraphs (submodule), WP Store Locator stores.

Running migrations

  • Admin UI at Configuration > Content authoring > WordPress Migration: connect, test the connection, then import or roll back selected migrations as a batch, in dependency order.
  • Drush: all migrations are in the wordpress group: drush migrate:import --group=wordpress --execute-dependencies.
  • Incremental runs: during a content freeze, only import what changed in WordPress since the last run.
  • Large sites are fine: rollbacks run in batches, and totals are cached.

Built to be adapted

The module ships source and process plugins plus starter migrations. Real sites usually copy the starter migrations into their own module and change the field mapping. Starter migrations that need a module or media type your site doesn't have are skipped, with the reason shown. See the README for every plugin and option.

Requirements

Optional modules

Getting started

  1. composer require drupal/wp_drupal_migrate and enable the module.
  2. Declare the WordPress database in settings.php as $databases['wordpress'] (recommended), or enter it at /admin/config/content/wp-migrate.
  3. Set the uploads path or URL for media.
  4. Run the migrations at /admin/config/content/wp-migrate/execute, or with Drush.

Similar projects

WordPress Migrate imports a WordPress XML (WXR) export. Use it when you can't reach the WordPress database. This module reads the database itself, so it also gets data the export leaves out (plugin tables, post meta, password hashes) and handles large sites well.

Project information

Releases