Use on-demand sandbox cloning 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, provision a fully isolated replica of your sandbox that includes your database, application code, platform configurations, and all configured feature toggles.
To maintain a consistent and reliable clone, the source sandbox is automatically placed in a protected Stopped state during the initial backup phase of the cloning process. This safeguard guarantees data integrity and configuration consistency. After the backup completes, the source sandbox becomes available again, while the remaining clone phases continue in the background.
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
What Is Included in a Clone
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
What Is Not Included
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.
How Sandbox Cloning Works
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.
The source sandbox is unavailable only during the initial backup phase of the clone operation. Once the backup is complete, the source sandbox becomes available again. If the source sandbox was running when the clone operation was initiated, it’s automatically restarted after the backup completes. If it was already stopped, it remains in the stopped state.
The remaining phases of the clone operation continue in the background and don’t require the source sandbox to be stopped.
Although the source sandbox becomes available before the clone operation finishes, you can’t start another clone from the same source until the current clone completes. See the Sandbox Cloning FAQ for more details.
A clone request can target either a single sandbox (one-to-one cloning) or multiple sandboxes (one-to-many cloning), with up to five target sandboxes per request. With one-to-many cloning, the source sandbox is backed up once, and that backup is used to restore all target sandboxes in parallel. The source availability behavior remains the same regardless of the number of targets.
Each target sandbox progresses through cloning independently. If one target encounters an error, the remaining targets continue processing and can complete successfully.
Prerequisites
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
Sandbox cloning is available through the B2C Commerce On-Demand Sandbox REST API. Use the clone API to programmatically create and manage sandbox clones, giving developers and admins full control over provisioning and monitoring of the clones.
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.
Create a Clone
Initiate a clone operation using the POST endpoint.
Resource profile for the cloned sandbox: medium, large, xlarge, or xxlarge. Note: Target Profile can’t be lower than the source sandbox.
targetCount
int
No
Number of sandbox clones to create from this source. Valid values: 1–5. Default: 1 (a single one-to-one clone). When greater than 1, the clones are created as a batch that shares a batchId.
emails
List
No
Email addresses for notifications
ttl
int
No
Number of hours for the sandbox clone lifetime. Default: 24 hours
Success Response (201 Created)
1{2 "cloneId": "abcd-001-180620251331"3}
The cloneId can be used to track the clone operation status.
Error Responses
400 Bad Request - Illegal Argument
1{2 "kind": "Status",3 "code": 400,4 "status": "Failure",5 "error": {6 "status": "Failure",7 "message": "Profile downgrade not allowed. Current profile: large, Requested profile: medium. Only same profile or upgrades are permitted.",8 "reason": "IllegalArgument"9 }10}
403 Forbidden - AccessDenied
1{2 "kind": "Status",3 "code": 403,4 "status": "Failure",5 "error": {6 "status": "Failure",7 "message": "User doesn't have access to this realm",8 "reason": "AccessDenied"9 }10}
Set targetCount to a value from 2–5 to create multiple sandbox clones from the same source in a single request. The source sandbox is backed up once, and the backup is used to create each target sandbox in parallel. This approach reduces source downtime compared to submitting separate one-to-one clone requests.
To create multiple clones, add targetCount to the request body.
1{2 "kind": "Status",3 "code": 400,4 "status": "Failure",5 "error": {6 "status": "Failure",7 "message": "targetCount must be between 1 and 5. Requested: {n}",8 "reason": "IllegalArgument"9 }10}
Monitor Sandbox Clone Operations
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.
For a target that’s part of a one-to-many batch, the response also includes batchId and siblingCloneIds. Each target has its own cloneId and its own independent status, so poll each cloneId from siblingCloneIds separately. One target completing, failing, or still running has no effect on the reported status of the others.
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
batchId
string
Shared batch identifier for clones created together via one-to-many cloning. Absent for a single (one-to-one) clone.
siblingCloneIds
array of string
cloneIds of all clones in the same batch, in target order (includes this clone). Absent for a single (one-to-one) clone.
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
1{2 "kind": "Status",3 "code": 403,4 "status": "Failure",5 "error": {6 "status": "Failure",7 "message": "User doesn't have access to this realm",8 "reason": "AccessDenied"9 }10}
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
In a one-to-many clone, these steps apply per target. Repeat them for each resulting sandbox.
Note
Best Practices
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 initial backup phase of the clone process, the source sandbox is stopped. Make sure to save any open work before triggering the clone operation.
Monitor Clone Progress
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. For a one-to-many clone, poll each target’s cloneId independently. Don’t assume all targets finish at the same time or that one target’s failure affects the others.
Set Time-to-Live Values
Configure the ttl parameter to automatically clean up temporary clones and avoid consuming unnecessary credits.
Resume Work on the Source Early
The source sandbox becomes available again shortly after the clone starts, once the backup stage completes. You don’t need to wait for the full clone to finish before resuming work on the source. You still can’t trigger a new clone on that same source until the current one completes, even though the source itself is available again.
Plan Multi-Target Requests
When cloning to multiple targets, the source is stopped once, for the duration of the single shared backup step, not once per target. The targetProfile, emails, and ttl values apply to the entire batch. If different targets need different settings, submit separate clone requests, or clone with shared settings and adjust individual targets afterward using the Sandbox Update API (PATCH /sandboxes/{sandboxId}).
Sandbox Cloning FAQ
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’s placed in a Stopped state during the initial backup phase to protect data integrity. After the backup completes, the source becomes available again, although you can’t start another clone from it until the current clone finishes.
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 aren’t updated automatically.
Q. Can a clone operation be paused or resumed? A. No. Once started, a clone operation can’t 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 don’t explicitly provide the emails attribute, the cloned sandbox won’t inherit or copy the email settings from the source sandbox by default.
Q. Can I clone a sandbox to more than one target at once? A. Yes. Set targetCount to a value from 1–5 in your clone request. The source is backed up once and restored to all targets concurrently.
Q. Is there a limit on how many targets I can clone to at once? A. Yes. targetCount accepts values from 1–5.
Q. If one target fails in a one-to-many clone, do the others fail too? A. No. Each target is tracked and processed independently. A failure on one target has no effect on the others. Check each target’s cloneId status individually.
Q. Can I set a different profile, TTL, or notification email list for each target in a one-to-many clone? A. No. targetProfile, ttl, and emails apply to the whole request, not per target. Submit separate clone requests if targets need different settings, or use the Sandbox Update API to adjust individual targets afterward.
Q. If my source sandbox becomes available again early, can I start another clone on it right away? A. No. Although the source sandbox becomes available shortly after the backup stage completes, you can’t trigger a new clone on that same source until the current clone operation finishes (Completed or Failed). The early availability lets you resume other work on the source sooner. It doesn’t open a new clone slot.