You are here

function drush_migrate_upgrade in Migrate Upgrade 8.2

Same name and namespace in other branches
  1. 8.3 migrate_upgrade.drush.inc \drush_migrate_upgrade()
  2. 8 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 46
Command-line tools to aid performing and developing upgrade migrations.

Code

function drush_migrate_upgrade() {
  $runner = new MigrateUpgradeDrushRunner();
  try {
    $runner
      ->configure();
    if (drush_get_option('configure-only')) {
      $runner
        ->export();
    }
    else {
      $runner
        ->import();
      \Drupal::state()
        ->set('migrate_drupal_ui.performed', REQUEST_TIME);
    }

    // Remove the global database state.
    \Drupal::state()
      ->delete('migrate.fallback_state_key');
  } catch (\Exception $e) {
    drush_log($e
      ->getMessage(), 'error');
  }
}