Migrating Content into Drupal 8

Note: The migration architecture has changed in Drupal 8.1. The information in this post is accurate for Drupal 8.0 but has not yet been updated for Drupal 8.1.

Drupal 8 includes a powerful built-in migration system for importing content into your site. It is designed to handle data from Drupal 6 or 7, and much more. It is built around a plugin-based architecture, which allows importing of data from any external data source if you write your own source plugin.


When Drupal 7 was released, it came with an upgrade script that would convert a Drupal 6 database into a Drupal 7 database. For Drupal 8, the core team decided against this approach, in favor of creating a more flexible migration module.

Also, Drupal 7 has the Migrate and Migrate D2D contrib modules, used for importing data into a Drupal 7 database. This effort has been moved into Core in Drupal 8.

The team developing the Migrate modules maintains a group on Drupal.org. For more information about the status of these modules, visit the IMP project on Drupal.org.

Migrations in Core

Drupal 8 includes two core modules:

Migrate - A base module for creating your own custom migrations. This module provides the core migration architecture, but does not define any usable migrations itself.

Migrate Drupal, a module containing migration definitions and source plugins for migrating content from Drupal 6 to Drupal 8. This will eventually support Drupal 7 as well.

Other components

The Migrate and Migrate Drupal modules do not currently provide a UI for running migrations. You will need an external component to run migrations.

Drush You can create a migration manifest (a YAML file) and execute it using the "drush migrate-manifest" command. Drush 8.x or newer is required.

Note: The previous Drush command, "drush migrate-import", used with the Drupal 7 Migrate module, has been removed from Drupal 8.

Also note: As of Drupal 8 beta 2, the "drush migrate-manifest" command does not work with managed files, because it does not yet have a parameter for specifying the source directory where the files should be copied from.

Migrate Upgrade - A contrib module which provides a user interface for migrations. As of this writing, the module is still under development.

Migrating from Drupal 6

The Migrate Drupal module is being built to help with migrating from Drupal 6/7 to Drupal 8. Its aim is to import many components of Drupal like content types, fields, users, nodes, and more.

Migrate Drupal comes out-of-the-box with many of these migrations already built. It can even query CCK to determine the list of available fields to use when importing field data. To run these built-in migrations, you simply need to define a migration manifest. The following example would import Drupal 6 users and taxonomies:

- d6_user
- d6_taxonomy_vocabulary
- d6_taxonomy_term

To run the migration, open a command prompt and run the following command:

drush migrate-manifest manifest.yml --legacy-db-url=mysql://{dbuser}:{dbpass}@localhost/{dbname}

Replace {dbuser}, {dbpass}, and {dbname} with the MySQL username, password, and database name for your Drupal 6 database.

Migrating from Drupal 7

The Migrate Drupal module in Drupal 8 beta 3 does not yet include support for migrating from Drupal 7. Developers migrating from Drupal 7 to 8 will need to write their own custom migration scripts or pursue other options.

At the 2014 Pacific Northwest Drupal Summit, several presenters and participants mentioned that the Drupal 7-8 migration path is not expected to be completed by the release of Drupal 8.0.0. It is expected that this will be completed in a future core release.

For an example of writing a custom migration from Drupal 7 to Drupal 8, see the next installment in this series, Migrating Users from Drupal 7.

Filed under 

every body is talking about the Database(Content ) migration from drupal 6/7 to 8. what about the code migration/upgrade/update/? I have drupal 7.34 project with 100 contrib modules and custom templates(No TWIG),how can i make this code working with drupal 8 core system(which is symfony)

If you're looking for a way to upgrade your custom modules, you can try the Drupal Module Upgrader contrib module, which is designed to help convert Drupal 7 modules to Drupal 8.

I'll caution you that moving a Drupal 7 site to Drupal 8 is going to be a major undertaking. Tools like Migrate and Drupal Module Updater can help, but there's nothing that's going to make it be 100% painless.

Add new comment

Restricted HTML

  • Web page addresses and email addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <h4> <h5> <h6>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>&lt;code&gt;</code>, <code>&lt;blockcode&gt;</code>, <code>&lt;apache&gt;</code>, <code>&lt;bash&gt;</code>, <code>&lt;c&gt;</code>, <code>&lt;cpp&gt;</code>, <code>&lt;css&gt;</code>, <code>&lt;drupal5&gt;</code>, <code>&lt;drupal6&gt;</code>, <code>&lt;html&gt;</code>, <code>&lt;java&gt;</code>, <code>&lt;javascript&gt;</code>, <code>&lt;mysql&gt;</code>, <code>&lt;objc&gt;</code>, <code>&lt;php&gt;</code>, <code>&lt;python&gt;</code>, <code>&lt;ruby&gt;</code>, <code>&lt;sql&gt;</code>, <code>&lt;swift&gt;</code>, <code>&lt;xml&gt;</code>. The supported tag styles are: <code>&lt;foo&gt;</code>, <code>[foo]</code>.

About the Author

Keith Dechant, Software Architect

Keith has been working on the web almost since it was new, writing his first HTML in 1996 and his first PHP code in 1999. Along the way, he has written everything from e-commerce websites to mailing list software to large web applications for industrial and non-profit organizations. Recently, he has done a lot of work with ASP.NET, Django, Drupal 7 and 8, and AngularJS.

Keith is a native of Illinois who moved to Portland in 2009. He has been to 49 US states, five continents, three former Soviet republics, and two countries that no longer exist. He likes hiking, mountain climbing, classic video games, and the Oxford comma.