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
- Open the site detail of the site you want to clone.
- Click ⋮ → Clone Site, or find the Clone button in the site settings.
- Fill in the clone form:
| Field | Description |
|---|---|
| Subdomain | The subdomain prefix for the clone's domain (e.g., staging → staging.myblog.com). Must be lowercase letters, numbers, and hyphens, 1–63 characters. |
| Target server | Optional — leave blank to clone to the same server. Select a different server to migrate. |
| DB admin credentials | Optional — only needed if the database requires elevated credentials to copy. Leave blank in most cases. |
- Click Clone.
CloudAIPilot generates a plan. Review and confirm if in draft mode.
What the Clone Plan Does
- Creates a new database with the same schema and data as the source.
- Copies the document root files to a new directory.
- Creates a new Nginx vhost for the subdomain.
- Updates the cloned site's configuration to use the new database name and domain.
- 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 case | How to configure |
|---|---|
| Create a staging environment | Clone to the same server with subdomain staging |
| Test a major upgrade | Clone to same server, test upgrade on clone first |
| Migrate to new server | Clone with a different target server |
| Create a copy for a new client | Clone 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
| Issue | Likely cause | Fix |
|---|---|---|
| Clone plan fails at "copy database" | DB admin credentials required but not provided | Retry with DB admin credentials in the clone form. |
| Subdomain validation error | Contains uppercase or special characters | Use only lowercase letters, numbers, and hyphens. |
| Clone to different server fails | Target server SSH not accessible | Verify target server SSH from its overview. |
| Cloned site shows source site's domain in URLs | WordPress or app stores domain in DB | For WordPress, use WP-CLI search-replace after cloning to update domain references. |
Related Articles
- KB-03-01: Create a Site from Scratch
- KB-03-03: Configure Domain and DNS
- KB-03-04: Issue SSL Certificates
- KB-03-14: Site Migration Workflow