In Migrate Map

Last updated on
20 November 2022

Returns true if the source is found in the configured migrate map tables. This is most likely to be helpful in a scenario where your source data is kind of funky. This is unlikely to be useful in drupal-to-drupal migrations.

This functions similarly to the migration_lookup process plugin with a couple notable differences. First, this is a migrate_condition plugin, so it returns a boolean rather than destination ids. Second, this plugin will never create stubs and as such there is not a no_stub option. Third, the treatment of skipped rows is configurable through the include_skipped property.

Available configuration keys:

  • migration: The migration id or array of migration ids against which to do a lookup.

  • include_skipped: (optional) If TRUE, a source is considered to be in the map even the row has been skipped and the destination ids are null. Defaults to FALSE.

  • negate: (optional) Whether to negate the 'in_migrate_map' condition. Defaults to FALSE. You can also negate the 'in_migrate_map' plugin by using 'in_migrate_map' as the plugin id.

  • source: (optional) Property or array of properties on which to evaluate the condition. If not set, the condition will be evaluated on the source passed to the ::evaluate() method, typically the source of the process plugin that is using this condition.

The migration can be specified using parens notation, but only if it's a single migration.

Examples

1. Skip a row if a value is already in a specified migrate map

process:
  _skip_if_in_other_migration:
    plugin: skip_on_condition
    method: row
    source: my_source_value
    condition:
      plugin: in_migrate_map
      migration: some_other_migration

Help improve this page

Page status: No known problems

You can: