Migrating into Drupal 8

These are the presentation notes from a "Migrating into Drupal 8" presentation I did at DrupalCamp Toronto 2014.

This discussion is focused on introducing the new concepts behind the new migration system that replaces the historic upgrade-in-place system we have used in previous versions.

Since many of these items are works in progress they are subject to change!

If you are working with D8 migrate now, keep in mind you will probably have to re-migrate at some point until the migration path is finalized. This may not happen until 8.1.x or even 8.2.x. It depends greatly on testing.

It is critical that as many people test the migration path as possible. Especially with sites that have been upgraded previously as those are likely to have the most problematic edge cases.

Currently the migration path in Drupal core is D6→D8, with D7→D8 in progress. The UI needs a patch and/or the "imp sandbox" version of D8. The UI will probably be in place around the time of DrupalCon Austin in June 2014.

Links to the initiative and places you can contribute are listed in the presentation.

PDF icon Slides in PDF format898.47 KB
File Source LibreOffice presentation1013.11 KB

Migrating multilingual data into Drupal 8

First thing, have a D6 site with multilingual things ready to go! This node has a file attached (see end of post) with a copy of D6 with some translated nodes and site information (see settings.php file settings to translate these variables). The file is a drush archive.

D6 "Requirements" at this time:

  • It must have CCK installed (2014-04-11)
  • Recommended to install in the non-English language if you wish to download the translations automatically (this isn't working in the UI yet 2014-04-11). You can also go download the translations manually later.

Setting up D8

Currently we do not work from the main branch as there are significant changes happening in this area of Drupal 8. Some things may be broken. You have been warned! Please test and update issue summaries where appropriate.

  • Clone the IMP migration sandbox and install Drupal 8 https://drupal.org/sandbox/chx/2105305
  • Enable migrate, migrate_drupal, content_translation, configuration_translation, locale/"Interface Translation", language (these last two are installed by default if you did not install in English)
  • Enable English as a language
  • Get the patch so you can bind to a second database in D8 https://drupal.org/node/2181775
  • Create a manifest.yml file in the root

Migration Mappings

Put this file int he root of your D8 site. If you did migrations to D7 with the latest versions of migrate and d2d, this file similar to your migrate.inc file registration array (but in a completely new format).


# nodes
- d6_user_role
#- d6_user (not working yet - "does not meet requirements" 2014-04-11)
- d6_language_types # Patch needed 2014-04-11 https://drupal.org/node/2225293
- d6_language_negotiation # needs above patch
- d6_language # Patches needed 2014-04-11 https://drupal.org/node/2166875 and https://drupal.org/node/2234623

- d6_filter_format

- d6_node_type
- d6_node_settings # gets story content type
- d6_node:*
- d6_node_body_field

- d6_view_modes

You can find the complete list of migrations at core/modules/migrate_drupal/migrate.config.yml and core/modules/migrate_drupal/migrate.content.yml some (like d6_user are not yet working 2014-04-11).

Running the Migration

Then, on the command line, run your manifest file. I used a D6 database with no password because of the bug mentioned above.

drush migrate-manifest mysql://d6@localhost/d6 manifest.yml

You will need the latest Drush if you want support D8! A UI-based workflow is being developed here: https://drupal.org/node/2200379

Rolling Back

This does not exist yet, but if you are familiar with doing this manually in D7 the process is the same:

Use the UI to delete the affected things (in this example, delete your nodes)
Clear the database table that stores the migration info for the specific migration: mysql> delete from migrate_map_d6_node;

Other howtos

Writing D6 to D8 entity migrations - https://groups.drupal.org/node/387488
How to test Drupal 6 to Drupal 8 migrations - https://groups.drupal.org/node/398588
eliza411 - http://dspeak.com/fldc14/dothis.html

More information on Migrate in Core / IMP

You can follow the initiative at groups.drupal.org/imp.

Getting content into Drupal with Migrate : Montréal (v.0.4)

This year I'm presenting on Migrate at Montréal DrupalCamp! It will be the best one so far! I refactored the presentation yet again.

Recently I have published a new module, migrate_webform, that is a good example of the items in the talk. I also refactored commerce_migrate_ubercart to work with migrate version 2.6, which is the one with the amazing new UI config.

My company, Kafei Interactive, is a sponsor this year. We also sponsored Toronto DrupalCamp. I welcome Git tip if you want to buy me a coffee.

File migrate_montreal.odp600.7 KB
PDF icon migrate_montreal.pdf584.13 KB