diff --git a/core/modules/migrate/src/Plugin/migrate/process/DedupeEntity.php b/core/modules/migrate/src/Plugin/migrate/process/DedupeEntity.php
index d2afe8f..a616c86 100644
--- a/core/modules/migrate/src/Plugin/migrate/process/DedupeEntity.php
+++ b/core/modules/migrate/src/Plugin/migrate/process/DedupeEntity.php
@@ -10,6 +10,9 @@
 /**
  * Ensures value is not duplicated against an entity field.
  *
+ * If the 'migrated' configuration value is true, an entity will only be
+ * considered a duplicate if it was migrated by the current migration.
+ *
  * @link https://www.drupal.org/node/2135325 Online handbook documentation for dedupe_entity process plugin @endlink
  *
  * @MigrateProcessPlugin(
@@ -26,10 +29,18 @@ class DedupeEntity extends DedupeBase implements ContainerFactoryPluginInterface
   protected $entityQueryFactory;
 
   /**
+   * The current migration.
+   *
+   * @var \Drupal\migrate\Plugin\MigrationInterface
+   */
+  protected $migration;
+
+  /**
    * {@inheritdoc}
    */
   public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, QueryFactory $entity_query_factory) {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
+    $this->migration = $migration;
     $this->entityQueryFactory = $entity_query_factory;
   }
 
@@ -51,12 +62,25 @@ public static function create(ContainerInterface $container, array $configuratio
    */
   protected function exists($value) {
     // Plugins are cached so for every run we need a new query object.
-    return $this
+    $query = $this
       ->entityQueryFactory
       ->get($this->configuration['entity_type'], 'AND')
-      ->condition($this->configuration['field'], $value)
-      ->count()
-      ->execute();
+      ->condition($this->configuration['field'], $value);
+    if (!empty($this->configuration['migrated'])) {
+      // Check if each entity is in the ID map.
+      $idMap = $this->migration->getIdMap();
+      foreach ($query->execute() as $id) {
+        $dest_id_values[$this->configuration['field']] = $id;
+        if ($idMap->lookupSourceID($dest_id_values)) {
+          return TRUE;
+        }
+      }
+      return FALSE;
+    }
+    else {
+      // Just check if any such entity exists.
+      return $query->count()->execute();
+    }
   }
 
 }
diff --git a/core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php b/core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php
index a1960de..af848cb 100644
--- a/core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\migrate\Unit\process;
 
+use Drupal\Core\Entity\Query\QueryInterface;
 use Drupal\migrate\Plugin\migrate\process\DedupeEntity;
 use Drupal\Component\Utility\Unicode;
 
@@ -161,4 +162,45 @@ protected function entityQueryExpects($count) {
       ->will($this->returnCallback(function () use (&$count) { return $count--;}));
   }
 
+  /**
+   * Test deduplicating only migrated entities.
+   */
+  public function testDedupeMigrated() {
+    $configuration = array(
+      'entity_type' => 'test_entity_type',
+      'field' => 'test_field',
+      'migrated' => TRUE,
+    );
+    $plugin = new DedupeEntity($configuration, 'dedupe_entity', array(), $this->getMigration(), $this->entityQueryFactory);
+
+    // Both 'forum' and 'test_vocab' are existing entities. There is no
+    // 'test_vocab1'.
+    $map = [];
+    foreach (['forums', 'test_vocab', 'test_vocab1'] as $id) {
+      $query = $this->prophesize(QueryInterface::class);
+      $query->willBeConstructedWith([]);
+      $query->execute()->willReturn($id === 'test_vocab1' ? [] : [$id]);
+      $map[] = ['test_field', $id, NULL, NULL, $query->reveal()];
+    }
+    $this->entityQuery->expects($this->exactly(3))
+      ->method('condition')
+      ->will($this->returnValueMap($map));
+
+    // Entity 'forums' is pre-existing, entity 'test_vocab' was migrated.
+    $this->idMap->expects($this->exactly(2))
+      ->method('lookupSourceID')
+      ->will($this->returnValueMap([
+        [['test_field' => 'forums'], FALSE],
+        [['test_field' => 'test_vocab'], ['source_id' => 42]],
+      ]));
+
+    // Existing entity 'forums' was not migrated, it should not be deduplicated.
+    $actual = $plugin->transform('forums', $this->migrateExecutable, $this->row, 'testproperty');
+    $this->assertEquals('forums', $actual, 'Pre-existing name is re-used');
+
+    // Entity 'test_vocab' was migrated, should be deduplicated.
+    $actual = $plugin->transform('test_vocab', $this->migrateExecutable, $this->row, 'testproperty');
+    $this->assertEquals('test_vocab1', $actual, 'Migrated name is deduplicated');
+  }
+
 }
diff --git a/core/modules/migrate_drupal_ui/src/Tests/d6/MigrateUpgrade6Test.php b/core/modules/migrate_drupal_ui/src/Tests/d6/MigrateUpgrade6Test.php
index 2a806de..3b53992 100644
--- a/core/modules/migrate_drupal_ui/src/Tests/d6/MigrateUpgrade6Test.php
+++ b/core/modules/migrate_drupal_ui/src/Tests/d6/MigrateUpgrade6Test.php
@@ -58,7 +58,7 @@ protected function getEntityCounts() {
       'action' => 22,
       'menu' => 8,
       'taxonomy_term' => 6,
-      'taxonomy_vocabulary' => 6,
+      'taxonomy_vocabulary' => 5,
       'tour' => 4,
       'user' => 7,
       'user_role' => 6,
diff --git a/core/modules/taxonomy/migration_templates/d6_taxonomy_vocabulary.yml b/core/modules/taxonomy/migration_templates/d6_taxonomy_vocabulary.yml
index 654a076..f7f5884 100644
--- a/core/modules/taxonomy/migration_templates/d6_taxonomy_vocabulary.yml
+++ b/core/modules/taxonomy/migration_templates/d6_taxonomy_vocabulary.yml
@@ -14,6 +14,7 @@ process:
       entity_type: taxonomy_vocabulary
       field: vid
       length: 32
+      migrated: true
   label: name
   name: name
   description: description
