You are here

Chapter Three: How to Prevent Duplicate Terms During a Drupal 8 Migration

Error message

User error: Failed to connect to memcache server: localhost:11212 in dmemcache_object() (line 415 of /home/freedrup/public_html/demo/d7/sites/all/modules/memcache/

In this post I will show a custom process plugin that I created to migrate taxonomy terms. The plugin handles the creation of new terms and prevents duplicates.

Below is a portion of the migration template. In the example, I am migrating new terms into keywords vocabulary via field_keywords field.

      plugin: existing_term
      # Destination (Drupal) vocabulary name
      vocabulary: keywords
      # Source query should return term name
      source: term_name
      plugin: skip_on_empty
      method: row

This is the source code for the process plugin.