My D8 site has two entities:

  1. resource
  2. author

The resource entity has a field_authors entity reference field with unlimited cardinality.

My source data is coming from 3 tables

  1. resource
  2. author
  3. resource_author (which is your standard relationship table: a resource id and an author id)

I've already migrated the authors and am working on getting the field_authors set up but hitting a mental roadblock. For all the one-to-one relationships I've dealt with so far I could simply use the migration_lookup plugin. I think I need to be investigating the sub_process plugin but I'm just not sure. What I'm thinking I need to do is get the relationships based on the current row, and then use those relationships in a sub process that connects to a migration lookup.

How do I accomplish this?

  • AFAIK you can not handle this with the current on-board tools of Migrate or Migrate Plus module, because they follow a "one source-row to one target-entity" scheme. While it is possible to combine two sources into one target entity by using migration_lookup, I don't know of any Migrate plugin that allows appending values from multiple source rows into one field. But somebody else had that problem before (TM), maybe that patch works for you. – Hudri Nov 17 '19 at 15:17

Your Answer

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

Browse other questions tagged or ask your own question.