Contrib process plugins: migrate_process_extra
The following configuration examples are defined in the process section from the config/install/migrate_plus.migration.{migration_id}.yml from a custom migration module that makes use of the Migrate Process Extra module.
For the Migrate Plus documentation, refer to the module page and the two example modules that are enclosed in the module itself (migrate_example and migrate_example_advanced).
country_code
Example Migrate process plugin definition for the Address module, from several source fields, with a country name field defined in English that is converted in a country code.
field_address/country_code:
plugin: country_code
source: country_name_en
locale: en
field_address/locality: city
field_address/postal_code: zip
field_address/address_line1: address
validate_email
Example of basic email validation (applied by default) with an optional DNS validator. It checks the MX record first with a fallback to the A (or AAAA)' record. If one of the two is valid, the test passes.
field_email:
plugin: validate_email
source: email
extra_validator: dns
validate_link
field_website:
plugin: validate_link
source: website
format_phone
field_telephone:
plugin: format_phone
source: head_office_phone
region: EU
wrapper_extract
Example for a name that contains an acronym defined between parentheses: e.g. 'European Union (EU)'. Define open as '('and close as ')' to get the 'EU'string. Also possible for other cases like '<tag>' and '<'/tag>' in some situations, when tags are enclosed in the string.
field_acronym:
plugin: wrapper_extract
source: name
open: (
close: )
wrapper_remove
Example for a name that contains an acronym defined between parentheses: e.g. 'European Union (EU)'. Define open as '(' and close as')' to get the'European Union' string.
title:
plugin: wrapper_remove
source: name
open: (
close: )synonym
@todo
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion