In the Drupal 7 contrib migrate module, there was a "system-of-record" concept. By default migrating into an existing content item completely replaces it with source data (system-of-record == SOURCE).
In D7, setting the system-of-record to DESTINATION allowed you to selectively import only particular fields from the source, leaving other fields (which may have been manually modified on the destination side) unmolested.
We removed below methods and constants. Since these are never actually used anywhere.
1. getSystemOfRecord() and setSystemOfRecord() from MigrationInterface and Migration.
2. SOURCE and DESTINATION constants from MigrationInterface.
3. protected $systemOfRecord property from Migration.
The closest equivalent in Drupal 8 is the overwrite_properties configuration option on destination plugins. This allows you to specify exactly which properties of the destination object should be overwritten, regardless of what data is available. For example:
destination:
plugin: 'entity:node'
overwrite_properties:
- uid
- title
- promoted
Comments
The rest are not overwritten?
Documentation is a bit sparse, " This allows you to specify exactly which properties of the destination object should be overwritten, regardless of what data is available" Does this imply that the other properties are not overwritten?
(not core side question, how does this relate to / work with migrate plus --update flag ? )
Correct - other properties are not overwritten.
I agree this change record is a bit sparse, so I went digging to see how it worked. You can find out more about the behaviour of the
overwrite_propertiesin the documentation for the EntityContentBase destination class. There's an example migration which demonstrates theoverwrite_propertiesis used.The behaviour happens in
EntityContentBase::updateEntity(), where you'll find this comment:So the default behaviour (when your migration destination does NOT have the
overwrite_properties) is to overwrite all the properties when running in update mode.When the
overwrite_propertiesis present, it is acting as a white-list of properties which will be overwritten. If the field isn't explicitly mentioned here, it is protected from overwrites.By the way, the update flag IS part of Drupal core migrate API. Contrib just provides the CLI for running migrations.