Migrate from Sites group¶
Move an installation whose sites are groups of the Group module (sites_group)
to native sites, then remove the Group modules.
Needs Sites Group Migrate
Part of Sites group, which receives no further development and exists to carry this migration.
Before you start¶
- Back up the database. The cleanup at the end deletes the group data.
- Update
drupal/sitesanddrupal/sites_groupto their latest 1.x and rundrush updatedb. The update creates a site type for every group type used for sites, and a site for every group of those types. - Enable the migration:
drush en sites_group_migrate. It needs Sites content and Sites menu.
Every command below accepts --dry-run, which writes nothing. Except the
cleanup, they keep the group data and skip what they copied before, so a
second run is safe. They change configuration too (site types, roles, menus):
export it afterwards.
Steps¶
-
Copy content memberships, canonical sites, members and roles:
drush sites-group:migrateEach group role becomes a Drupal role that the group's members hold on their site; an outsider role's permissions move to its global role. Group permissions without an equivalent are listed: grant replacements by hand.
-
Check the content, people and roles on each site's dashboard.
-
Turn the site types into native site types:
drush sites-group:flip-types -
Copy the group menus into per-site menus:
drush sites-group:migrate-menusEach group menu type becomes a shared menu with one variant per site. Replace each group menu block with the block of the shared menu. A menu whose per-site name would exceed 32 characters is reported and skipped.
-
If you use
sites_group_webform: keep it enabled, install Sites Webform (drush en sites_webform), check a few webforms on their Settings > Sites tab, then uninstallsites_group_webform. Sites Webform takes over the group assignments of the webforms when it is installed. -
If your project added fields to the group type, copy them to the sites:
drush sites-group:migrate-fieldsA field is copied only when the site type has a field with the same machine name; the command lists the others. File and image fields are not copied: upload those files again on the site.
-
Check the sites once more, then delete the group data and uninstall the Group modules:
drush sites-group:cleanup --dry-run --uninstall drush sites-group:cleanup --uninstallA module that other code still needs is reported and stays installed.
-
Remove the packages:
composer remove drupal/sites_group drupal/group, plusdrupal/group_content_menuand the other Group modules you required.
Result¶
Every site is a native site with its content, its members' per-site roles and its per-site menus. No Group module is installed.