Skip to content

Migrate from Domain

Move an installation whose sites are domains of the Domain module to Sites, then remove the Domain modules.

Needs Sites migrator

Part of Sites migrator.

Before you start

  • Back up the database. The cleanup at the end deletes the Domain data.
  • Install Sites, the Sites modules you need and Sites migrator next to Domain. Domains with a path prefix need Sites path prefix, Domain path aliases need Sites path alias, menus need Sites menu.
  • Add the site type the sites get, or several.

Every command below accepts --dry-run, which writes nothing. They write only what Sites does not hold yet, so a second run is safe, and they leave the Domain data as it is until the cleanup.

Steps

  1. Preview, then copy the domains, their content, people and settings:

    drush sites-domain:migrate --dry-run
    drush sites-domain:migrate --site-type=brand --admin-role=site_manager
    

    Every domain becomes a site with the domain's machine name as its ID, enabled when the domain is active. A domain with a path prefix becomes a sub-site of the domain on the same hostname. Content and user accounts belong to the sites of their domains; the domain source is the origin site. Domain administrators get the role named by --admin-role on their sites. The command lists what it could not copy.

  2. Copy the menu of each domain into the site's own links of a shared menu, then place the block of the shared menu where the domain's menu was:

    drush sites-domain:migrate-menu main-example-com example_com --into=main
    
  3. Give the hub a hostname of its own: it answers on every hostname no site claims. Check each site on its overview: content, people, settings and hostnames.

  4. Uninstall Domain and every module that needs it:

    drush sites-domain:cleanup --dry-run
    drush sites-domain:cleanup
    
  5. Remove the packages: composer remove drupal/domain, plus drupal/domain_path and the other Domain modules you required.

Result

Every domain is a site with its content, its people, its settings, its hostnames and its menu. No Domain module is installed.

Last updated 2026-11-22