diff --git a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php
index f238504495..6687bd571e 100644
--- a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php
+++ b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php
@@ -522,9 +522,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 09dc9691e3..53e14b9bdb 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php
@@ -181,6 +181,8 @@ public function testMigrateUpgrade() {
 
     // Test the available migration paths.
     $all_available = $this->getAvailablePaths();
+    // Test the install profile is not in the available path list.
+    $this->assertArrayNotHasKey($this->profile, $all_available);
     $session = $this->assertSession();
     foreach ($all_available as $available) {
       $session->elementExists('xpath', "//span[contains(@class, 'checked') and text() = '$available']");
@@ -189,6 +191,8 @@ public function testMigrateUpgrade() {
 
     // Test the missing migration paths.
     $all_missing = $this->getMissingPaths();
+    // Test the install profile is not in the missing path list.
+    $this->assertArrayNotHasKey($this->profile, $all_missing);
     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']");
