Sub topic 10
Cloning a sandbox from another sandbox
This chapter assumes you can create a sandbox from Setup and know the four sandbox types and their storage limits. It covers creating a sandbox from an existing sandbox instead of from production.
What a clone is
A sandbox normally copies its metadata, and sometimes data, from production. A clone uses another sandbox as the source. The new sandbox gets the source sandbox's metadata and data as they exist at the moment of cloning. Changes you have not yet deployed to production come along with it.
That makes cloning useful when:
- A team has built a configured environment, such as test data and in-progress features, that you want to duplicate for a second team.
- You want a QA sandbox that matches a development sandbox without redeploying everything.
- You want to branch a stable state before a risky experiment.
How cloning relates to production
The diagram shows the two sources side by side.
Sandbox B is independent of A once it is created. Later changes in A do not appear in B unless you refresh B or deploy them.
Create a clone
- In Setup, enter Sandboxes in Quick Find and select Sandboxes.
- Click New Sandbox.
- Enter a name and description, then select the sandbox type.
- Under the source option, choose the existing sandbox to clone instead of Production.
- Complete the remaining options and click Create.
The name cannot be longer than 10 characters. Like any sandbox, the clone is created in the background. Salesforce emails you when it is ready.
Limits that still apply
- License allotment. The clone uses one sandbox of the type you select, so you need an unused sandbox of that type.
- Storage. The clone's data must fit within the storage limit of its own type. A source with more data than the target type allows is a problem. Pick a type with enough storage, or reduce the source data first.
- Source stays available. The source sandbox keeps working, but treat it as read-only while the clone is being created so the copy is consistent.
- Production changes are not included. A clone only reflects production as of the source sandbox's last refresh. A stale source gives you a stale clone.
Common errors
- Cloning a stale sandbox. If the source was refreshed months ago, the clone lacks recent production changes. Refresh the source first if you need current configuration.
- Forgetting post-copy setup. A clone is a new sandbox, so usernames are changed, email deliverability is reduced, and integration settings need review. If you use a
SandboxPostCopyclass, check that it also behaves correctly for a clone. - Choosing too small a type. A Developer sandbox cannot hold a large data set copied from a Full sandbox.
Exercise
Your Full sandbox "QA" has the data and configuration you want for a training environment. Why might you clone QA instead of creating a new sandbox from production, and what must you check about the new sandbox's type?
Show answer
Cloning copies QA's current metadata and data, including undeployed changes and prepared test data, which a new sandbox from production would not have. You must check that the clone's type has an available license and enough storage for the data being copied, since the clone is limited by its own type's storage limit.