Drupal 8 Migration Useful Drush Commands - DEPRECATED
DEPRECATED
The information below is either outdated, or no longer considered best practice at Kalamuna.
This has a lot of good information and is a good candidate for being updated, but as it stands a lot of the information is out of date.
Â
drush migrate-upgrade
This is what is used to connect to the DB that you are migrating from. Â It says in their docs to name the 2nd database array upgrade, but don;t do that. Â Name it migrate instead and use a db key to import the data, like this:Â
drush migrate-upgrade --legacy-db-key=migrate
Use the --configure-only flag to just grab the config (obviously), but this makes it so the migration is actually not initiated and you can control it VIA drush.
drush migrate-upgrade --legacy-db-key=migrate --configure-only
drush mi or drush migrate-import
This is what runs the migration based of your config you outlined above. Â Since you named the DB migrate, no more config is needed.Â
You can run this on an id, group or use the all (I don't recommend using the all).
drush mi upgrade_d7_file
drush mi --group=files
drush mi --import-all
--group=x , as shown above, this is a migration_group set in the yml of the migration config. Â
drush mi --group=files
--limit=x , this sets a limit on the number or entities you are importing. Â Usually used in correlation with a group or specific migration id, an example:
drush mi --group=files --limit=2500
drush mi  upgrade_d7_file --limit=2500
--feedback="x seconds", if you are having time outs, this is a useful command as it sends a response after the respective time has been reached to prevent timeouts. Can't be used with --limit and vice versa.
drush mi --group=files --feedback="10 seconds",
drush mi  upgrade_d7_file --feedback="10 seconds",
drush ms or drush migrate-status
This gives the status of your migration.
drush mrs or drush migrate-reset-status
If you abort a migration with ctrl+c or it fails, use this to reset the status back to idle
drush mr or drush migrate-rollback
This is used to rollback a migration. Â Useful for testing or if you had issues and need to start over. Â Use this with the id or group of the migration task.
drush mr  upgrade_d7_file
drush mr --group=files
drush mmsg or drush migrate-messages
This is useful to use when you have a fails in your migration process. Â This will show you why they failed and what caused them.
drush mmsg  upgrade_d7_file
Review History
Who | When | Status |
---|---|---|
 |  |  |
Bob | 20230530 | Deprecated |