Clone On-Demand Sandboxes
On-demand sandbox cloning enables you to create exact replicas of existing sandboxes in minutes, not hours. It helps teams move faster while reducing risk by providing fully isolated environments for development, testing, and operational workflows.
With a single API call, you can provision a fully isolated replica of your sandbox that includes your database, application code, platform configurations, and all configured feature toggles.
To ensure a consistent and reliable clone, the source sandbox is automatically placed in a protected Stopped state during the cloning process. This safeguard guarantees data integrity and configuration consistency. Once cloning is complete, the source sandbox resumes normal operation.
Each cloned sandbox is fully isolated, with dedicated compute, storage, and database resources.
Typical use cases include:
- Reproducing production bugs safely without impacting live systems
- Validating disaster recovery plans in isolated replicas
- Spinning up development or test environments for teams quickly
- Validating upgrades and configuration changes before deployment
- Testing feature or performance changes before deployment
- Supporting CI/CD pipelines with on-demand test environments
- Providing realistic training or experimentation environments
- Optimizing costs by cloning sandboxes only when needed
A sandbox clone includes:
- Database schema and data
- Custom code and cartridges
- Storefront, site data, and configurations
- Catalogs and pricebooks
- Orders and content data
- Feature toggles
- Maintenance pages
- Standard platform configuration files
The following data is excluded to protect security, privacy, and tenant integrity:
- Logs and jobs history
- Customer PII and GDPR-related data
- Analytics data
- Geolocation data
- Order activity
- Exchange rate data
- Change logs
- Tenant-specific configurations
Sensitive data is either omitted or transformed to ensure compliance with platform security and privacy requirements.
The cloning process includes six detailed steps grouped into four main progress stages:
- Prep Instance
- Validation: Checks the source sandbox status, permissions, and resource availability.
- Data Backup
- Backup Creation: Creates a consistent snapshot of the source database, sharedata and configurations.
- Data Restore
- Target Provisioning: Allocates compute, storage, and network resources for the new sandbox.
- Data Restoration: Copies database tables, indexes, and files to the cloned environment.
- Configuration Transformation: Updates system files and credentials to ensure independence.
- Post Validation
- Activation: Validates sandbox health, tests connectivity, and makes the clone available.
Total duration is typically 10–30 minutes, depending on sandbox size and data volume.
To clone sandboxes, you need:
Account Requirements
- Sandbox API User role assigned in B2C Commerce Account Manager with realm/tenant-level access.
Source Sandbox Requirements
- Source sandbox must be in Running or Stopped state
- Source sandbox should be in Enabled state
- Source sandbox must not have pending operations
- Permissions to access source sandbox data
Sandbox cloning is also available through Control Center. For more information, see Clone On-Demand Sandboxes for B2C Commerce.
Sandbox cloning is available through the B2C Commerce On-Demand Sandbox REST API. The clone API enables you to programmatically create and manage sandbox clones, giving developers and admins full control over provisioning and monitoring of the clones.
You can access documentation for the Clone APIs and issue API calls from the Sandbox API user interface at https://admin.dx.commercecloud.salesforce.com/. Click Authorize to log in with the API Client ID you configured using Account Manager.
Initiate a clone operation using the POST endpoint.
Request
cURL
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| sandboxId | string (UUID) | Yes | Unique identifier of the source sandbox to clone |
| targetProfile | string | Yes | Resource profile for the cloned sandbox: medium, large, xlarge, or xxlarge. Note: Target Profile cannot be lower than the source sandbox. |
| emails | List | No | Email addresses for notifications |
| ttl | int | No | Number of hours for the sandbox clone lifetime. Default: 24 hours |
Success Response (200 OK)
The cloneId can be used to track the clone operation status.
Error Responses
400 Bad Request - Illegal Argument
403 Forbidden - AccessDenied
404 Not Found - Sandbox not found
Monitor the progress of a clone operation using the clone ID and source sandbox ID. This can also be used to retrieve details for a specific cloned sandbox.
Request
cURL
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| sandboxId | string (UUID) | Yes | Unique identifier of the source sandbox |
| cloneId | string | Yes | Unique identifier of the clone operation |
Success Response (200 OK)
Response Fields
| Field | Type | Description |
|---|---|---|
| cloneId | string | Unique identifier for the clone operation |
| realm | string | Four-letter realm identifier |
| sourceInstance | string | Source instance number |
| targetInstance | string | Target instance number |
| sourceInstanceId | string (UUID) | UUID of the source sandbox |
| targetInstanceId | string (UUID) | UUID of the cloned sandbox |
| targetProfile | string | Resource profile: medium, large, xlarge, or xxlarge |
| createdAt | string (ISO 8601) | Timestamp when clone was initiated |
| createdBy | string (email) | Email of user who initiated the clone |
| lastUpdated | string (ISO 8601) | Timestamp of most recent status update |
| status | string | Current status: IN_PROGRESS, COMPLETED, or FAILED |
| elapsedTimeInSec | integer | Elapsed time since clone started (seconds) |
| progressPercentage | integer | Completion progress (0-100) |
| lastKnownState | string | Current state of the clone progress |
| storefrontCount | integer | Count of storefronts |
| filesystemUsageSize | integer | Share data transfer size in megabytes |
| databaseTransferSize | integer | Database transfer size in megabytes |
| customCodeVersion | string | Code version |
Clone Status Values
| Status | Description |
|---|---|
| IN_PROGRESS | Clone operation is currently running. Continue polling for updates. |
| COMPLETED | The clone operation finished successfully. Target sandbox is operational. |
| FAILED | Clone operation encountered an error. Review error details. |
Error Responses
403 Forbidden - AccessDenied
404 Not Found - Invalid Sandbox Id
404 Not Found - No Clone Found
Fetch details of all clone operations associated with a specific sandbox.
Request
cURL
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| sandboxId | string (UUID) | Yes | Unique identifier of the source sandbox to clone |
| fromDate | string (query) | No | Filter clones created on or after this date (ISO 8601 date format). When provided without toDate, toDate defaults to the current timestamp. |
| toDate | string (query) | No | Filter clones created on or before this date (ISO 8601 date format). If omitted when fromDate is provided, it defaults to the current timestamp. |
| status | string (query) | No | Filter clones by status. If not provided, returns all clones regardless of status. Available values: Pending, InProgress, Failed, Completed. |
Success Response (200 OK)
Response Fields
| Field | Type | Description |
|---|---|---|
| cloneId | string | Unique identifier for the clone operation |
| realm | string | Four-letter realm identifier |
| sourceInstance | string | Source instance number |
| targetInstance | string | Target instance number |
| sourceInstanceId | string (UUID) | UUID of the source sandbox |
| targetInstanceId | string (UUID) | UUID of the cloned sandbox |
| targetProfile | string | Resource profile: medium, large, xlarge, or xxlarge |
| createdAt | string (ISO 8601) | Timestamp when clone was initiated |
| createdBy | string (email) | Email of user who initiated the clone |
| lastUpdated | string (ISO 8601) | Timestamp of most recent status update |
| status | string | Current status: IN_PROGRESS, COMPLETED, or FAILED |
| elapsedTimeInSec | integer | Elapsed time since clone started (seconds) |
| progressPercentage | integer | Completion progress (0-100) |
| lastKnownState | string | Current state of the clone progress |
| storefrontCount | integer | Count of storefronts |
| filesystemUsageSize | integer | Share data transfer size in megabytes |
| databaseTransferSize | integer | Database transfer size in megabytes |
| customCodeVersion | string | Code version |
Clone Status Values
| Status | Description |
|---|---|
| IN_PROGRESS | Clone operation is currently running. Continue polling for updates. |
| COMPLETED | The clone operation finished successfully. Target sandbox is operational. |
| FAILED | Clone operation encountered an error. Review error details. |
Error Responses
403 Forbidden - AccessDenied
404 Not Found - Invalid Sandbox Id
After cloning completes, you must manually update (if any):
- Custom tenant-specific configurations
- Hard-coded URLs in custom cartridges or scripts
- Third-party service URLs and API endpoints
- Keystore references and certificates tied to the source sandbox
- Custom jobs or schedules that reference the source instance
Choose Appropriate Resource Profiles
Select the profile that meets your requirements. For cloning, the target profile should be the same size or larger than the source sandbox profile.
Review Custom Configurations
After cloning completes, test all integrations and custom configurations. Update third-party endpoints, keystores, and Business Manager customizations that reference the source sandbox.
Manage Cloned Sandboxes
Delete cloned sandboxes when no longer needed to reduce credit consumption.
Plan Clone Operations
Where feasible, execute large clone operations during times when sandbox usage is low.
Save Your Work
During the clone process, the source sandbox will be stopped. Make sure to save any open work before triggering the clone operation.
Monitor Clone Progress
You can monitor the progress of a clone using the Monitor Clone Progress API. Poll the API every 30–60 seconds to check status, but avoid excessive polling, which may trigger rate limits.
Set Time-to-Live Values
Configure the ttl parameter to automatically clean up temporary clones and avoid consuming unnecessary credits.
Q. What state must the source sandbox be in to perform a clone?
A. The source sandbox must be in an Enabled state, either Running or Stopped, to be successfully cloned.
Q. What happens to the source sandbox during cloning?
A. It becomes temporarily unavailable and is placed in a Stopped state to protect data integrity.
Q. Can multiple clone operations run from the same source sandbox at the same time?
A. No. Only one clone can run per source sandbox at a time, however different source sandboxes can be cloned simultaneously.
Q. Where is the cloned sandbox created?
A. It's created in the same realm as the source sandbox.
Q. Are platform configuration files updated automatically during cloning?
A. Standard platform configurations are updated automatically. Custom configurations must be reviewed manually.
Q. Are tenant-specific configurations and customizations updated automatically?
A. No. Tenant-specific configurations, custom keystores, certificates, and Business Manager customizations are not updated automatically.
Q. Can a clone operation be paused or resumed?
A. No. Once started, a clone operation cannot be paused or resumed.
Q. How long does cloning usually take?
A. It typically takes 10–30 minutes. In rare cases, it may take up to 60 minutes. If it exceeds 60 minutes, the process fails and the source sandbox is restored.
Q. Are there any credit requirements for cloning?
A. Yes. A sufficient credit balance is required for both the clone operation and the target sandbox uptime.
Q. What happens to feature toggles during cloning?
A. Any manually set or customized feature toggles are copied to the cloned sandbox.
Q. What is the default minimum TTL (Time To Live) for a cloned sandbox?
A. The minimum TTL is 24 hours to avoid accidental deletion during setup.
Q. Can I clone a sandbox to a profile lower than the current profile of the source sandbox?
A. No. The cloned sandbox can have a profile that is the same as or higher than the source sandbox's profile, but not lower.
Q. What happens if I accidentally delete the source sandbox after successfully creating the clone?
A. Once the clone sandbox is successfully created, it operates as an independent sandbox. Deleting the source sandbox will have no impact on the cloned sandbox.
Q. What happens if I don't include the emails attribute when calling the Create Clone API?
A. If you do not explicitly provide the emails attribute, the cloned sandbox will not inherit or copy the email settings from the source sandbox by default.