diff --git a/core/modules/migrate_drupal/config/install/migrate.migration.d6_file.yml b/core/modules/migrate_drupal/config/install/migrate.migration.d6_file.yml
index cc39a89..f707851 100644
--- a/core/modules/migrate_drupal/config/install/migrate.migration.d6_file.yml
+++ b/core/modules/migrate_drupal/config/install/migrate.migration.d6_file.yml
@@ -17,3 +17,4 @@ process:
changed: timestamp
destination:
plugin: entity:file
+ urlencode: 1
diff --git a/core/modules/migrate_drupal/config/install/migrate.migration.d6_url_alias.yml b/core/modules/migrate_drupal/config/install/migrate.migration.d6_url_alias.yml
index 8286827..3d2cf62 100644
--- a/core/modules/migrate_drupal/config/install/migrate.migration.d6_url_alias.yml
+++ b/core/modules/migrate_drupal/config/install/migrate.migration.d6_url_alias.yml
@@ -6,7 +6,13 @@ source:
process:
source: src
alias: dst
- langcode: language
+ langcode:
+ -
+ plugin: get
+ source: language
+ -
+ plugin: default_value
+ default_value: und
destination:
plugin: url_alias
diff --git a/core/modules/migrate_drupal/config/install/views.view.upgrade_log.yml b/core/modules/migrate_drupal/config/install/views.view.upgrade_log.yml
new file mode 100644
index 0000000..4d65998
--- /dev/null
+++ b/core/modules/migrate_drupal/config/install/views.view.upgrade_log.yml
@@ -0,0 +1,247 @@
+base_field: wid
+base_table: watchdog
+core: 8.x
+description: ''
+status: true
+display:
+ default:
+ display_plugin: default
+ id: default
+ display_title: Master
+ position: 0
+ provider: views
+ display_options:
+ access:
+ type: none
+ options: { }
+ provider: views
+ cache:
+ type: none
+ options: { }
+ provider: views
+ query:
+ type: views_query
+ options:
+ disable_sql_rewrite: false
+ distinct: false
+ slave: false
+ query_comment: false
+ query_tags: { }
+ provider: views
+ exposed_form:
+ type: basic
+ options:
+ submit_button: Apply
+ reset_button: false
+ reset_button_label: Reset
+ exposed_sorts_label: 'Sort by'
+ expose_sort_order: true
+ sort_asc_label: Asc
+ sort_desc_label: Desc
+ provider: views
+ pager:
+ type: full
+ options:
+ items_per_page: 50
+ offset: 0
+ id: 0
+ total_pages: null
+ expose:
+ items_per_page: false
+ items_per_page_label: 'Items per page'
+ items_per_page_options: '5, 10, 20, 40, 60'
+ items_per_page_options_all: false
+ items_per_page_options_all_label: '- All -'
+ offset: false
+ offset_label: Offset
+ tags:
+ previous: '‹ previous'
+ next: 'next ›'
+ first: '« first'
+ last: 'last »'
+ quantity: 9
+ style:
+ type: table
+ row:
+ type: fields
+ fields:
+ message:
+ id: message
+ table: watchdog
+ field: message
+ relationship: none
+ group_type: group
+ admin_label: ''
+ label: Message
+ exclude: false
+ alter:
+ alter_text: false
+ text: ''
+ make_link: false
+ path: ''
+ absolute: false
+ external: false
+ replace_spaces: false
+ path_case: none
+ trim_whitespace: false
+ alt: ''
+ rel: ''
+ link_class: ''
+ prefix: ''
+ suffix: ''
+ target: ''
+ nl2br: false
+ max_length: ''
+ word_boundary: true
+ ellipsis: true
+ more_link: false
+ more_link_text: ''
+ more_link_path: ''
+ strip_tags: false
+ trim: false
+ preserve_tags: ''
+ html: false
+ element_type: ''
+ element_class: ''
+ element_label_type: ''
+ element_label_class: ''
+ element_label_colon: true
+ element_wrapper_type: ''
+ element_wrapper_class: ''
+ element_default_classes: true
+ empty: ''
+ hide_empty: false
+ empty_zero: false
+ hide_alter_empty: true
+ replace_variables: true
+ plugin_id: dblog_message
+ provider: dblog
+ timestamp:
+ id: timestamp
+ table: watchdog
+ field: timestamp
+ relationship: none
+ group_type: group
+ admin_label: ''
+ label: Timestamp
+ exclude: false
+ alter:
+ alter_text: false
+ text: ''
+ make_link: false
+ path: ''
+ absolute: false
+ external: false
+ replace_spaces: false
+ path_case: none
+ trim_whitespace: false
+ alt: ''
+ rel: ''
+ link_class: ''
+ prefix: ''
+ suffix: ''
+ target: ''
+ nl2br: false
+ max_length: ''
+ word_boundary: true
+ ellipsis: true
+ more_link: false
+ more_link_text: ''
+ more_link_path: ''
+ strip_tags: false
+ trim: false
+ preserve_tags: ''
+ html: false
+ element_type: ''
+ element_class: ''
+ element_label_type: ''
+ element_label_class: ''
+ element_label_colon: true
+ element_wrapper_type: ''
+ element_wrapper_class: ''
+ element_default_classes: true
+ empty: ''
+ hide_empty: false
+ empty_zero: false
+ hide_alter_empty: true
+ date_format: short
+ custom_date_format: ''
+ timezone: ''
+ plugin_id: date
+ provider: views
+ filters:
+ type:
+ id: type
+ table: watchdog
+ field: type
+ relationship: none
+ group_type: group
+ admin_label: ''
+ operator: in
+ value:
+ migrate_drupal: migrate_drupal
+ group: 1
+ exposed: false
+ expose:
+ operator_id: ''
+ label: ''
+ description: ''
+ use_operator: false
+ operator: ''
+ identifier: ''
+ required: false
+ remember: false
+ multiple: false
+ remember_roles:
+ authenticated: authenticated
+ reduce: false
+ is_grouped: false
+ group_info:
+ label: ''
+ description: ''
+ identifier: ''
+ optional: true
+ widget: select
+ multiple: false
+ remember: false
+ default_group: All
+ default_group_multiple: { }
+ group_items: { }
+ plugin_id: in_operator
+ provider: views
+ sorts:
+ timestamp:
+ id: timestamp
+ table: watchdog
+ field: timestamp
+ order: DESC
+ relationship: none
+ group_type: group
+ admin_label: ''
+ exposed: false
+ expose:
+ label: ''
+ granularity: second
+ title: 'Upgrade log'
+ header: { }
+ footer: { }
+ empty: { }
+ relationships: { }
+ arguments: { }
+ page_1:
+ display_plugin: page
+ id: page_1
+ display_title: Page
+ position: 1
+ provider: views
+ display_options:
+ path: upgrade-log
+label: 'Upgrade log'
+module: views
+id: upgrade_log
+tag: ''
+uuid: 949ea7a5-ffda-410e-8205-5f4f6463ee2f
+langcode: en
+dependencies:
+ module:
+ - dblog
diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Form/MigrateDrupalRunForm.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Form/MigrateDrupalRunForm.php
deleted file mode 100644
index 3218a42..0000000
--- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Form/MigrateDrupalRunForm.php
+++ /dev/null
@@ -1,142 +0,0 @@
-storage()->loadMultiple();
- $form['migrations'] = array(
- '#type' => 'checkboxes',
- '#options' => MapArray::copyValuesToKeys(array_keys($migrations)),
- );
- }
- else {
- $form['db_url'] = array(
- '#type' => 'textfield',
- '#title' => $this->t('Database URL from D6'),
- '#size' => 40,
- );
- }
- $form['submit'] = array(
- '#type' => 'submit',
- '#value' => $this->t('Submit'),
- );
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, array &$form_state) {
- if (isset($form_state['values']['db_url'])) {
- $form_state['rebuild'] = TRUE;
- $form_state['database'] = $this->convertDbUrl($form_state['values']['db_url']);
- }
- else {
- $migration_ids = array_keys(array_filter($form_state['values']['migrations']));
- $batch = array(
- 'title' => t('Running migrations'),
- 'operations' => array(
- array(array('Drupal\migrate_drupal\MigrateDrupalRunBatch', 'run'), array($migration_ids, $form_state['database'])),
- ),
- 'finished' => array('Drupal\migrate_drupal\MigrateDrupalRunBatch', 'finished'),
- 'progress_message' => '',
- 'init_message' => t('Processing migration @num of @max.', array('@num' => '1', '@max' => count($migration_ids))),
- );
- $this->batchSet($batch);
- }
- }
-
- /**
- * Converts a D6 database URL to a new style DB configuration array.
- *
- * @param $db_url
- * The D6 database url.
- * @return array
- * The new style database array.
- */
- protected function convertDbUrl($db_url) {
- $url = parse_url($db_url);
- // Fill in defaults to prevent notices.
- $url += array(
- 'driver' => NULL,
- 'user' => NULL,
- 'pass' => NULL,
- 'host' => NULL,
- 'port' => NULL,
- 'path' => NULL,
- 'database' => NULL,
- );
- $url = (object) array_map('urldecode', $url);
- return array(
- 'driver' => $url->scheme == 'mysqli' ? 'mysql' : $url->scheme,
- 'username' => $url->user,
- 'password' => $url->pass,
- 'port' => $url->port,
- 'host' => $url->host,
-
- 'database' => substr($url->path, 1),
- );
- }
-
- /**
- * Set a batch.
- *
- * @param $batch
- */
- protected function batchSet($batch) {
- batch_set($batch);
- }
-
- /**
- * @return EntityStorageInterface
- */
- protected function storage() {
- if (!isset($this->storage)) {
- $this->storage = \Drupal::entityManager()->getStorage('migration');
- }
- return $this->storage;
- }
-
- /**
- * Returns the properties to be serialized
- *
- * @return array
- */
- public function __sleep() {
- // This apparently contains a PDOStatement somewhere.
- unset($this->storage);
- return parent::__sleep();
- }
-}
diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Form/MigrateDrupalUpgradeForm.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Form/MigrateDrupalUpgradeForm.php
new file mode 100644
index 0000000..f010a74
--- /dev/null
+++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Form/MigrateDrupalUpgradeForm.php
@@ -0,0 +1,334 @@
+t('Upgrade step 1: Source site information');
+
+ $form['files'] = array(
+ '#type' => 'details',
+ '#title' => t('Files'),
+ '#open' => TRUE,
+ '#weight' => 2,
+ );
+
+ $form['files']['site_address'] = array(
+ '#type' => 'textfield',
+ '#title' => $this->t('Source site address'),
+ '#description' => $this->t('Enter the address of your current Drupal ' .
+ 'site (e.g. "http://www.example.com"). This address will be used to ' .
+ 'retrieve any public files from the site.'),
+ );
+
+ $form['files']['private_file_directory'] = array(
+ '#type' => 'textfield',
+ '#title' => $this->t('Private file directory'),
+ '#description' => $this->t('If you have private files on your current ' .
+ 'Drupal site which you want imported, please copy the complete private ' .
+ 'file directory to a place accessible by your new Drupal 8 web server. ' .
+ 'Enter the address of the directory (e.g., "/home/legacy_files/private" ' .
+ 'or "http://private.example.com/legacy_files/private") here.'),
+ );
+
+ $form['database'] = array(
+ '#type' => 'details',
+ '#title' => t('Database'),
+ '#open' => TRUE,
+ '#weight' => 1,
+ );
+
+ $form['database']['database_description'] = array(
+ '#markup' => $this->t('Enter the database credentials for the legacy Drupal ' .
+ 'site you are upgrading into this Drupal 8 instance:'),
+ );
+ // The following is stolen from install.core.inc. If the install process
+ // would use form classes (https://drupal.org/node/2112569), we could inherit.
+ global $databases;
+
+ $database = isset($databases['default']['default']) ? $databases['default']['default'] : array();
+
+ require_once DRUPAL_ROOT . '/core/includes/install.inc';
+ $drivers = drupal_get_database_types();
+ $drivers_keys = array_keys($drivers);
+
+ $form['database']['driver'] = array(
+ '#type' => 'radios',
+ '#title' => t('Database type'),
+ '#required' => TRUE,
+ '#default_value' => !empty($database['driver']) ? $database['driver'] : current($drivers_keys),
+ );
+ if (count($drivers) == 1) {
+ $form['database']['driver']['#disabled'] = TRUE;
+ }
+
+ // Add driver specific configuration options.
+ foreach ($drivers as $key => $driver) {
+ $form['database']['driver']['#options'][$key] = $driver->name();
+
+ $form['database']['settings'][$key] = $driver->getFormOptions($database);
+ $form['database']['settings'][$key]['#prefix'] = '
' .
+ $this->t('@driver_name settings', array('@driver_name' => $driver->name())) . '
';
+ $form['database']['settings'][$key]['#type'] = 'container';
+ $form['database']['settings'][$key]['#tree'] = TRUE;
+ $form['database']['settings'][$key]['advanced_options']['#parents'] = array($key);
+ $form['database']['settings'][$key]['#states'] = array(
+ 'visible' => array(
+ ':input[name=driver]' => array('value' => $key),
+ )
+ );
+ }
+
+ $form['actions'] = array('#type' => 'actions');
+ $form['actions']['save'] = array(
+ '#type' => 'submit',
+ '#value' => t('Next'),
+ '#button_type' => 'primary',
+ '#limit_validation_errors' => array(
+ array('driver'),
+ array(isset($form_state['input']['driver']) ? $form_state['input']['driver'] : current($drivers_keys)),
+ ),
+ );
+ return $form;
+ }
+
+ /**
+ * Prepare to import configuration.
+ */
+ public function configurationStep(array &$form_state) {
+ Database::addConnectionInfo('migrate', 'default', $form_state['database']);
+ $version = $form_state['drupal_version'];
+
+ $form['#title'] = $this->t('Upgrade step 2: Import configuration');
+
+ $form['description'] = array(
+ '#markup' => $this->t('We will now import configuration, including ' .
+ 'system settings and any vocabularies and content type and field ' .
+ 'definitions, from the Drupal @version version of your site into this ' .
+ 'new Drupal 8 site.', array('@version' => $version)),
+ '#suffix' => '
',
+ );
+
+ $form['submit'] = array(
+ '#type' => 'submit',
+ '#value' => $this->t('Import configuration'),
+ );
+
+ return $form;
+ }
+
+ /**
+ * Prepare to import configuration.
+ */
+ public function contentStep(array &$form_state) {
+ Database::addConnectionInfo('migrate', 'default', $form_state['database']);
+ $version = $form_state['drupal_version'];
+
+ $form['#title'] = $this->t('Upgrade step 3: Import content');
+
+ $form['description'] = array(
+ '#markup' => $this->t('We will now import content, including any nodes, ' .
+ 'comments, users, and taxonomy terms, from the Drupal @version ' .
+ 'version of your site into this new Drupal 8 site.',
+ array('@version' => $version)),
+ '#suffix' => '
',
+ );
+
+ $form['submit'] = array(
+ '#type' => 'submit',
+ '#value' => $this->t('Import content'),
+ );
+
+ return $form;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function buildForm(array $form, array &$form_state) {
+ // The multistep is for testing only. The final version will run a fixed
+ // set of migrations.
+ // @todo: Skip credential step if 'migrate' connection already defined.
+ if (!isset($form_state['database'])) {
+ $form = $this->credentialStep();
+ }
+ elseif (isset($form_state['step'])) {
+ $step = $form_state['step'];
+ switch ($step) {
+ case 'configuration':
+ // @todo: Skip configuration step if configuration import is complete.
+ $form = $this->configurationStep($form_state);
+ break;
+ case 'content':
+ $form = $this->contentStep($form_state);
+ break;
+ }
+ }
+
+ return $form;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function validateForm(array &$form, array &$form_state) {
+ if (isset($form_state['values']['driver'])) {
+ // Verify we have a valid connection to a Drupal database supported for
+ // upgrade.
+ $driver = $form_state['values']['driver'];
+ $form_state['database'] = $form_state['values'][$driver];
+ $form_state['database']['driver'] = $driver;
+ // @todo: There should be a DrupalSqlBase method to use to
+ // determine the version.
+ try {
+ Database::addConnectionInfo('migrate', 'default', $form_state['database']);
+ $connection = Database::getConnection('default', 'migrate');
+ }
+ catch (\Exception $e) {
+ $message = t('Unable to connect to the source database. %message',
+ array('%message' => $e->getMessage()));
+ $this->setFormError(NULL, $form_state, $message);
+ return;
+ }
+ if (!$connection->schema()->tableExists('node')) {
+ $this->setFormError(NULL, $form_state, t('Source database does not ' .
+ 'contain a Drupal installation.'));
+ }
+ // Note we check D8 first, because it's reintroduced the menu_router
+ // table we have used as the signature of D6.
+ elseif ($connection->schema()->tableExists('key_value')) {
+ $this->setFormError(NULL, $form_state, t('Upgrade from this version ' .
+ 'of Drupal is not supported.'));
+ }
+ elseif ($connection->schema()->tableExists('filter_format')) {
+ $form_state['drupal_version'] = 7;
+ }
+ elseif ($connection->schema()->tableExists('menu_router')) {
+ $form_state['drupal_version'] = 6;
+ }
+ else {
+ $this->setFormError(NULL, $form_state, t('Upgrade from this version ' .
+ 'of Drupal is not supported.'));
+ }
+
+ // Configure the file migration so it can find the files.
+ if (!empty($form_state['values']['site_address'])) {
+ $site_address = rtrim($form_state['values']['site_address'], '/') . '/';
+ $d6_file_config = \Drupal::config('migrate.migration.d6_file');
+ $d6_file_config->set('destination.source_base_path', $site_address);
+ $d6_file_config->save();
+ }
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function submitForm(array &$form, array &$form_state) {
+ if (isset($form_state['values']['driver'])) {
+ $form_state['rebuild'] = TRUE;
+ $form_state['step'] = 'configuration';
+ }
+ elseif (isset($form_state['step'])) {
+ $migration_ids = $this->getDestinationIds($form_state['step']);
+ $batch = array(
+ 'title' => t('Running migrations'),
+ 'operations' => array(
+ array(array('Drupal\migrate_drupal\MigrateDrupalRunBatch', 'run'),
+ array($migration_ids, $form_state['database'])),
+ ),
+ 'progress_message' => '',
+ );
+ if ($form_state['step'] == 'configuration') {
+ $form_state['rebuild'] = TRUE;
+ $form_state['step'] = 'content';
+ $batch['finished'] =
+ array('Drupal\migrate_drupal\MigrateDrupalRunBatch', 'configurationFinished');
+ }
+ else {
+ $form_state['redirect'] = '/';
+ $batch['finished'] =
+ array('Drupal\migrate_drupal\MigrateDrupalRunBatch', 'contentFinished');
+ }
+ $this->batchSet($batch);
+ }
+ }
+
+ /**
+ * Set a batch.
+ *
+ * @param $batch
+ */
+ protected function batchSet($batch) {
+ batch_set($batch);
+ }
+
+ /**
+ * @return EntityStorageInterface
+ */
+ protected function storage() {
+ if (!isset($this->storage)) {
+ $this->storage = \Drupal::entityManager()->getStorage('migration');
+ }
+ return $this->storage;
+ }
+
+ /**
+ * Returns the properties to be serialized
+ *
+ * @return array
+ */
+ public function __sleep() {
+ // This apparently contains a PDOStatement somewhere.
+ unset($this->storage);
+ return parent::__sleep();
+ }
+
+ /**
+ * Gets migrate_drupal configurations.
+ *
+ * @param string $step
+ * Migration configuration destination type form step.
+ *
+ * @return array
+ * An array of configuration and content migrations.
+ */
+ function getDestinationIds($step) {
+ $manifest = drupal_get_path('module', 'migrate_drupal') . '/migrate.';
+ if ($step == 'content') {
+ $manifest .= 'content';
+ }
+ else {
+ $manifest .= 'config';
+ }
+ $manifest .= '.yml';
+ $list = Yaml::parse($manifest);
+ $names = $list[$step];
+ return $names;
+ }
+}
diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/MigrateDrupalRunBatch.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/MigrateDrupalRunBatch.php
index 7578161..18fb068 100644
--- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/MigrateDrupalRunBatch.php
+++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/MigrateDrupalRunBatch.php
@@ -10,7 +10,6 @@
use Drupal\Core\Database\Database;
use Drupal\migrate\Entity\MigrationInterface;
use Drupal\migrate\MigrateExecutable;
-use Drupal\migrate\MigrateMessage;
class MigrateDrupalRunBatch {
@@ -30,10 +29,57 @@ public static function run($initial_ids, $db_spec, &$context) {
}
$migration_id = reset($context['sandbox']['migration_ids']);
$migration = entity_load('migration', $migration_id);
- // @TODO: if there are no source IDs then remove php.ini time limit.
- // @TODO: move time limit back into MigrateExecutable so we can set it here.
- $executable = new MigrateExecutable($migration, new MigrateMessage());
- if ($executable->import() == MigrationInterface::RESULT_COMPLETED) {
+ if ($migration) {
+ // @TODO: if there are no source IDs then remove php.ini time limit.
+ // @TODO: move time limit back into MigrateExecutable so we can set it here.
+ $messages = new MigrateMessageCapture();
+ $executable = new MigrateExecutable($migration, $messages);
+ $migration_name = $migration->label() ? $migration->label() : $migration_id;
+ $migration_status = $executable->import();
+ switch ($migration_status) {
+ case MigrationInterface::RESULT_COMPLETED:
+ $context['message'] = t('Imported @migration',
+ array('@migration' => $migration_name));
+ $context['results'][$migration_name] = 'success';
+ watchdog('migrate_drupal', 'Imported @migration',
+ array('@migration' => $migration_name));
+ break;
+ case MigrationInterface::RESULT_INCOMPLETE:
+ $context['message'] = t('Importing @migration',
+ array('@migration' => $migration_name));
+ break;
+ case MigrationInterface::RESULT_STOPPED:
+ $context['message'] = t('Import stopped by request');
+ break;
+ case MigrationInterface::RESULT_FAILED:
+ $context['message'] = t('Import of @migration failed',
+ array('@migration' => $migration_name));
+ $context['results'][$migration_name] = 'failure';
+ watchdog('migrate_drupal', 'Import of @migration failed',
+ array('@migration' => $migration_name));
+ break;
+ case MigrationInterface::RESULT_SKIPPED:
+ $context['message'] = t('Import of @migration skipped due to unfulfilled dependencies',
+ array('@migration' => $migration_name));
+ watchdog('migrate_drupal', 'Import of @migration skipped due to unfulfilled dependencies',
+ array('@migration' => $migration_name));
+ break;
+ case MigrationInterface::RESULT_DISABLED:
+ // Skip silently if disabled.
+ break;
+ }
+
+ // Add any captured messages.
+ foreach ($messages->getMessages() as $message) {
+ $context['message'] .= "
\n" . $message;
+ }
+
+ // Unless we're continuing on with this migration, take it off the list.
+ if ($executable->import() != MigrationInterface::RESULT_INCOMPLETE) {
+ array_shift($context['sandbox']['migration_ids']);
+ }
+ }
+ else {
array_shift($context['sandbox']['migration_ids']);
}
$context['finished'] = 1 - count($context['sandbox']['migration_ids']) / $context['sandbox']['max'];
@@ -45,7 +91,50 @@ public static function run($initial_ids, $db_spec, &$context) {
* @param $operations
* @param $elapsed
*/
- public static function finished($success, $results, $operations, $elapsed) {
+ public static function configurationFinished($success, $results, $operations, $elapsed) {
+ drupal_set_message(t('Configuration import complete.'));
+ self::displayResults($results);
+ }
+ /**
+ * @param $success
+ * @param $results
+ * @param $operations
+ * @param $elapsed
+ */
+ public static function contentFinished($success, $results, $operations, $elapsed) {
+ drupal_set_message(t('Content import complete.'));
+ self::displayResults($results);
+ drupal_set_message(t('Congratulations, you upgraded Drupal!'));
+ }
+
+ /**
+ * Display counts of success/failures.
+ *
+ * @param $results
+ */
+ protected static function displayResults($results) {
+ $successes = $failures = 0;
+ foreach ($results as $result) {
+ if ($result == 'success') {
+ $successes++;
+ }
+ else {
+ $failures++;
+ }
+ }
+ if ($successes > 0) {
+ drupal_set_message(t('@count succeeded',
+ array('@count' => \Drupal::translation()->formatPlural($successes,
+ '1 migration', '@count migrations'))));
+ }
+ if ($failures > 0) {
+ drupal_set_message(t('@count failed',
+ array('@count' => \Drupal::translation()->formatPlural($failures,
+ '1 migration', '@count migrations'))));
+ }
+ if (\Drupal::moduleHandler()->moduleExists('dblog')) {
+ drupal_set_message(l('Review the detailed migration log', '/upgrade-log'));
+ }
}
}
diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/MigrateMessageCapture.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/MigrateMessageCapture.php
new file mode 100644
index 0000000..20a775a
--- /dev/null
+++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/MigrateMessageCapture.php
@@ -0,0 +1,45 @@
+messages[] = $message;
+ }
+
+ /**
+ * Clear out any captured messages.
+ */
+ public function clear() {
+ $this->messages = array();
+ }
+
+ /**
+ * Return any captured messages.
+ *
+ * @return array
+ */
+ public function getMessages() {
+ return $this->messages;
+ }
+}
diff --git a/core/modules/migrate_drupal/migrate.config.yml b/core/modules/migrate_drupal/migrate.config.yml
index 8c3d62d..a1ba7f2 100644
--- a/core/modules/migrate_drupal/migrate.config.yml
+++ b/core/modules/migrate_drupal/migrate.config.yml
@@ -4,27 +4,26 @@ configuration:
- d6_book_settings
- d6_cck_field_values:*
- d6_cck_field_revision:*
- - d6_comment_entity_display
- - d6_comment_entity_form_display
- - d6_comment_field
- - d6_comment_field_instance
- - d6_contact_category
- - d6_contact_settings
- d6_date_formats
- d6_dblog_settings
- - d6_field
- - d6_field_instance
- - d6_field_instance_widget_settings
- - d6_field_settings
- - d6_field_formatter_settings
+ - d6_view_modes
- d6_file_settings
- d6_filter_format
- d6_forum_settings
- d6_locale_settings
- d6_menu_settings
- d6_menu
- - d6_node_settings
- d6_node_type
+ - d6_node_settings
+ - d6_field
+ - d6_field_instance
+ - d6_field_instance_widget_settings
+ - d6_field_settings
+ - d6_field_formatter_settings
+ - d6_comment_field
+ - d6_comment_field_instance
+ - d6_comment_entity_display
+ - d6_comment_entity_form_display
- d6_search_page
- d6_search_settings
- d6_simpletest_settings
@@ -39,27 +38,27 @@ configuration:
- d6_system_performance
- d6_system_rss
- d6_system_site
- - d6_system_theme
- d6_taxonomy_settings
- d6_taxonomy_vocabulary
- d6_text_settings
- d6_update_settings
- - d6_upload_entity_display
- - d6_upload_entity_form_display
- d6_upload_field
- d6_upload_field_instance
+ - d6_upload_entity_display
+ - d6_upload_entity_form_display
- d6_user_mail
+ - d6_user_profile_field
- d6_user_profile_field_instance
+ - d6_user_picture_field
+ - d6_user_picture_field_instance
- d6_user_profile_entity_display
- d6_user_profile_entity_form_display
- - d6_user_profile_field
- d6_user_picture_entity_display
- d6_user_picture_entity_form_display
- - d6_user_picture_field_instance
- - d6_user_picture_field
- d6_user_role
- - d6_view_modes
+ - d6_contact_category
+ - d6_contact_settings
+ - d6_vocabulary_field
+ - d6_vocabulary_field_instance
- d6_vocabulary_entity_display
- d6_vocabulary_entity_form_display
- - d6_vocabulary_field_instance
- - d6_vocabulary_field
diff --git a/core/modules/migrate_drupal/migrate.content.yml b/core/modules/migrate_drupal/migrate.content.yml
index 9819a8d..a0f1ae1 100644
--- a/core/modules/migrate_drupal/migrate.content.yml
+++ b/core/modules/migrate_drupal/migrate.content.yml
@@ -2,14 +2,19 @@ content:
- d6_aggregator_feed
- d6_aggregator_item
- d6_block
- - d6_comment
- d6_custom_block
- d6_file
- - d6_profile_values:user
- d6_taxonomy_term
- - d6_term_node_revision:*
- - d6_term_node:*
+ - d6_user_picture_file
+ - d6_user
+ - d6_profile_values:user
+ - d6_node
+ - d6_book
+ - d6_cck_field_values
+ - d6_node_revision
+ - d6_cck_field_revision
+ - d6_term_node
+ - d6_term_node_revision
+ - d6_comment
- d6_upload
- d6_url_alias
- - d6_user
- - d6_user_picture_file
diff --git a/core/modules/migrate_drupal/migrate_drupal.routing.yml b/core/modules/migrate_drupal/migrate_drupal.routing.yml
index a7e8fef..ff8006d 100644
--- a/core/modules/migrate_drupal/migrate_drupal.routing.yml
+++ b/core/modules/migrate_drupal/migrate_drupal.routing.yml
@@ -1,7 +1,9 @@
-migrate_drupal.run:
- path: '/admin/structure/migrate/run'
+migrate_drupal.upgrade:
+ path: '/upgrade'
defaults:
- _form: '\Drupal\migrate_drupal\Form\MigrateDrupalRunForm'
- _title: 'Run'
+ _form: '\Drupal\migrate_drupal\Form\MigrateDrupalUpgradeForm'
+ _title: 'Migration'
requirements:
_permission: 'administer site configuration'
+ options:
+ _admin_route: TRUE