How to test Drupal 6 to Drupal 8 migrations

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
You are viewing a wiki page. You are welcome to join the group and then edit it. Be bold!

Interested in helping out with the Migrate in Core initiative? This page is a great place to start, as to ensure that you've got everything you need in-place on your local machine.

Prerequisites

  • Comfort with the command-line - The user interface at this time is drush, so some command-line comfort is required.
  • PHP 5.4 - required for Drupal 8.
  • Git - https://drupal.org/documentation/git/install
  • Drush 7 - https://github.com/drush-ops/drush#install---composer - for manual testing of individual D6->D8 migrations, install the latest version of Drush. It is strongly recommended to install Drush 7.x via Composer.
  • A Drupal 6 site - Migrate only reads from this database. Even so, it is not recommended to run migrations against a production database! For initial testing, use a fresh Drupal 6 site with only the CCK and Link modules enabled and some sample content.
  • A Drupal 8 site - It must be the latest version, https://drupal.org/project/drupal/git-instructions
    1. Enable the migrate_drupal module, this enables the migrate module as well.
      drush en -y migrate_drupal
    2. Make sure drush can write to the config directory.
      sudo chmod -R a+w sites/default/files/config_*/active
  • Test your environment - Run a block migration. If everything works, then you're ready to hit the issue queue!

Two (Main) Ways of Testing

  1. module-by-module - this allows for more targeted troubleshooting and reduces the amount of data that needs to be compared. See the meta-issue at https://drupal.org/node/2221733
  2. whole migration - Ideally, after testing each module migration, you'll run a complete migration. This should allow focus on performance.

    See the complete migration meta-issue here: https://drupal.org/node/2221779

    Need help figuring out what to work on? Ask in #drupal-migrate on IRC!

What to expect

Some issues that you may run into include the following items which may not be migrated properly:

Starting fresh

Run each test on a fresh, clean Drupal 8 install.

This is when drush si is your friend! It will drop and recreate the database, delete old files that cause issues, and save you from having to enter installation data!

From the document root of your site, run:
drush si --account-pass=admin

Use the --db-url parameter if necessary:
drush si --account-pass=admin --db-url=mysql://username:password@localhost:port/dbname

Then enable the migrate_drupal module:
drush en -y migrate_drupal

Now, you can log in as admin/admin rather than needing to pay attention to the random password that drush si would create without the --account-pass= option.

Note: Migration rollbacks have not yet been implemented (bummer, we know).

Problems?

Permissions

It may be easier to run drush as the web-user
On Fedora: sudo -su apache
On Debian: sudo -su www-data

Files not copied

Drush does not have a parameter for the files location so it often fails. Try using the migrate_upgrade module.

Note:
The following do not have migration paths yet:

  • Forums
  • Menu links
  • Anything removed from core (OpenID associations, banned IPs come to mind)

Comments

sample manifest

mvc's picture

save the following lines in test-manifest.yml

- d6_comment_field
- d6_comment_field_instance
- d6_field
- d6_field_formatter_settings
- d6_field_instance
- d6_field_instance_widget_settings
- d6_field_settings
- d6_node_body_instance
- d6_node_settings
- d6_node_type
- d6_node_type_entity_display
- d6_node_type_entity_display_teaser
- d6_node_type_entity_form_display
- d6_text_settings
- d6_node:*

note: this will migrate nodes and field definitions. however, all the fields will be empty except for the title. i'm not sure if i'm missing a migration or if that's just not implemented yet.

Disregard this sample manifest

eliza411's picture

The sample manifest was totally relevant back in January, but now it is appropriate to download the .yml file from the relevant testing issue.

IMP

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week