« Previous 1 2 3 4
Moving data to Drupal 8
Moving Up
Running Migrations
Now all the migrations are configured and ready to go. At this point, the only way to run a custom migration is with the drush
command from Migrate Tools, which provides commands to run an individual migration or an entire migration group. You will need command-line access with drush
to run the migrations.
The migrate-status
(alias ms
) command lists all available migrations, and the migrate-import
(alias mi
) command imports a single migration or an entire group. You can use the --group
option to show only migrations in a specific group (Listing 10).
Listing 10
Status and Import Commands
$ drush ms --group=pets Group: pets Status Total Imported Unprocessed Last imported pet_owners Idle 50 0 N/A pets Idle 1455 0 N/A $ drush mi pets Processed 1455 items (1455 created, 0 updated, 0 failed, 0 ignored) - done with 'pets'
You might want to test the migration by only importing a few nodes at first. The --limit
flag can be used to import a specific number of items. For example, drush mi --limit=2
will import the first two items. Each time migrate_import
runs, it will start where it left off from the previous import until all rows are imported.
The migrate-rollback
(alias: mr
) command can be used to remove all imported items. The --group
option is also available to roll back all migration in a group:
$ drush mr pets Rolled back 1455 items - done with 'pets'
A few other less common commands are:
migrate-stop
– Cancel a running migration.migrate-reset-status
– Reset a migration to Idle if it was cancelled and left hanging in the "importing" state.migrate-messages
– View a list of messages associated with the migration.
Use drush help <command>
to see all the available options.
How to Help
The Migrate API needs your help! Remember, it is still considered an experimental module, and contributors are needed to submit and patch issues. Mentoring is available during core office hours [6] to help you get started testing and writing patches. You can also follow @drupalmentoring on Twitter.
Infos
- Drupal 7 Migrate module: https://www.drupal.org/project/migrate
- Migrate Plus module: https://www.drupal.org/project/migrate_plus
- Migrate Tools module: https://www.drupal.org/project/migrate_tools
- Migrate Tools UI issues: https://www.drupal.org/project/issues/migrate_tools?component=User+interface
- More process plugins: https://www.drupal.org/node/2129651
- Core office hours: https://www.drupal.org/core-office-hours
« Previous 1 2 3 4
Buy this article as PDF
(incl. VAT)