Drupal 8 Migration Useful Drush Commands

  1. drush migrate-upgrade
    1. 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: 
      1. drush migrate-upgrade --legacy-db-key=migrate
    2. 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.
      1. drush migrate-upgrade --legacy-db-key=migrate --configure-only

  2. drush mi or drush migrate-import
    1. This is what runs the migration based of your config you outlined above.  Since you named the DB migrate, no more config is needed. 
    2. You can run this on an id, group or use the all (I don't recommend using the all).
      1. drush mi upgrade_d7_file
      2. drush mi --group=files
      3. drush mi --import-all
    3. --group=x , as shown above, this is a migration_group set in the yml of the migration config.  
      1. drush mi --group=files
    4. --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:
      1. drush mi --group=files --limit=2500
      2. drush mi  upgrade_d7_file --limit=2500
    5. --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.
      1. drush mi --group=files --feedback="10 seconds",
      2. drush mi  upgrade_d7_file --feedback="10 seconds",

  3. drush ms or drush migrate-status
    1. This gives the status of your migration.

  4. drush mrs or drush migrate-reset-status
    1. If you abort a migration with ctrl+c or it fails, use this to reset the status back to idle

  5. drush mr or drush migrate-rollback
    1. 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.
      1. drush mr  upgrade_d7_file
      2. drush mr --group=files

  6. drush mmsg or drush migrate-messages
    1. 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.
      1. drush mmsg  upgrade_d7_file