This module enhances the Drush site export command for sites using the Group module. It ensures group relationships are exported cleanly and portably by using UUIDs, while optionally excluding sensitive membership data. This helps in creating reusable site configurations without including user-specific information.
The Group Relationship Export module improves the drush site:export command for Drupal sites using the Group module.
It ensures that group relationships are exported cleanly by excluding sensitive membership data and correctly handling entity dependencies.
Features
- Fixed group relationship dependency tracking: Fixes issues where referenced entities in group relationships were not correctly identified as dependencies during export.
- UUID-based references: Ensures that exported group relationships use UUIDs instead of local IDs, making the exported content portable across different environments.
- (Optional) Exclude memberships: Automatically prevents
group_membershipentities from being exported. This is for avoiding the inclusion of user data in reusable site recipes or default content. Assumption: You don't want to export the users and their relationships, only the group content and be able to start your site just with UID 1.
Post-Installation
Once installed, the module works automatically by subscribing to the pre-export events of the site:export command.
Optionally, you can de-activate the "Exclude memberships" feature on the module's config page (/admin/config/development/group-relationship-export).
Then simply run your standard Drush export command:
drush site:exportThe module will intercept the process to apply the improvements to group-related data.
Additional Requirements
- Group module (supports versions compatible with Group 3.x and 4.x).
- Drupal Core 10.3 or higher.
Recommended modules/libraries
There are no additional recommended modules at this time, but it is recommended to use this in conjunction with the Default Content or Recipes workflow where site:export is utilized, because otherwise you likely won't need it.