I would like to know how to correctly define the highwater property when using Migrate for Drupal 8. I am doing an import from a legacy non drupal database and I should be able to update only the relevant nodes whenever a column highwater changed. According to the official documentation, the solution is to use a highwater property. How to declare it? Is it a property to be set in the Plugin mapping class or is it an entry in the migrate.migration.*.yml file? Thanks!
2 Answers
You can add "high_water_property" in your migration config entity:
id: my_migration
source:
high_water_property:
name: changed
alias: n
From the documentation: - high_water_property: (optional) It is an array of name & alias values (optional table alias). This high_water_property is typically a timestamp or serial id showing what was the last imported record. Only content with a higher value will be imported.
Note: The high_water_property and track_changes are mutually exclusive.
Note: If you're not using SqlBase in your source, you might also want to implement something similar as shown there.
-
-
The patch has in #2485385 has been fixed. The answer below is more up to date.– mppJun 15, 2018 at 10:46
highWaterProperty renamed to high_water_property, and moved from the top-level migration plugin configuration into the source plugin configuration.
id: my_migration
source:
high_water_property:
name: changed
For more information, see: https://www.drupal.org/node/2795403