---
title: "Duplicating sites"
date: "2026-03-24T07:20:12+00:00"
summary: "Efficiently duplicate sites in Multi-Experience Operations. Create new sites with shared content and configuration across environments."
image:
type: "page"
url: "/acquia-cloud-platform/add-ons/multi-experience-operations/duplicating-sites"
id: "6146f0d8-c92e-4d2a-9e2b-5618d78b1dc0"
---

In Multi-Experience Operations, duplicate an existing site to create a new site with the same content and configuration. This method is the most efficient way to deploy new sites that share a common baseline in the same codebase. After you duplicate a site, Cloud Platform creates a new site entry and provisions it across the selected target environments using the data from a source environment.

You can duplicate a site either from the ****Sites**** list within a codebase or directly from a specific ****Environment Overview**** page.

Duplicating a site
------------------

To duplicate an existing site:

1.  [Sign in to the Cloud Platform user interface](https://cloud.acquia.com/).
    
2.  Go to **Codebases** and select the codebase containing the site you want to duplicate.
3.  Access the **Duplicate site** page either from:
    *   Sites Overview: Click **Sites** and locate the source site.
    *   Environment Overview:
        1.  Click the **Environment** column.
        2.  Select a specific environment (such as Dev or **Prod**).
        3.  Go to **Associated sites** section and locate the source site.
4.  Click **Actions > Duplicate site**.
5.  In **Site name**, specify a unique name to identify the site (1-50 alphanumeric characters).
6.  In **Technical identifier**, enter a unique ID for the site.  
    This is used for Secure Shell (SSH) keys and domain names and you cannot change it after creation.
    *   Must be unique within the codebase.
    *   Must be 1-14 alphanumeric characters (a-z, 0-9).
    *   The first character must be alphabetic (a-z).
7.  In **Source environment**, select the environment version of the site to duplicate.
    
    If you used the **Environment Overview** in Step 3, this field is pre-selected.
    
8.  In **Target environments**, select an environment to create the new site. The environment receive the data from the source environment.
9.  In **Duplicate parameter**, enter a parameter for a hook to use to delete unwanted data during the duplication process.
10.  Click **Duplicate site**.

Important considerations
------------------------

*   ****Data replication**** By default, the system copies all content, configurations, and records from the source environment to all selected target environments.
    
*   ****Technical identifiers**** The technical identifier is permanent and helps with Secure Shell (SSH) keys and domain names. This identifier must be unique in the codebase. You cannot change the identifier after you create the site.
    
*   ****Entitlements**** Each duplicated site counts toward the total Multi-Experience Operations site entitlement. The ****Duplicate site**** button remains inactive if you reach the entitlement limit or if required fields are invalid.
    
*   ****Hook parameters**** Use the ****Duplicate**** parameter field to pass specific values to a cloud hook. You can use these values to delete sensitive data during the duplication process.
    

Post-site duplication hook
--------------------------

Duplication without cache rebuild execution can break the interface theme. To ensure that a duplicated site reflects the most recent data and configurations, you must clear or rebuild caches and then clear Varnish cache through the UI to complete the duplication process. To rebuild the cache, add a `post-site-instance-duplicate` script to the codebase.

The hook script triggers after the site instance is active and the corresponding file system and database are provisioned. For additional file system and database provisioning details, check the task logs on the customer codebase overview page.

### Adding a duplicate site hook

To add the duplicate site hook:

1.  Follow the general Cloud Hook pattern: This process follows the standard Acquia Cloud platform hook workflow. Ensure that the repository structure supports the `/hooks` directory at the root level.
    
2.  Create the hook script: In the local codebase, create a new script file at the following path, `hooks/common/post-site-instance-duplicate`.
    
    To execute `post-site-instance-duplicate` on specific MEO environments, use the following path, `hooks/<environment name>/post-site-instance-duplicate`.
    
3.  ****Add the Drush command**** Add the cache-rebuild Drush command to ensure the new site is current. 
    
    *   ****Drush cc (Cache Clear):**** Use for Drupal 7 and earlier.
        
    *   ****Drush cr (Cache Rebuild):**** Use for Drupal 8, 9, 10, and 11. 
        
        The following is an example of hook script:
        
    
        #!/bin/bash
        set -ev
        # Factory Hook: post-site-instance-duplicate (simplified)
        # Usage: post-site-instance-duplicate.sh [optional parameters]
        echo $*
        # Resolve runtime env from execution user; this is the environment where hook runs.
        runtime_account="$(whoami)"
        runtime_site=""
        runtime_env=""
        internal_subdomain="$3"
        echo "Internal subdomain: $internal_subdomain"
        if [[ "$runtime_account" == *.* ]]; then
           runtime_site="${runtime_account%%.*}"
           runtime_env="${runtime_account#*.}"
        fi
        if [[ -z "$runtime_site" || -z "$runtime_env" ]]; then
           echo "Unable to resolve runtime site/environment from account: $runtime_account"
           exit 1
        fi
        echo "Runtime sitegroup: $runtime_site"
        echo "Runtime environment: $runtime_env"
        destination_domain="${internal_subdomain-$runtime_site$runtime_env.gardens.acquia-sites.com}"
        echo "Destination domain: $destination_domain"
        # Drush executable:
        drush="/mnt/www/html/$runtime_site.$runtime_env/vendor/bin/drush"
        # Rebuild all caches (Drupal 8+ recommended)
        $drush -r "/mnt/www/html/$runtime_site.$runtime_env/docroot" -l "$destination_domain" cache:rebuild
        exit 0
        
    
4.  Make the script executable: Run the following command to ensure Cloud Platform can execute the hook: `chmod +x hooks/common/post-site-instance-duplicate`.
    
5.  Commit and push the script: Add, commit, and push the script to the codebase repository. The hook triggers after the duplicated site is active.
    
        git add.
        git commit -m "Add post-site-instance-duplicate hook to clear caches"
        git push
    
6.  Clear Varnish cache: Initiate the Varnish cache clear after duplication for the site instance is complete.
    
    1.  Navigate to the duplicated site instance from either Sites Overview or Environments Overview.
        
    2.  Select **Clear caches** from the **Actions** menu on the site instance. This action clears the Varnish cache. If Platform Content Delivery Network (CDN) is enabled, it also clears the CDN cache for all Cloud Platform domains associated with the site. This action does not trigger a Drupal cache clear.
        

Note

Duplication without cache rebuild execution can break the UI theme; therefore, a cache rebuild is required. The script executes after the site instance is fully active. Use the Drush command-line tool within this script to automate post-duplication tasks, such as `drush cache-rebuild`, to ensure site consistency.