Assign media to group during migrate

Created on 18 January 2025, 3 months ago

Hi, how can I add media to parent group on migration? I first migrate the groups and could use migration_lookup
Both, group and media source contain a unique group id.
Can I do the match directly on media migrate?

💬 Support request
Status

Active

Version

4.0

Component

Miscellaneous

Created by

🇩🇪Germany vistree

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @vistree
  • 🇩🇪Germany a.dmitriiev

    You need first migrate your groups, then media and then create another migration for group media relation. Media is attached to the group via the GroupContent entity type that is a group module functionality. Basically it is another content entity that has reference to a group and to the content that you want to attach to the group. So the third migration needs to create content items of entity type group_content with reference to your media item and group, and the bundle of this group content items will be the name of the plugin that corresponds to the bundle of the media.

  • 🇩🇪Germany a.dmitriiev

    Here is a nice issue with examples from group module https://www.drupal.org/project/group/issues/2797845 💬 How to migrate content into group and group content Active . Be aware of the last comment in that issue, there is a difference between versions of group module

  • 🇩🇪Germany vistree

    Thanx @a.dmitriiev - that helps a lot!

Production build 0.71.5 2024