By heddn on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
6.0.x
Introduced in version:
6.0.0
Issue links:
Description:
Share configuration for migrations has previously been handled via a migrate_group config entity provided by migrate_plus.
With the addition of shared configuration in Migrate tools, the use of groups is no longer needed.
Previously:
# migrate_plus.migration_group.default.yml
langcode: en
status: true
dependencies: { }
id: default
label: Default
description: ''
source_type: ''
module: null
shared_configuration:
source:
key: drupal_7
An entry was placed in the migration like:
# d7_node.yml
id: d7_node
label: Nodes
migration_tags:
- Drupal 7
- Content
migration_group: default #<== Addition of migration_group shared configuration into a migration
source:
plugin: d7_node
process:
destination:
The source key: is shared to all migrations registered with the default migrate group and it let all migrations connect to the source database with a db key of drupal_7.
New approach
The limitation was that only a single group could be used. With the new approach, none, one or multiple shared configurations can be used.
- Create a shared configuration file in your module:
my_migrate_module.migrate_shared_configuration.yml
# my_migrate_module.migrate_shared_configuration.yml default_source_configuration: source: key: drupal_7 default_destination_configuration: destination: key: default - Insert references to the shared configuration in your migration:
# d7_node.yml id: d7_node label: Nodes migration_tags: - Drupal 7 - Content # Add one shared configuration into a migration include: default_source_configuration # Also valid are multiple: include: - default_source_configuration - default_destination_configuration source: plugin: d7_node process: destination:
Impacts:
Module developers