Scratch Org Snapshots
Configuring a scratch org with a project’s dependencies can be a manual and time-consuming process. It can require deploying dependent metadata to it, seeding it with sample data, installing one or more packages, and then performing manual tasks directly in the scratch org. And then, poof, the scratch org expires, and you have to start all over again. With scratch org snapshots, you can quickly replicate scratch orgs with the required project dependencies.
How Snapshots Fit in the Development Lifecycle
Because a snapshot is a point-in-time copy of your scratch org, it’s static. To update your snapshot, delete it and create another snapshot.
You can create a snapshot from only a scratch org and, conversely, you can create only scratch orgs from a snapshot. Snapshots have the same 200-MB data storage limit as scratch orgs. A snapshot isn’t meant to replace source-driven development or a version control system. You continue to follow best development practices by externalizing and modularizing your project source.
Snapshots and scratch orgs don’t replace sandboxes for user acceptance testing. A snapshot is intended to contain the static dependencies of a project, and not the entire happy soup of your production org.
Snapshot Allocations and Limits
Snapshots are associated with a Dev Hub org. Therefore, you must use the same Dev Hub org when you create the scratch org from the snapshot.
- The number of snapshots you can create is the same as the active scratch org allocation based on edition type.
- Snapshots expire after 90 days. When a snapshot expires or is deleted, its status is updated automatically and its license becomes immediately available.
- Snapshot data is retained for 100 days. When a snapshot expires, it’s associated data is deleted 10 days later. If a snapshot is deleted, its associated data is deleted 100 days after its creation date.
Edition | Snapshot Allocations (Active and Daily) |
---|---|
Developer Edition | 3 |
Enterprise Edition | 40 |
Unlimited Edition | 100 |
Performance Edition | 100 |
To view your snapshot usage with Salesforce CLI, run:
sf org list limits -o <Dev Hub username or alias>
Look for these values in the output:
Name Remaining Max
───────────────────── ───────── ─────────
ActiveOrgSnapshots 38 40
DailyOrgSnapshots 35 40
Unsupported Features
These features aren’t copied to the snapshot because they risk exposing sensitive data or authentication secrets.
- Connected apps
- External credentials
- Named credentials