D6 -> D8 : Migrate only taxonomy terms from a specific vocabulary When doing a D6->8 migration, my taxonomy term migration template imports all the taxonomy terms found in the source D6 site into my specified D8 taxonomy.

How do I filter only the terms that belong to a specific vocabulary? For a D7 migration all I needed was:-

source:
  plugin: d7_taxonomy_term
  bundle: tags


Bundles are not part of D6 so is there a way to do this in the yml file? Like ...

source:
  plugin: d6_taxonomy_term
  ???
You could create a plugin, where you can use sql to query what you need. 

For example:

&lt;?php

namespace Drupal\custom_migration\Plugin\migrate\source;

use Drupal\migrate\Plugin\migrate\source\SqlBase;

/**
 * Minimalistic example for a SqlBase source plugin.
 *
 * @MigrateSource(
 *   id = "custom_vocab_plugin",
 *   source_module = "custom_module",
 * )
 */
class CustomVocabulary extends SqlBase {

  /**
   * {@inheritdoc}
   */
  public function query() {
    $query = $this-&gt;select('vocabulary', 'v')
      -&gt;fields('v', [
        [....] // YOUR SQL HERE
      ]);
    return $query;
  }

  /**
   * {@inheritdoc}
   */
  public function fields() {
    return [
      [....]

    ];
  }

  /**
   * {@inheritdoc}
   */
  public function getIds() {
    $ids['vid']['type'] = 'integer';
    return $ids;
  }

}


Then you just need to use that plugin in your D6 migration:

source:
  plugin: custom_vocab_plugin