Clone a Site to Same or Different Server

Who this is for

Users who want to create a copy of an existing site — typically to create a staging environment, test changes, or migrate to a new server.


What Cloning Does

Cloning creates a new site that is a copy of an existing site, including:

  • The document root files (copied from the source site)
  • The database (copied from the source site's database)
  • The Nginx configuration (adapted for the new domain)
  • The environment variables (copied from the source)

The clone is created as an independent site — changes to the clone do not affect the original.


Prerequisites

  • The source site is running.
  • The server running the site has enough disk space to accommodate a second copy of the files and database.
  • If cloning to a different server: both the source and target servers are running with SSH connectivity.

How to Clone a Site

  1. Open the site detail of the site you want to clone.
  2. Click Clone Site, or find the Clone button in the site settings.
  3. Fill in the clone form:
FieldDescription
SubdomainThe subdomain prefix for the clone's domain (e.g., stagingstaging.myblog.com). Must be lowercase letters, numbers, and hyphens, 1–63 characters.
Target serverOptional — leave blank to clone to the same server. Select a different server to migrate.
DB admin credentialsOptional — only needed if the database requires elevated credentials to copy. Leave blank in most cases.
  1. Click Clone.

CloudAIPilot generates a plan. Review and confirm if in draft mode.


What the Clone Plan Does

  1. Creates a new database with the same schema and data as the source.
  2. Copies the document root files to a new directory.
  3. Creates a new Nginx vhost for the subdomain.
  4. Updates the cloned site's configuration to use the new database name and domain.
  5. If SSL was active on the source: SSL is not automatically issued on the clone. Issue it separately after DNS is configured.

Accessing the Cloned Site

After cloning:

  • The new site appears in the Sites list with the subdomain domain (e.g., staging.myblog.com).
  • Add a DNS A record for the subdomain pointing to the server's IP.
  • Issue SSL if needed — see KB-03-04: SSL Certificates.

Use Cases

Use caseHow to configure
Create a staging environmentClone to the same server with subdomain staging
Test a major upgradeClone to same server, test upgrade on clone first
Migrate to new serverClone with a different target server
Create a copy for a new clientClone to same or different server

What Success Looks Like

The cloned site appears in the Sites list. Visiting the subdomain domain shows the same content as the original site. Original site is completely unaffected.


Common Issues and Fixes

IssueLikely causeFix
Clone plan fails at "copy database"DB admin credentials required but not providedRetry with DB admin credentials in the clone form.
Subdomain validation errorContains uppercase or special charactersUse only lowercase letters, numbers, and hyphens.
Clone to different server failsTarget server SSH not accessibleVerify target server SSH from its overview.
Cloned site shows source site's domain in URLsWordPress or app stores domain in DBFor WordPress, use WP-CLI search-replace after cloning to update domain references.

Related Articles