error SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry I'm currently migrating my website to D8 and I'm having some issues updating my NEW nodes to match with my live D7 site.
I get a few of these for each content type. I think it's from creating &quot;test page&quot; and the node ID is taken.
I get a few of these warnings:
 [error]  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'e0891884-4da7-45c9-a1b5-808c8f821cfa' for key 'node_field__uuid__value': UPDATE {node} SET vid=:db_update_placeholder_0, type=:db_update_placeholder_1, uuid=:db_update_placeholder_2, langcode=:db_update_placeholder_3
WHERE nid = :db_condition_placeholder_0; Array
(
 [:db_update_placeholder_0] =&gt; 61287
 [:db_update_placeholder_1] =&gt; festival
 [:db_update_placeholder_2] =&gt; e0891884-4da7-45c9-a1b5-808c8f821cfa
 [:db_update_placeholder_3] =&gt; und
 [:db_condition_placeholder_0] =&gt; 3943
)

I tried drush migrate-import upgrade_d7_node_festival --update , but that didn't work. Is there a way to overwrite my test nodes when migrating? Do I have to go and delete all the table nodes in my DB then rerun the migration?
Thank!
sadly there is no &quot;vanilla&quot; way in migrate / migrate_tools / migrate_plus, to achieve this, at least that i know of.
I think the best solution is to create a custom plugin and append it to your yml file at the uuid field.
I should probably look something like this.
Disclaimer: The following snippet is derived from https://www.drupal.org/project/migrate_plus/issues/3060320 and modified to suit your case specifically. It is not tested though.
&lt;?php

namespace Drupal\your_module\Plugin\migrate\process;

use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\migrate\MigrateSkipRowException;
use Drupal\migrate\Plugin\MigrationInterface;
use Drupal\migrate\MigrateExecutableInterface;
use Drupal\migrate\ProcessPluginBase;
use Drupal\migrate\Row;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Skips processing the current row when a same entity already exists.
 *
 * Examples:
 *
 * @code
 * process:
 *   name:
 *     plugin: skip_on_duplicate_entity_exists
 * @endcode
 *
 * @MigrateProcessPlugin(
 *   id = &quot;skip_on_duplicate_entity_exists&quot;
 * )
 */
class SkipOnDuplicateEntityExists extends ProcessPluginBase implements ContainerFactoryPluginInterface {

  /**
   * The entity storage.
   *
   * @var \Drupal\Core\Entity\EntityStorageInterface
   */
  protected $storage;

  /**
   * EntityExists constructor.
   *
   * @param array $configuration
   *   A configuration array containing information about the plugin instance.
   * @param string $plugin_id
   *   The plugin ID.
   * @param mixed $plugin_definition
   *   The plugin implementation definition.
   * @param \Drupal\Core\Entity\EntityStorageInterface $storage
   *   The entity storage.
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityStorageInterface $storage) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this-&gt;storage = $storage;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) {
    return new static(
      $configuration,
      $plugin_id,
      $plugin_definition,
      // Use configuration instead of &quot;node&quot; for a mode generic solution
      $container-&gt;get('entity_type.manager')-&gt;getStorage('node')
    );
  }

  /**
   * {@inheritdoc}
   */
  public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
    $entityQuery = $this-&gt;storage-&gt;getQuery();

    $existingEntities = $entityQuery
      -&gt;condition('uuid', $value)
      -&gt;execute();

    /* The result is either an entity id string,
    or an array of entity id strings.
    If either one is not empty, there's a duplicate. */
    if (!empty($existingEntities)) {
      throw new MigrateSkipRowException();
    }

    return $value;
  }

}

You can find more on custom migrate plugins here https://www.drupal.org/docs/8/api/migrate-api/migrate-process/writing-a-process-plugin.
Let me know it it helped, or if you need any further assistance / clarification.