Sub topic 6
Storage limits and refresh intervals
This chapter covers two limits that decide which sandbox type fits a job: how much data and file storage a sandbox gets, and how soon you can refresh it. It assumes you know the four sandbox types by name, that metadata means configuration and code, and that data means records. It also assumes you can open Setup in a Salesforce org.
Two limits, two different questions
A sandbox type has two limits that people often mix up.
- Storage limits cap how much a sandbox can hold. Salesforce tracks data storage (records) and file storage (files, attachments, Salesforce Files) separately.
- Refresh interval is the minimum wait before you can replace a sandbox with a fresh copy of its source org.
The storage limit answers "will my data fit?". The refresh interval answers "how often can I reset this environment?". A type that is good on one question is often poor on the other. For example, a Full sandbox holds everything but can be refreshed only about once a month.
The limits by sandbox type
| Sandbox type | What is 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 |
Salesforce has changed these figures over the years, and some editions differ. Treat the table as a planning guide. Check the sandbox limits in the current Salesforce Help for your edition before you commit to a design.
How storage limits behave
Data storage and record size
Data storage counts records. Most standard and custom records count as roughly 2 KB each, regardless of how many fields are filled in. Some record types, such as Campaign Member and Email Message, count differently.
A Developer sandbox with 200 MB therefore holds about 100,000 records. That is enough for configuration work and small test sets. It is not enough to load a realistic copy of a large org.
File storage
File storage is counted separately from data storage. Filling one does not use up the other. Developer and Developer Pro sandboxes copy metadata only, so they start with no files. Files appear only if you create or load them. Partial Copy and Full sandboxes can copy files from production, so file storage matters at creation time.
What happens at the limit
A sandbox that reaches its data storage limit cannot create more records. Inserts fail with a storage-limit error until you delete records or the sandbox is refreshed. You cannot raise the limit by editing the sandbox. The limit comes from the sandbox type, and for Full sandboxes it matches the production org's storage allocation.
Storage is also checked at copy time. A Partial Copy sandbox is limited to 5 GB of data. The sandbox template you attach controls which objects are sampled, and Salesforce takes up to 10,000 records per selected object. A template that selects many large objects can still push the copy up to the cap. A Full sandbox needs a source org whose data fits the allocation you purchased.
Checking storage in a sandbox
In Setup, search for Storage Usage to see data and file storage consumed in the current org. From the command line, the Salesforce CLI can read the same numbers from the org limits API.
sf limits api display --target-org dev1 --jsonLook for the DataStorageMB and FileStorageMB entries in the output. Each shows a Max and a Remaining value in megabytes. Run the command against production and again against the sandbox to compare the two environments.
How refresh intervals behave
The interval is a cooldown. After you create or refresh a sandbox, you cannot refresh it again until the interval has passed. The sandbox list in Setup shows the next available refresh date. Until that date, the Refresh option is not available for that sandbox.
Four details catch people out.
- The clock runs from the last refresh or creation, not from your last use. A Full sandbox you have not touched for months can be refreshed immediately. One you refreshed two weeks ago cannot.
- The interval belongs to the sandbox, not the org. Each sandbox has its own clock, so refreshing one does not block others.
- A scheduled interval is a minimum. The copy itself takes time. Developer sandboxes usually finish in minutes to hours. Full sandboxes can take many hours or longer, depending on data volume and Salesforce load.
- Deleting and recreating can reset the situation. If you delete a sandbox, its name becomes available again, and a new sandbox starts its own clock. This is a reasonable workaround for a Developer sandbox you need back sooner. For a Full sandbox it is a poor trade, because you lose the sandbox and its data and still wait for the copy to finish.
Why the limits are shaped this way
The limits follow cost. Copying metadata is cheap and quick, so Developer sandboxes can be refreshed daily. Copying data is expensive, and the cost grows with volume. Partial Copy is limited to a sample, so it refreshes every 5 days. A Full copy moves everything, so Salesforce restricts it to once every 29 days.
This gives you a simple rule. The more production-like the data, the less often you can reset it, and the more carefully you must plan each refresh.
Common mistakes
- Planning a weekly Full refresh. The 29-day interval makes this impossible. If the team needs weekly resets, use Partial Copy with a template, or Developer Pro with loaded test data.
- Expecting Developer sandboxes to contain production data. They copy metadata only. Any records you need must be loaded after creation, and they must fit in 200 MB.
- Ignoring file storage. A Partial Copy sandbox can reach its file allocation even when data storage looks fine, so check both.
- Leaving the refresh until a deadline. If your last Full refresh was 20 days ago and testing starts in 5 days, you cannot refresh in time. Put the next-eligible date on your release calendar.
Summary of the decision logic
- If you need to reset daily and can work with small data, use Developer or Developer Pro. Pick Developer Pro when 200 MB is too small.
- If you need production-like sample data and can wait 5 days between resets, use Partial Copy with a template.
- If you need all production data and can wait 29 days between resets, use Full.
Exercise
A team refreshed its Full sandbox 10 days ago. They want to start performance testing against production-sized data in 7 days. Can they refresh the Full sandbox first? What other facts would you check?
Show answer
No. The Full sandbox interval is 29 days from the last refresh, and only 10 days have passed, so the refresh option is not available. Check the next-eligible date in the Sandboxes list in Setup. Then check whether the existing sandbox data is recent enough for the test. If it is not, consider deleting and recreating the sandbox, but only after confirming that the new copy can finish before testing starts and that nothing unsaved is lost.
Exercise
A Developer sandbox has 200 MB of data storage. Roughly how many typical records can it hold, and what happens when you reach the limit?
Show answer
Most records count as about 2 KB, so 200 MB holds roughly 100,000 records. At the limit, inserts that create more records fail with a storage-limit error. You must delete records or refresh the sandbox. You cannot raise the limit for that sandbox type.