2

I have got existing Drpal 8.5 site with hundreds of nodes. With migrate, if i try to upgrade, new nodes are rather created. Node have a field which is being used as key however that seem to be not working. It seems that node are only updated if their record present in migrate_map_xyz. Any suggestions?

1 Answer 1

1

Updating existing content was possible by changing the default behaviour of a migration with the system of record concept in Drupal 7.

In Drupal 8 this concept has been revised & is available with the overwrite_properties option in the destination of the migration YAML:

...
destination:
  plugin: 'entity:node'
  # define the entity properties that are to be updated.
  overwrite_properties:
    - title
    - field_foo
    - field_bar
...
2
  • Can't seem to get it work. Here is the code; with this, it still creates new nodes. Source: plugin: csv path: public://migrate/simple_assets.csv delimiter: ',' enclosure: '"' header_row_count: 1 keys: - serial column_names: 0: serial: 'Serial/Service Tag' 1: type: 'Type' (source plugin data here) destination: plugin: entity:node override_properties: - serial - type serial,type ABC123,Laptop XYZ124,Laptop Commented Mar 9, 2018 at 4:06
  • Migration YAML and CSV Commented Mar 9, 2018 at 4:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.