You are here

function drush_migrate_upgrade in Migrate Upgrade 8

Same name and namespace in other branches
  1. 8.3 migrate_upgrade.drush.inc \drush_migrate_upgrade()
  2. 8.2 migrate_upgrade.drush.inc \drush_migrate_upgrade()

Execute the upgrade command, configuring the necessary migrations and optionally perform the imports.

File

./migrate_upgrade.drush.inc, line 42
Command-line tools to aid performing and developing upgrade migrations.

Code

function drush_migrate_upgrade() {
  $configure_only = drush_get_option('configure-only');
  $runner = new MigrateUpgradeDrushRunner();
  try {
    $runner
      ->configure();
    if (!$configure_only) {
      $runner
        ->import();
      \Drupal::state()
        ->set('migrate_upgrade.performed', REQUEST_TIME);
    }
  } catch (\Exception $e) {
    drush_log($e
      ->getMessage(), 'error');
  }
}