in our Drupal application, we have a few field collections that themselves have field collections. It looks like this:

 ├── field_xyz
 ├── field_collection2
 └── field_collection3

I am currently implementing migrations for all our content, and am a little bit stuck trying to figure out the best way to migrate these collections. I have absolutely no problem migrating field_collection1 and field_xyz using the MigrateDestinationFieldCollection class, but don't know how to approach the two nested collections.

Looking at the documentation available for migrating field collections, the only two host_entity_types that are supported seem to be node and term. field_collection1 is of course neither a node nor a term, so I am not sure how I would set it as the host entity. Is that even possible?

If not, would it be a sensible option to create the two nested migrations in the complete hook if the field_collection1 migration?

I am really appreciating any feedback on this.

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.