Skip to content

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/sites and drupal/sites_group to their latest 1.x and run drush 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

  1. Copy content memberships, canonical sites, members and roles:

    drush sites-group:migrate
    

    Each 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.

  2. Check the content, people and roles on each site's dashboard.

  3. Turn the site types into native site types:

    drush sites-group:flip-types
    
  4. Copy the group menus into per-site menus:

    drush sites-group:migrate-menus
    

    Each 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.

  5. 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 uninstall sites_group_webform. Sites Webform takes over the group assignments of the webforms when it is installed.

  6. If your project added fields to the group type, copy them to the sites:

    drush sites-group:migrate-fields
    

    A 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.

  7. 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 --uninstall
    

    A module that other code still needs is reported and stays installed.

  8. Remove the packages: composer remove drupal/sites_group drupal/group, plus drupal/group_content_menu and 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.