Clicking Create on the New Sandbox screen kicks off a multi-step server-side process. You don’t see most of it — you watch a Status: Pending row and eventually get an email saying “ready”. Here’s what’s happening on Salesforce’s side.
The lifecycle, step by step
1. Request queued
Your request lands in Salesforce’s sandbox-creation queue. The status flips to Pending. How long you wait depends on:
- The type (Developer < Developer Pro < Partial Copy < Full).
- The size of your production org (more data = longer Full refresh).
- Current load on the sandbox queue.
2. Sandbox provisioning
Salesforce allocates new infrastructure for your sandbox — its own database tables (logically partitioned), its own URL slot under *.sandbox.my.salesforce.com. Status moves through Processing.
3. Metadata copy
The first real work: every piece of metadata in production is copied. Objects, fields, Apex classes, triggers, flows, layouts, profiles, permission sets, validation rules, reports, dashboards, custom settings, custom metadata, the whole lot. Same for all sandbox types — every type copies metadata.
4. Data copy (Partial Copy and Full only)
- Partial Copy: the sandbox template drives the copy. Salesforce reads which objects are listed, takes up to 10,000 records per object (or 100 MB per object, whichever is smaller), preserving referential integrity where possible.
- Full: everything. All records, all field history, all chatter feeds, all attachments, all reports & dashboards including history.
Developer and Developer Pro sandboxes skip this step entirely — they’re metadata only.
5. User copy
All production users are copied as users in the sandbox, but with .sandboxname appended to their usernames ([email protected] becomes [email protected]). Email addresses are sometimes invalidated; passwords may be randomised.
6. Post-copy adjustments by Salesforce
The platform automatically:
- Suppresses outbound email — Deliverability is set to No access by default. This is the safety net that stops a refreshed sandbox from emailing real customers.
- Deactivates scheduled jobs that have non-running targets (sometimes — depends on the version).
- Resets API tokens and OAuth grants that depend on org Id.
- Re-points the My Domain — Setup → My Domain shows the sandbox-specific subdomain.
7. SandboxPostCopy Apex
If you specified an Apex class implementing SandboxPostCopy on the New Sandbox form, Salesforce runs it now. The class typically:
- Updates user email addresses so tests don’t email real customers.
- Re-points named credentials to non-prod endpoints.
- Activates / deactivates feature flags.
- Loads test data.
- Resets a known set of integration-user passwords.
A minimal post-copy class:
global class SandboxRefreshHandler implements SandboxPostCopy {
global void runApexClass(SandboxContext context) {
// Mask user emails so we don't blast real customers
List<User> users = [SELECT Id, Email FROM User WHERE IsActive = true];
for (User u : users) {
u.Email = u.Email.replace('@', '=') + '@example.invalid';
}
update users;
}
}
8. Email notification
When everything finishes, Salesforce emails the user who created the sandbox. The email contains:
- A login link (the sandbox URL).
- The sandbox name.
- The status (Completed).
9. The first login
You go to test.salesforce.com (or the My Domain URL acme--uat.sandbox.my.salesforce.com) and log in with your-prod-username.sandboxname. You’re in.
What’s not automatic
- Email deliverability stays off — turn it on yourself if testers need to receive mail.
- Integration endpoints may still point at production unless your SandboxPostCopy fixed them.
- OAuth connected apps may need re-authorising.
- Schedule jobs may need re-creating.
- Files / attachments referenced by external links are unchanged.
Interview-friendly summary
Three lines will do: “Production metadata is copied to a new org under test.salesforce.com. For Partial Copy or Full, data is also copied. Salesforce runs your SandboxPostCopy Apex if you provided one, then emails you a login link. Outbound email is suppressed by default for safety.”
Verified against: Salesforce Help — Sandbox Post-Copy Apex, Apex Developer Guide — SandboxPostCopy, Metadata API Developer Guide. Last reviewed 2026-05-17 for Spring ‘26 release.