0

The full scenario is as follows:

We have two entities (Foo and Bar). Foo has a multi-value entity reference field to Bar entities.

The migration source outputs each Foo-Bar pair in a single CSV line (manual aggregation is not possible because there are thousands of entries).

My plan was to put several entries with identical keys and using the --update flag and a custom process plugin, update the entry's entity by adding the Bar entity to the existing Bar entities instead of replacing them.

When I tried to put two entries with identical keys in a single CSV file, the migration module processed the first entry and ignored the second.

My understanding of the migration module is that each entry is assigned a key and that that key is mapped to the entity that was created by the migration.

Is there a way force the migration module to process multiple entries with identical keys?

I've asked the question on drupal.org as well

1 Answer 1

0

You can do this with drush migrate-import --update. See the migrate_tools module.

2
  • the drush migrate-import --update processes each key only once.
    – Eyal
    Mar 12, 2016 at 12:18
  • o I see what you're saying, what you're asking cannot be done without some work on your end. It is usually expected that the source data has unique keys. If not, you'll need to generate unique keys yourself.
    – benjy
    Mar 15, 2016 at 0:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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