How to migrate content into group and group content

Created on 9 September 2016, about 8 years ago
Updated 17 March 2023, over 1 year ago

I’m trying to figure out how to migrate some content into groups.

I’ll create a series of groups and remember and store an ID in a field in there. I then have a whole list of content items that I need to import into those groups (looking them up from the ID that was stored earlier) I’m just at a bit of a loss how to go about this - has anyone been down this journey already and can guide me a little or offer some advice on the way?

💬 Support request
Status

Active

Version

3.0

Component

Documentation

Created by

🇬🇧United Kingdom rachel_norfolk UK

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India Megha_kundar

    But this doesn't work with 3.x version of group
    Can anyone guide me in migrating groups module
    Please ?

  • 🇨🇷Costa Rica mcortes19

    In group v3 the group_content was changed to → group_relationship, also it requires the plugin_id field, so your migration could look like this:

    source:
      plugin: d7_node
      node_type: oportunity
    process:
      type:
        plugin: default_value
        default_value: program-group_node-opportunity
      plugin_id:
        plugin: default_value
        default_value: group_node:opportunity
      gid:
        plugin: migration_lookup
        migration: groups_audience
        no_stub: true
        source: groups_audience
      entity_id:
        plugin: migration_lookup
        migration: program_node_migration
        no_stub: true
        source: nid
    destination:
      plugin: 'entity:group_relationship'
    
Production build 0.71.5 2024