Sub topic 2
Sandbox types: Developer, Developer Pro, Partial Copy, and Full
This chapter assumes you know the difference between production and non-production orgs, can deploy metadata between orgs, and can use a command line. It covers the four sandbox types, what each one copies, how big each one is, and how often it can be refreshed. Later chapters cover the refresh process and the choice between sandboxes and scratch orgs.
What a sandbox is
A sandbox is a copy of a production org that you use for development, testing, or training. Changes you make in a sandbox do not affect production. Every sandbox copies the production org's metadata, which includes objects, fields, Apex classes, flows, and settings. The four types differ in how much data they copy, how much storage they have, and how soon you can refresh them.
All sandbox types have these properties:
- They are created from a production org (or from another sandbox, as a clone).
- They keep the configuration of the source at the moment of the copy.
- They do not stay in sync afterward. Changes in production do not flow into the sandbox until you refresh it.
- They have their own URL and their own users. Usernames get the sandbox name appended, for example
[email protected].
The four types at a glance
| Type | Data copied | Data storage | File storage | Refresh interval |
|---|---|---|---|---|
| Developer | Metadata only | 200 MB | 200 MB | 1 day |
| Developer Pro | Metadata only | 1 GB | 1 GB | 1 day |
| Partial Copy | Metadata plus a sample of data | 5 GB | Same as production | 5 days |
| Full | Metadata plus all data | Same as production | Same as production | 29 days |
These figures are the documented defaults at the time of writing. The number of each type you can have depends on your Salesforce edition and on any sandboxes you purchased. Check Setup, under Sandboxes, for your own allowances and limits before you plan around them.
Developer sandbox
A Developer sandbox copies metadata only. It starts with no business records. It has 200 MB of data storage and 200 MB of file storage, and you can refresh it once per day.
Use it for:
- Building and unit testing a single feature.
- Isolating one developer's work from the rest of the team.
- Short-lived experiments that you can throw away.
The small storage limit is the main constraint. You can seed test records with a script or a data load, but a large seed set will not fit. If you hit the data storage limit, inserts fail with a storage error, and your tests may fail for a reason unrelated to your code.
Developer Pro sandbox
A Developer Pro sandbox is a Developer sandbox with more room: 1 GB of data storage and 1 GB of file storage. It still copies metadata only, and it refreshes once per day.
Use it when a Developer sandbox is too small. Typical cases are:
- Testing integrations that load a few hundred thousand records.
- Running quality assurance (QA) on a feature with realistic file attachments.
- Hosting a shared development or QA environment for a small team.
The extra space costs more in license terms, so teams usually keep a few Developer Pro sandboxes for shared use and many Developer sandboxes for individuals.
Partial Copy sandbox
A Partial Copy sandbox copies metadata plus a sample of production data. It has 5 GB of data storage, the same file storage as production, and a 5-day refresh interval.
You choose which data to copy with a sandbox template. A template lists the objects to include. For each selected object, Salesforce copies up to 10,000 records, along with the related records needed to keep the sample usable. Without a template, a Partial Copy sandbox cannot be created, so create the template first in Setup.
Use it for:
- User acceptance testing (UAT) where testers need recognizable records.
- Integration testing against a realistic but smaller data set.
- Training with data that looks like production.
Be aware that a sample is not a statistically faithful slice. Relationships can be incomplete, and record counts do not match production, so results from performance tests here do not predict production behavior.
Full sandbox
A Full sandbox is a replica of production: all metadata, and all records, with the same storage limits as production. You can refresh it only once every 29 days. You can also choose whether to include field history and Chatter data, and you can use a template to copy a subset of objects.
Use it for:
- Performance and load testing with production-scale data.
- Staging, which is the final rehearsal of a release before it reaches production.
- Reproducing a production data issue that depends on exact record values.
Creating or refreshing a Full sandbox can take hours or days for large orgs. Plan the time into your release calendar.
Creating a sandbox from the CLI
You can create a sandbox in Setup or with the Salesforce CLI. The CLI route needs a definition file. This file requests a Developer sandbox named dev1.
{
"sandboxName": "dev1",
"licenseType": "Developer"
}The licenseType property accepts Developer, Developer_Pro, Partial, and Full. The sandbox name can be at most 10 alphanumeric characters. This command creates the sandbox by using an authorized production org (aliased prod) as the source:
sf org create sandbox --definition-file config/dev-sandbox-def.json --alias dev1 --target-org prodThe command waits for the copy to finish, and the wait can be long. If the wait time runs out, the sandbox is still being created. You can check on it later with sf org resume sandbox. Once it completes, the CLI authorizes the new sandbox under the alias you gave, so you can deploy to it with --target-org dev1.
To request a Partial Copy sandbox, add "licenseType": "Partial" and name the template in the definition file with the templateId property. A Full sandbox uses "licenseType": "Full".
How data behaves in each type
The data row in the table hides several details that cause surprises:
- A Developer or Developer Pro sandbox has no records at all after creation, apart from a few system records. Tests that assume existing data will fail there.
- A Partial Copy sandbox has data only for the objects in the template. If your feature depends on an object you left out, the records will be missing.
- A Full sandbox has real customer data, including emails and phone numbers. Treat it with the same care as production.
- Email deliverability is set to system email only in a new sandbox. Messages to real customers are not sent, which protects them. Change this setting only when you have a reason and a safe list of recipients.
Refresh behavior
A refresh replaces the sandbox with a new copy of its source. The sandbox keeps its name and its URL, but everything you changed is lost, including metadata, data, and any settings you did not save elsewhere. This is why teams treat sandbox work as temporary until it is committed to version control.
The refresh interval is a minimum wait. For example, once you refresh a Full sandbox, you must wait 29 days before refreshing it again. If a bad refresh or a failed post-copy script occurs near the start of that window, you may be stuck with it. Test your refresh routine on a Developer sandbox first.
Choosing between them
A short rule of thumb is to use the smallest type that meets the need.
- Start with a Developer sandbox. It is cheap and refreshes daily.
- Move to Developer Pro when storage is the limit, not data realism.
- Move to Partial Copy when testers need realistic records.
- Use Full only when you need production-scale data or an exact copy for staging.
The next chapters build on this with the refresh process, scratch orgs, and a full decision framework.
Common errors
- Expecting data in a Developer sandbox. It starts empty. Seed test data with a script, or use a Partial Copy sandbox.
- Creating a Partial Copy sandbox without a template. Create the template first in Setup, then reference it.
- Forgetting that refresh erases work. Commit changes to version control before you refresh.
- Using a Partial Copy sandbox for load testing. The sample is too small to show production performance. Use a Full sandbox.
- Exceeding the storage limit. Large data loads fail in a Developer sandbox. Reduce the data set or use a larger type.
Exercise
Your team needs to rehearse a release with production-sized data, and a tester also needs a small sandbox to try a new flow with a few hundred account records. Which sandbox type would you use for each, and what is the shortest wait before you can refresh each one again?
Show answer
Use a Full sandbox for the release rehearsal, because only it holds production-scale data. Its refresh interval is 29 days. For the flow test, use a Developer sandbox, or a Developer Pro sandbox if the few hundred accounts come with large files. A Developer sandbox refreshes after 1 day. Seed the accounts with a data load, because a Developer sandbox starts with no records. If the tester needs production-like records already in place, use a Partial Copy sandbox with a template that includes Account, which refreshes after 5 days.
Exercise
Write a sandbox definition file for a Developer Pro sandbox named qa1, and the command that creates it from a production org with the alias prod.
Show answer
The file contains {"sandboxName": "qa1", "licenseType": "Developer_Pro"}. Save it as config/qa-sandbox-def.json. Run: sf org create sandbox --definition-file config/qa-sandbox-def.json --alias qa1 --target-org prod