Sub topic 7
Choosing Preview and Non-Preview Sandboxes
This chapter assumes you know the difference between sandboxes and production, can find Setup, and understand the release timeline from the previous chapters. You will learn how to decide which sandboxes upgrade early and which stay on the current release, and how to check where each one sits.
What preview means for a sandbox
Before each seasonal release, Salesforce upgrades some sandboxes to the new release while production stays on the current one. A sandbox on the new release is a preview sandbox. A sandbox that stays on the current release is a non-preview sandbox. Non-preview sandboxes upgrade after the preview window closes, shortly before production.
Which group a sandbox lands in depends on its instance. Sandboxes sit on the same instance as their production org, unless you refresh them during the preview window. In that case, the refresh decides the group, as described below.
The gap between a preview sandbox and production is useful. It lets you run your tests on the new release while you can still react. It is also a hazard. Metadata built in a preview sandbox may not deploy to production until production upgrades.
Which sandboxes should preview
Use the purpose of each sandbox to decide.
| Sandbox purpose | Recommended group | Reason |
|---|---|---|
| Regression testing or UAT | Preview | Finds release problems before production upgrades |
| Dedicated release-readiness sandbox | Preview | Gives you one stable place to test the new release |
| Hotfix or production-support development | Non-preview | Must match production so fixes can deploy |
| Active development feeding a production deployment | Non-preview | Avoids deployment mismatches |
| Training | Either | Choose preview to rehearse new features |
A common pattern is to keep one full or partial copy sandbox on preview for regression tests. Developers keep working in non-preview sandboxes that match production.
Checking and controlling the group
Salesforce publishes a sandbox preview guidance page each release. It lists the dates and what to do for each sandbox type. Follow these steps to confirm where a sandbox sits.
- Find the sandbox's instance in Setup under Sandboxes.
- Compare that instance with the preview schedule on Salesforce Trust, covered in a later chapter.
- Open the sandbox and check the release number shown on the Salesforce login or in the Help menu for the org.
You can steer a sandbox into a group by when you create or refresh it:
- Before the preview cutoff date, a refresh keeps it in its normal group.
- During the cutoff window, you can choose the preview or non-preview version for the refreshed sandbox.
- After the cutoff, a refresh lands on whatever release is current for that instance.
Check the guidance page each release, because the exact dates and choices change.
Worked example
A team has four sandboxes: dev1, dev2, uat, and hotfix. Production hosts a quarterly integration with an external billing system.
- They keep
dev1,dev2, andhotfixas non-preview so any change deploys cleanly. - They put
uaton preview, since it is a partial copy with realistic data. - During the preview window, they run local Apex tests against
uat.
sf apex run test \
--target-org uat \
--test-level RunLocalTests \
--result-format human \
--wait 20- They run key user journeys by hand: lead conversion, quote creation, and the billing integration.
- They log any failures and check them against the release notes before production upgrades.
The diagram shows the flow of the decision.
Common mistakes
- Putting every sandbox on preview, which blocks deployments to production.
- Putting none on preview, which leaves no early test environment.
- Refreshing the only test sandbox after the cutoff and losing the preview.
- Forgetting that refreshing resets data and metadata, so you must redeploy your test setup.
Exercise
Your team has a hotfix sandbox and a UAT sandbox. Which should be on preview, and why?
Show answer
Put the UAT sandbox on preview so regression and user acceptance tests run on the new release early. Keep the hotfix sandbox non-preview so its changes match production and deploy cleanly.