migrate_default_if_no_stored_value
This module provides a migration processing plugin that will allow you to set a fields default value ONLY if a value does not already exist on the destination node.
One problem we encountered at OHSU was that while we wanted a "default_value" for a particular field, it was aggressively setting that default value if we ever ran a migration with the update flag.
We were unable through searching to determine a way to use core migrate or migrate plus to accomplish this task, and so this module has come to exist.
Usage Use:
Check out the example below. You will place an equivalent in your migrations configuration YML file, for processing a field.
field_prof_provider_type:
plugin: default_if_no_stored_value
default_value: Specialist
entity_type: node
bundle: profileConfiguration Variables:
default_value - The value you wish to assign if no value is present on the destination
entity_type - The entity type you wish to upload. Currently only "node" is supported
bundle - The entity type bundle you wish to load.