You are here

public function MigrateUpgradeCommands::upgrade in Migrate Upgrade 8.3

Perform one or more upgrade processes.

@command migrate:upgrade

@usage drush migrate-upgrade --legacy-db-url='mysql://root:pass@127.0.0.1/d6' Upgrade a Drupal 6 database to Drupal 8 @usage drush migrate-upgrade --legacy-db-key='drupal_7' Upgrade Drupal 7 database where the connection to Drupal 7 has already been created in settings.php ($databases['drupal_7']) @usage drush migrate-upgrade --legacy-db-url='mysql://root:pass@127.0.0.1/d7' --configure-only --migration-prefix=d7_custom_ --legacy-root=https://www.example.com Generate migrations for a custom migration from Drupal 7 to Drupal 8

@validate-module-enabled migrate_upgrade

@field-labels original: Original migrations generated: Generated migrations

@aliases migrate-upgrade, mup

@default-fields generated

Return value

\Consolidation\OutputFormatters\StructuredData\RowsOfFields The formatted results of the command.

Throws

\Exception When an error occurs.

File

src/Commands/MigrateUpgradeCommands.php, line 79

Class

MigrateUpgradeCommands
Migrate Upgrade drush commands.

Namespace

Drupal\migrate_upgrade\Commands

Code

public function upgrade(array $options = []) {
  $runner = new MigrateUpgradeDrushRunner($this->logger, $options);
  $runner
    ->configure();
  if ($options['configure-only']) {
    $result = new RowsOfFields($runner
      ->export());
  }
  else {
    $result = new RowsOfFields($runner
      ->import());
    $this->state
      ->set('migrate_drupal_ui.performed', \Drupal::time()
      ->getRequestTime());
  }

  // Remove the global database state.
  $this->state
    ->delete('migrate.fallback_state_key');
  return $result;
}