Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / migrate_drupal_ui / src / Form / MigrateUpgradeForm.php
index c87247eb364554043469f4bf409de3d417cd7115..fff371d5b80275c9a2d56edbddb71b434dbd253d 100644 (file)
@@ -20,670 +20,6 @@ class MigrateUpgradeForm extends ConfirmFormBase {
 
   use MigrationConfigurationTrait;
 
-  /**
-   * Mapping of known migrations and their source and destination modules.
-   *
-   * @todo https://www.drupal.org/node/2569805 Hardcoding this information is
-   *   not robust - the migrations themselves should hold the necessary
-   *   information.
-   *
-   * @var array[]
-   */
-  protected $moduleUpgradePaths = [
-    'action_settings' => [
-      'source_module' => 'system',
-      'destination_module' => 'action',
-    ],
-    'd6_aggregator_feed' => [
-      'source_module' => 'aggregator',
-      'destination_module' => 'aggregator',
-    ],
-    'd6_aggregator_item' => [
-      'source_module' => 'aggregator',
-      'destination_module' => 'aggregator',
-    ],
-    'd6_aggregator_settings' => [
-      'source_module' => 'aggregator',
-      'destination_module' => 'aggregator',
-    ],
-    'd7_aggregator_feed' => [
-      'source_module' => 'aggregator',
-      'destination_module' => 'aggregator',
-    ],
-    'd7_aggregator_item' => [
-      'source_module' => 'aggregator',
-      'destination_module' => 'aggregator',
-    ],
-    'd7_aggregator_settings' => [
-      'source_module' => 'aggregator',
-      'destination_module' => 'aggregator',
-    ],
-    'd7_blocked_ips' => [
-      'source_module' => 'system',
-      'destination_module' => 'ban',
-    ],
-    'd6_block' => [
-      'source_module' => 'block',
-      'destination_module' => 'block',
-    ],
-    'd7_block' => [
-      'source_module' => 'block',
-      'destination_module' => 'block',
-    ],
-    'block_content_entity_form_display' => [
-      'source_module' => 'block',
-      'destination_module' => 'block_content',
-    ],
-    'block_content_entity_display' => [
-      'source_module' => 'block',
-      'destination_module' => 'block_content',
-    ],
-    'block_content_body_field' => [
-      'source_module' => 'block',
-      'destination_module' => 'block_content',
-    ],
-    'block_content_type' => [
-      'source_module' => 'block',
-      'destination_module' => 'block_content',
-    ],
-    'd6_custom_block' => [
-      'source_module' => 'block',
-      'destination_module' => 'block_content',
-    ],
-    'd7_custom_block' => [
-      'source_module' => 'block',
-      'destination_module' => 'block_content',
-    ],
-    'd6_book' => [
-      'source_module' => 'book',
-      'destination_module' => 'book',
-    ],
-    'd6_book_settings' => [
-      'source_module' => 'book',
-      'destination_module' => 'book',
-    ],
-    'd6_comment' => [
-      'source_module' => 'comment',
-      'destination_module' => 'comment',
-    ],
-    'd6_comment_entity_display' => [
-      'source_module' => 'comment',
-      'destination_module' => 'comment',
-    ],
-    'd6_comment_entity_form_display' => [
-      'source_module' => 'comment',
-      'destination_module' => 'comment',
-    ],
-    'd6_comment_entity_form_display_subject' => [
-      'source_module' => 'comment',
-      'destination_module' => 'comment',
-    ],
-    'd6_comment_field' => [
-      'source_module' => 'comment',
-      'destination_module' => 'comment',
-    ],
-    'd6_comment_field_instance' => [
-      'source_module' => 'comment',
-      'destination_module' => 'comment',
-    ],
-    'd6_comment_type' => [
-      'source_module' => 'comment',
-      'destination_module' => 'comment',
-    ],
-    'd7_comment' => [
-      'source_module' => 'comment',
-      'destination_module' => 'comment',
-    ],
-    'd7_comment_entity_display' => [
-      'source_module' => 'comment',
-      'destination_module' => 'comment',
-    ],
-    'd7_comment_entity_form_display' => [
-      'source_module' => 'comment',
-      'destination_module' => 'comment',
-    ],
-    'd7_comment_entity_form_display_subject' => [
-      'source_module' => 'comment',
-      'destination_module' => 'comment',
-    ],
-    'd7_comment_field' => [
-      'source_module' => 'comment',
-      'destination_module' => 'comment',
-    ],
-    'd7_comment_field_instance' => [
-      'source_module' => 'comment',
-      'destination_module' => 'comment',
-    ],
-    'd7_comment_type' => [
-      'source_module' => 'comment',
-      'destination_module' => 'comment',
-    ],
-    'contact_category' => [
-      'source_module' => 'contact',
-      'destination_module' => 'contact',
-    ],
-    'd6_contact_settings' => [
-      'source_module' => 'contact',
-      'destination_module' => 'contact',
-    ],
-    'd7_contact_settings' => [
-      'source_module' => 'contact',
-      'destination_module' => 'contact',
-    ],
-    'd6_dblog_settings' => [
-      'source_module' => 'dblog',
-      'destination_module' => 'dblog',
-    ],
-    'd7_dblog_settings' => [
-      'source_module' => 'dblog',
-      'destination_module' => 'dblog',
-    ],
-    'default_language' => [
-      'source_module' => 'locale',
-      'destination_module' => 'language',
-    ],
-    'd6_field' => [
-      'source_module' => 'content',
-      'destination_module' => 'field',
-    ],
-    'd6_field_formatter_settings' => [
-      'source_module' => 'content',
-      'destination_module' => 'field',
-    ],
-    'd6_field_instance' => [
-      'source_module' => 'content',
-      'destination_module' => 'field',
-    ],
-    'd6_field_instance_widget_settings' => [
-      'source_module' => 'content',
-      'destination_module' => 'field',
-    ],
-    'd7_field' => [
-      'source_module' => 'field',
-      'destination_module' => 'field',
-    ],
-    'd7_field_formatter_settings' => [
-      'source_module' => 'field',
-      'destination_module' => 'field',
-    ],
-    'd7_field_instance' => [
-      'source_module' => 'field',
-      'destination_module' => 'field',
-    ],
-    'd7_field_instance_widget_settings' => [
-      'source_module' => 'field',
-      'destination_module' => 'field',
-    ],
-    'd7_view_modes' => [
-      'source_module' => 'field',
-      'destination_module' => 'field',
-    ],
-    'd6_file' => [
-      'source_module' => 'system',
-      'destination_module' => 'file',
-    ],
-    'file_settings' => [
-      'source_module' => 'system',
-      'destination_module' => 'file',
-    ],
-    'd6_upload' => [
-      'source_module' => 'upload',
-      'destination_module' => 'file',
-    ],
-    'd6_upload_entity_display' => [
-      'source_module' => 'upload',
-      'destination_module' => 'file',
-    ],
-    'd6_upload_entity_form_display' => [
-      'source_module' => 'upload',
-      'destination_module' => 'file',
-    ],
-    'd6_upload_field' => [
-      'source_module' => 'upload',
-      'destination_module' => 'file',
-    ],
-    'd6_upload_field_instance' => [
-      'source_module' => 'upload',
-      'destination_module' => 'file',
-    ],
-    'd7_file' => [
-      'source_module' => 'file',
-      'destination_module' => 'file',
-    ],
-    'd7_file_private' => [
-      'source_module' => 'file',
-      'destination_module' => 'file',
-    ],
-    'd6_filter_format' => [
-      'source_module' => 'filter',
-      'destination_module' => 'filter',
-    ],
-    'd7_filter_format' => [
-      'source_module' => 'filter',
-      'destination_module' => 'filter',
-    ],
-    'd7_filter_settings' => [
-      'source_module' => 'filter',
-      'destination_module' => 'filter',
-    ],
-    'd6_forum_settings' => [
-      'source_module' => 'forum',
-      'destination_module' => 'forum',
-    ],
-    'd7_forum_settings' => [
-      'source_module' => 'forum',
-      'destination_module' => 'forum',
-    ],
-    'd7_global_theme_settings' => [
-      'source_module' => 'system',
-      'destination_module' => 'system',
-    ],
-    'd6_imagecache_presets' => [
-      'source_module' => 'imagecache',
-      'destination_module' => 'image',
-    ],
-    'd7_image_settings' => [
-      'source_module' => 'image',
-      'destination_module' => 'image',
-    ],
-    'd7_image_styles' => [
-      'source_module' => 'image',
-      'destination_module' => 'image',
-    ],
-    'd6_language_content_settings' => [
-      'source_module' => 'locale',
-      'destination_module' => 'language',
-    ],
-    'd7_language_content_settings' => [
-      'source_module' => 'locale',
-      'destination_module' => 'language',
-    ],
-    'd6_language_negotiation_settings' => [
-      'source_module' => 'locale',
-      'destination_module' => 'language',
-    ],
-    'd7_language_negotiation_settings' => [
-      'source_module' => 'locale',
-      'destination_module' => 'language',
-    ],
-    'language_prefixes_and_domains' => [
-      'source_module' => 'locale',
-      'destination_module' => 'language',
-    ],
-    'd6_language_types' => [
-      'source_module' => 'locale',
-      'destination_module' => 'language',
-    ],
-    'language' => [
-      'source_module' => 'locale',
-      'destination_module' => 'language',
-    ],
-    'd7_language_types' => [
-      'source_module' => 'locale',
-      'destination_module' => 'language',
-    ],
-    'locale_settings' => [
-      'source_module' => 'locale',
-      'destination_module' => 'locale',
-    ],
-    'd6_menu_links' => [
-      'source_module' => 'menu',
-      'destination_module' => 'menu_link_content',
-    ],
-    'menu_settings' => [
-      'source_module' => 'menu',
-      'destination_module' => 'menu_ui',
-    ],
-    'd7_menu_links' => [
-      'source_module' => 'menu',
-      'destination_module' => 'menu_link_content',
-    ],
-    'd6_node' => [
-      'source_module' => 'node',
-      'destination_module' => 'node',
-    ],
-    'd6_node_translation' => [
-      'source_module' => 'translation',
-      'destination_module' => 'content_translation',
-    ],
-    'd6_node_revision' => [
-      'source_module' => 'node',
-      'destination_module' => 'node',
-    ],
-    'd6_node_setting_promote' => [
-      'source_module' => 'node',
-      'destination_module' => 'node',
-    ],
-    'd6_node_setting_status' => [
-      'source_module' => 'node',
-      'destination_module' => 'node',
-    ],
-    'd6_node_setting_sticky' => [
-      'source_module' => 'node',
-      'destination_module' => 'node',
-    ],
-    'd6_node_settings' => [
-      'source_module' => 'node',
-      'destination_module' => 'node',
-    ],
-    'd6_node_type' => [
-      'source_module' => 'node',
-      'destination_module' => 'node',
-    ],
-    'd6_view_modes' => [
-      'source_module' => 'node',
-      'destination_module' => 'node',
-    ],
-    'd7_node' => [
-      'source_module' => 'node',
-      'destination_module' => 'node',
-    ],
-    'd7_node_revision' => [
-      'source_module' => 'node',
-      'destination_module' => 'node',
-    ],
-    'd7_node_settings' => [
-      'source_module' => 'node',
-      'destination_module' => 'node',
-    ],
-    'd7_node_translation' => [
-      'source_module' => 'node',
-      'destination_module' => 'node',
-    ],
-    'd7_node_title_label' => [
-      'source_module' => 'node',
-      'destination_module' => 'node',
-    ],
-    'd7_node_type' => [
-      'source_module' => 'node',
-      'destination_module' => 'node',
-    ],
-    'd6_url_alias' => [
-      'source_module' => 'path',
-      'destination_module' => 'path',
-    ],
-    'd7_url_alias' => [
-      'source_module' => 'path',
-      'destination_module' => 'path',
-    ],
-    'search_page' => [
-      'source_module' => 'search',
-      'destination_module' => 'search',
-    ],
-    'd6_search_settings' => [
-      'source_module' => 'search',
-      'destination_module' => 'search',
-    ],
-    'd7_search_settings' => [
-      'source_module' => 'search',
-      'destination_module' => 'search',
-    ],
-    'd7_shortcut' => [
-      'source_module' => 'shortcut',
-      'destination_module' => 'shortcut',
-    ],
-    'd7_shortcut_set' => [
-      'source_module' => 'shortcut',
-      'destination_module' => 'shortcut',
-    ],
-    'd7_shortcut_set_users' => [
-      'source_module' => 'shortcut',
-      'destination_module' => 'shortcut',
-    ],
-    'd6_simpletest_settings' => [
-      'source_module' => 'simpletest',
-      'destination_module' => 'simpletest',
-    ],
-    'd7_simpletest_settings' => [
-      'source_module' => 'simpletest',
-      'destination_module' => 'simpletest',
-    ],
-    'statistics_settings' => [
-      'source_module' => 'statistics',
-      'destination_module' => 'statistics',
-    ],
-    'd6_syslog_settings' => [
-      'source_module' => 'syslog',
-      'destination_module' => 'syslog',
-    ],
-    'd7_syslog_settings' => [
-      'source_module' => 'syslog',
-      'destination_module' => 'syslog',
-    ],
-    'd6_date_formats' => [
-      'source_module' => 'system',
-      'destination_module' => 'system',
-    ],
-    'd6_system_cron' => [
-      'source_module' => 'system',
-      'destination_module' => 'system',
-    ],
-    'd6_system_date' => [
-      'source_module' => 'system',
-      'destination_module' => 'system',
-    ],
-    'd6_system_file' => [
-      'source_module' => 'system',
-      'destination_module' => 'system',
-    ],
-    'system_image' => [
-      'source_module' => 'system',
-      'destination_module' => 'system',
-    ],
-    'system_image_gd' => [
-      'source_module' => 'system',
-      'destination_module' => 'system',
-    ],
-    'system_logging' => [
-      'source_module' => 'system',
-      'destination_module' => 'system',
-    ],
-    'system_maintenance' => [
-      'source_module' => 'system',
-      'destination_module' => 'system',
-    ],
-    'd6_system_performance' => [
-      'source_module' => 'system',
-      'destination_module' => 'system',
-    ],
-    'system_rss' => [
-      'source_module' => 'system',
-      'destination_module' => 'system',
-    ],
-    'system_site' => [
-      'source_module' => 'system',
-      'destination_module' => 'system',
-    ],
-    'd7_system_authorize' => [
-      'source_module' => 'system',
-      'destination_module' => 'system',
-    ],
-    'd7_system_cron' => [
-      'source_module' => 'system',
-      'destination_module' => 'system',
-    ],
-    'd7_system_date' => [
-      'source_module' => 'system',
-      'destination_module' => 'system',
-    ],
-    'd7_system_file' => [
-      'source_module' => 'system',
-      'destination_module' => 'system',
-    ],
-    'd7_system_mail' => [
-      'source_module' => 'system',
-      'destination_module' => 'system',
-    ],
-    'd7_system_performance' => [
-      'source_module' => 'system',
-      'destination_module' => 'system',
-    ],
-    'd6_menu' => [
-      'source_module' => 'menu',
-      'destination_module' => 'system',
-    ],
-    'd7_menu' => [
-      'source_module' => 'menu',
-      'destination_module' => 'system',
-    ],
-    'taxonomy_settings' => [
-      'source_module' => 'taxonomy',
-      'destination_module' => 'taxonomy',
-    ],
-    'd6_taxonomy_term' => [
-      'source_module' => 'taxonomy',
-      'destination_module' => 'taxonomy',
-    ],
-    'd6_taxonomy_term_translation' => [
-      'source_module' => 'i18n',
-      'destination_module' => 'taxonomy',
-    ],
-    'd6_taxonomy_vocabulary' => [
-      'source_module' => 'taxonomy',
-      'destination_module' => 'taxonomy',
-    ],
-    'd6_taxonomy_vocabulary_translation' => [
-      'source_module' => 'i18n',
-      'destination_module' => 'taxonomy',
-    ],
-    'd6_term_node' => [
-      'source_module' => 'taxonomy',
-      'destination_module' => 'taxonomy',
-    ],
-    'd6_term_node_revision' => [
-      'source_module' => 'taxonomy',
-      'destination_module' => 'taxonomy',
-    ],
-    'd6_vocabulary_entity_display' => [
-      'source_module' => 'taxonomy',
-      'destination_module' => 'taxonomy',
-    ],
-    'd6_vocabulary_entity_form_display' => [
-      'source_module' => 'taxonomy',
-      'destination_module' => 'taxonomy',
-    ],
-    'd6_vocabulary_field' => [
-      'source_module' => 'taxonomy',
-      'destination_module' => 'taxonomy',
-    ],
-    'd6_vocabulary_field_instance' => [
-      'source_module' => 'taxonomy',
-      'destination_module' => 'taxonomy',
-    ],
-    'd7_taxonomy_term' => [
-      'source_module' => 'taxonomy',
-      'destination_module' => 'taxonomy',
-    ],
-    'd7_taxonomy_vocabulary' => [
-      'source_module' => 'taxonomy',
-      'destination_module' => 'taxonomy',
-    ],
-    'text_settings' => [
-      'source_module' => 'text',
-      'destination_module' => 'text',
-    ],
-    'd7_tracker_node' => [
-      'source_module' => 'tracker',
-      'destination_module' => 'tracker',
-    ],
-    'd7_tracker_settings' => [
-      'source_module' => 'tracker',
-      'destination_module' => 'tracker',
-    ],
-    'd7_tracker_user' => [
-      'source_module' => 'tracker',
-      'destination_module' => 'tracker',
-    ],
-    'update_settings' => [
-      'source_module' => 'update',
-      'destination_module' => 'update',
-    ],
-    'd6_profile_values' => [
-      'source_module' => 'profile',
-      'destination_module' => 'user',
-    ],
-    'd7_theme_settings' => [
-      'source_module' => 'system',
-      'destination_module' => 'system',
-    ],
-    'd6_user' => [
-      'source_module' => 'user',
-      'destination_module' => 'user',
-    ],
-    'd6_user_contact_settings' => [
-      'source_module' => 'user',
-      'destination_module' => 'user',
-    ],
-    'd6_user_mail' => [
-      'source_module' => 'user',
-      'destination_module' => 'user',
-    ],
-    'd6_user_picture_file' => [
-      'source_module' => 'user',
-      'destination_module' => 'user',
-    ],
-    'd6_user_role' => [
-      'source_module' => 'user',
-      'destination_module' => 'user',
-    ],
-    'd6_user_settings' => [
-      'source_module' => 'user',
-      'destination_module' => 'user',
-    ],
-    'd7_user' => [
-      'source_module' => 'user',
-      'destination_module' => 'user',
-    ],
-    'd7_user_flood' => [
-      'source_module' => 'user',
-      'destination_module' => 'user',
-    ],
-    'd7_user_mail' => [
-      'source_module' => 'user',
-      'destination_module' => 'user',
-    ],
-    'd7_user_role' => [
-      'source_module' => 'user',
-      'destination_module' => 'user',
-    ],
-    'user_picture_entity_display' => [
-      'source_module' => 'user',
-      'destination_module' => 'user',
-    ],
-    'user_picture_entity_form_display' => [
-      'source_module' => 'user',
-      'destination_module' => 'user',
-    ],
-    'user_picture_field' => [
-      'source_module' => 'user',
-      'destination_module' => 'user',
-    ],
-    'user_picture_field_instance' => [
-      'source_module' => 'user',
-      'destination_module' => 'user',
-    ],
-    'user_profile_entity_display' => [
-      'source_module' => 'profile',
-      'destination_module' => 'user',
-    ],
-    'user_profile_entity_form_display' => [
-      'source_module' => 'profile',
-      'destination_module' => 'user',
-    ],
-    'user_profile_field' => [
-      'source_module' => 'profile',
-      'destination_module' => 'user',
-    ],
-    'user_profile_field_instance' => [
-      'source_module' => 'profile',
-      'destination_module' => 'user',
-    ],
-    'd6_i18n_user_profile_field_instance' => [
-      'source_module' => 'i18n',
-      'destination_module' => 'user',
-    ],
-  ];
-
   /**
    * The state service.
    *
@@ -806,16 +142,26 @@ class MigrateUpgradeForm extends ConfirmFormBase {
     }
     else {
       $form['info_header'] = [
-        '#markup' => '<p>' . $this->t('Upgrade a site by importing it into a clean and empty new install of Drupal 8. You will lose any existing configuration once you import your site into it. See the <a href=":url">online documentation for Drupal site upgrades</a> for more detailed information.', [
+        '#markup' => '<p>' . $this->t('Upgrade a site by importing its database and files into a clean and empty new install of Drupal 8. See the <a href=":url">Drupal site upgrades handbook</a> for more information.', [
           ':url' => 'https://www.drupal.org/upgrade/migrate',
         ]),
       ];
 
-      $info[] = $this->t('<strong>Back up the database for this site</strong>. Upgrade will change the database for this site.');
-      $info[] = $this->t('Make sure that the host this site is on has access to the database for your previous site.');
-      $info[] = $this->t('If your previous site has private files to be migrated, a copy of your files directory must be accessible on the host this site is on.');
-      $info[] = $this->t('In general, enable all modules on this site that are enabled on the previous site. For example, if you have used the book module on the previous site then you must enable the book module on this site for that data to be available on this site.');
-      $info[] = $this->t('Do not add any information on this site (including but not limited to user accounts, taxonomy terms, and node content) before upgrading. Any pre-existing information on the site risks being overwritten by the upgrade process. See <a href=":url">the upgrade preparation guide</a> for more information.', [
+      $legend[] = $this->t('<em>Old site:</em> the site you want to upgrade.');
+      $legend[] = $this->t('<em>New site:</em> this empty Drupal 8 installation you will import the old site to.');
+
+      $form['legend'] = [
+        '#theme' => 'item_list',
+        '#title' => $this->t('Definitions'),
+        '#list_type' => 'ul',
+        '#items' => $legend,
+      ];
+
+      $info[] = $this->t('You may need multiple tries for a successful upgrade so <strong>backup the database</strong> for this new site. The upgrade will change it and you may want to revert to its initial state.');
+      $info[] = $this->t('Make sure that <strong>access to the database</strong> for the old site is available from this new site.');
+      $info[] = $this->t('<strong>If the old site has private files</strong>, a copy of its files directory must also be accessible on the host of this new site.');
+      $info[] = $this->t('<strong>Enable all modules on this new site</strong> that are enabled on the old site. For example, if the old site uses the book module, then enable the book module on this new site so that the existing data can be imported to it.');
+      $info[] = $this->t('<strong>Do not add any content to the new site</strong> before upgrading. Any existing content is likely to be overwritten by the upgrade process. See <a href=":url">the upgrade preparation guide</a>.', [
         ':url' => 'https://www.drupal.org/docs/8/upgrade/preparing-an-upgrade#dont_create_content',
       ]);
       $info[] = $this->t('Put this site into <a href=":url">maintenance mode</a>.', [
@@ -824,12 +170,13 @@ class MigrateUpgradeForm extends ConfirmFormBase {
 
       $form['info'] = [
         '#theme' => 'item_list',
+        '#title' => $this->t('Steps to prepare for the upgrade'),
         '#list_type' => 'ol',
         '#items' => $info,
       ];
 
       $form['info_footer'] = [
-        '#markup' => '<p>' . $this->t('This upgrade can take a long time. It is better to import a local copy of your site instead of directly importing from your live site.'),
+        '#markup' => '<p>' . $this->t('The upgrade can take a long time. It is better to upgrade from a local copy of your site instead of directly from your live site.'),
       ];
 
       $validate = [];
@@ -889,7 +236,6 @@ class MigrateUpgradeForm extends ConfirmFormBase {
 
     $default_options = [];
 
-
     $form['version'] = [
       '#type' => 'radios',
       '#default_value' => 7,
@@ -1054,10 +400,15 @@ class MigrateUpgradeForm extends ConfirmFormBase {
         }
 
         // Store the retrieved migration IDs in form storage.
+        $form_state->set('version', $version);
         $form_state->set('migrations', $migration_array);
-        $form_state->set('source_base_path', $form_state->getValue('source_base_path'));
+        if ($version == 6) {
+          $form_state->set('source_base_path', $form_state->getValue('d6_source_base_path'));
+        }
+        else {
+          $form_state->set('source_base_path', $form_state->getValue('source_base_path'));
+        }
         $form_state->set('source_private_file_path', $form_state->getValue('source_private_file_path'));
-
         // Store the retrived system data in form storage.
         $form_state->set('system_data', $system_data);
       }
@@ -1103,19 +454,24 @@ class MigrateUpgradeForm extends ConfirmFormBase {
 
     $form['actions']['submit']['#value'] = $this->t('Perform upgrade');
 
+    $version = $form_state->get('version');
+    $migrations = $this->getMigrations('migrate_drupal_' . $version, $version);
+
     $table_data = [];
-    $system_data = [];
-    foreach ($form_state->get('migrations') as $migration_id => $migration_label) {
-      // Fetch the system data at the first opportunity.
-      if (empty($system_data)) {
-        $system_data = $form_state->get('system_data');
+    foreach ($migrations as $migration) {
+      $migration_id = $migration->getPluginId();
+      $source_module = $migration->getSourcePlugin()->getSourceModule();
+      if (!$source_module) {
+        drupal_set_message($this->t('Source module not found for @migration_id.', ['@migration_id' => $migration_id]), 'error');
+      }
+      $destination_module = $migration->getDestinationPlugin()->getDestinationModule();
+      if (!$destination_module) {
+        drupal_set_message($this->t('Destination module not found for @migration_id.', ['@migration_id' => $migration_id]), 'error');
       }
 
-      // Handle derivatives.
-      list($migration_id,) = explode(':', $migration_id, 2);
-      $source_module = $this->moduleUpgradePaths[$migration_id]['source_module'];
-      $destination_module = $this->moduleUpgradePaths[$migration_id]['destination_module'];
-      $table_data[$source_module][$destination_module][$migration_id] = $migration_label;
+      if ($source_module && $destination_module) {
+        $table_data[$source_module][$destination_module][$migration_id] = $migration->label();
+      }
     }
     // Sort the table by source module names and within that destination
     // module names.
@@ -1123,19 +479,29 @@ class MigrateUpgradeForm extends ConfirmFormBase {
     foreach ($table_data as $source_module => $destination_module_info) {
       ksort($table_data[$source_module]);
     }
+
+    // Fetch the system data at the first opportunity.
+    $system_data = $form_state->get('system_data');
     $unmigrated_source_modules = array_diff_key($system_data['module'], $table_data);
 
     // Missing migrations.
-    $form['missing_module_list_title'] = [
-      '#type' => 'item',
-      '#title' => $this->t('Missing upgrade paths'),
+    $missing_module_list = [
+      '#type' => 'details',
+      '#open' => TRUE,
+      '#title' => [
+        '#type' => 'html_tag',
+        '#tag' => 'span',
+        '#value' => $this->t('Missing upgrade paths'),
+        '#attributes' => ['id' => ['warning']],
+      ],
       '#description' => $this->t('The following items will not be upgraded. For more information see <a href=":migrate">Upgrading from Drupal 6 or 7 to Drupal 8</a>.', [':migrate' => 'https://www.drupal.org/upgrade/migrate']),
+      '#weight' => 2,
     ];
-    $form['missing_module_list'] = [
+    $missing_module_list['module_list'] = [
       '#type' => 'table',
       '#header' => [
-        $this->t('Source'),
-        $this->t('Destination'),
+        $this->t('Source module: Drupal @version', ['@version' => $version]),
+        $this->t('Upgrade module: Drupal 8'),
       ],
     ];
     $missing_count = 0;
@@ -1143,24 +509,39 @@ class MigrateUpgradeForm extends ConfirmFormBase {
     foreach ($unmigrated_source_modules as $source_module => $module_data) {
       if ($module_data['status']) {
         $missing_count++;
-        $form['missing_module_list'][$source_module] = [
-          'source_module' => ['#plain_text' => $source_module],
+        $missing_module_list['module_list'][$source_module] = [
+          'source_module' => [
+            '#type' => 'html_tag',
+            '#tag' => 'span',
+            '#value' => $source_module,
+            '#attributes' => [
+              'class' => [
+                'upgrade-analysis-report__status-icon',
+                'upgrade-analysis-report__status-icon--warning',
+              ],
+            ],
+          ],
           'destination_module' => ['#plain_text' => 'Missing'],
         ];
       }
     }
     // Available migrations.
-    $form['available_module_list'] = [
-      '#tree' => TRUE,
+    $available_module_list = [
       '#type' => 'details',
-      '#title' => $this->t('Available upgrade paths'),
+      '#title' => [
+        '#type' => 'html_tag',
+        '#tag' => 'span',
+        '#value' => $this->t('Available upgrade paths'),
+        '#attributes' => ['id' => ['checked']],
+      ],
+      '#weight' => 3,
     ];
 
-    $form['available_module_list']['module_list'] = [
+    $available_module_list['module_list'] = [
       '#type' => 'table',
       '#header' => [
-        $this->t('Source'),
-        $this->t('Destination'),
+        $this->t('Source module: Drupal @version', ['@version' => $version]),
+        $this->t('Upgrade module: Drupal 8'),
       ],
     ];
 
@@ -1174,21 +555,54 @@ class MigrateUpgradeForm extends ConfirmFormBase {
           '#plain_text' => $destination_module,
         ];
       }
-      $form['available_module_list']['module_list'][$source_module] = [
-        'source_module' => ['#plain_text' => $source_module],
+      $available_module_list['module_list'][$source_module] = [
+        'source_module' => [
+          '#type' => 'html_tag',
+          '#tag' => 'span',
+          '#value' => $source_module,
+          '#attributes' => [
+            'class' => [
+              'upgrade-analysis-report__status-icon',
+              'upgrade-analysis-report__status-icon--checked',
+            ],
+          ],
+        ],
         'destination_module' => $destination_details,
       ];
     }
-    $form['counts'] = [
-      '#title' => 'Upgrade analysis report',
-      '#theme' => 'item_list',
-      '#items' => [
-        $this->formatPlural($available_count, '@count available upgrade path', '@count available upgrade paths'),
-        $this->formatPlural($missing_count, '@count missing upgrade path', '@count missing upgrade paths'),
-      ],
-      '#weight' => -15,
+
+    $counters = [];
+    $general_info = [];
+
+    if ($missing_count) {
+      $counters[] = [
+        '#theme' => 'status_report_counter',
+        '#amount' => $missing_count,
+        '#text' => $this->formatPlural($missing_count, 'Missing upgrade path', 'Missing upgrade paths'),
+        '#severity' => 'warning',
+        '#weight' => 0,
+      ];
+      $general_info[] = $missing_module_list;
+    }
+    if ($available_count) {
+      $counters[] = [
+        '#theme' => 'status_report_counter',
+        '#amount' => $available_count,
+        '#text' => $this->formatPlural($available_count, 'Available upgrade path', 'Available upgrade paths'),
+        '#severity' => 'checked',
+        '#weight' => 1,
+      ];
+      $general_info[] = $available_module_list;
+    }
+
+    $form['status_report_page'] = [
+      '#theme' => 'status_report_page',
+      '#counters' => $counters,
+      '#general_info' => $general_info,
     ];
 
+    $form['#attached']['library'][] = 'migrate_drupal_ui/base';
+
     return $form;
   }
 
@@ -1239,7 +653,7 @@ class MigrateUpgradeForm extends ConfirmFormBase {
    * {@inheritdoc}
    */
   public function getQuestion() {
-    return $this->t('Are you sure?');
+    return $this->t('Upgrade analysis report');
   }
 
   /**