diff --git a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php
index 6bfaf42f1d..0e7d88a2e0 100644
--- a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php
+++ b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php
@@ -521,9 +521,13 @@ public function buildConfirmForm(array $form, FormStateInterface $form_state) {
 
     // Fetch the system data at the first opportunity.
     $system_data = $form_state->get('system_data');
+
     // Remove core profiles from the system data.
-    foreach (['standard', 'minimal'] as $profile) {
-      unset($system_data['module'][$profile]);
+    $system_modules = system_get_info('module');
+    foreach ($system_modules as $name => $info) {
+      if ($info['type'] == 'profile') {
+        unset($system_data['module'][$name]);
+      }
     }
 
     $unmigrated_source_modules = array_diff_key($system_data['module'], $table_data);
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php
index d5cc93908a..715f44ba2a 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php
@@ -45,6 +45,16 @@
   ];
 
   /**
+   * A list of install profiles.
+   *
+   * @var array
+   */
+  private static $install_profiles = [
+    'minimal',
+    'standard',
+  ];
+
+  /**
    * {@inheritdoc}
    */
   protected function setUp() {
@@ -183,6 +193,10 @@ public function testMigrateUpgrade() {
 
     // Test the available migration paths.
     $all_available = $this->getAvailablePaths();
+    // Test that install profiles are not in the available path list.
+    foreach (self::$install_profiles as $profile) {
+      $this->assertArrayNotHasKey($profile, $all_available);
+    }
     $session = $this->assertSession();
     foreach ($all_available as $available) {
       $session->elementExists('xpath', "//span[contains(@class, 'checked') and text() = '$available']");
@@ -191,6 +205,10 @@ public function testMigrateUpgrade() {
 
     // Test the missing migration paths.
     $all_missing = $this->getMissingPaths();
+    // Test that install profiles are not in the missing path list.
+    foreach (self::$install_profiles as $profile) {
+      $this->assertArrayNotHasKey($profile, $all_available);
+    }
     foreach ($all_missing as $missing) {
       $session->elementExists('xpath', "//span[contains(@class, 'warning') and text() = '$missing']");
       $session->elementNotExists('xpath', "//span[contains(@class, 'checked') and text() = '$missing']");
