
Serpent Team

Andrew Hanna

A sandbox refresh runbook your team will follow is short, lives next to your code, and gives every step an owner, a time estimate and a check that proves it is done. Most refresh docs fail because they are long wiki pages nobody owns. Write yours as a four-phase checklist, automate the steps people skip, and rehearse it once before you rely on it.
A sandbox refresh runbook is the step-by-step procedure your team runs every time a Salesforce sandbox is refreshed from production: what to save before, what to restore after, who does each step and how you know it worked. It is not your sandbox strategy, which decides which sandboxes exist and why. The runbook is the part people execute on refresh morning.
Salesforce caps your cadence, so put the limits at the top of the runbook. According to Salesforce Ben's sandbox guide:
A botched Full refresh can cost you a month, so that runbook deserves the most rigor.
Write every step in the same format:
step | owner | automated? | minutes | done when. Then group the steps
into four phases.
.invalid suffix only for users who need sandbox email.
Salesforce appends it to user email addresses on every refresh or clone, as its
help article
explains.
Automate the steps that are frequent, error-prone and boring. Salesforce's
SandboxPostCopy interface lets you write an Apex class that runs
automatically when the sandbox is created, and
Salto's refresh best practices
list masking email addresses and updating custom settings and custom metadata as
typical uses. Good first candidates:
Keep the class idempotent and log what it changed, so a failed run can be repeated safely.
A refresh resets a sandbox to production, so anything between that sandbox and production disappears unless your pipeline puts it back. Two habits stop the loss. First, treat Git as the source of truth, so work in progress is redeployed, not rebuilt. Second, set up back-promotion in your Salesforce DevOps pipeline so production hotfixes flow down to lower environments between refreshes. After the refresh, run the same checks you run on every pull request. Our guide to Salesforce test automation in CI splits what to run per pull request from what to run nightly.
If redeploying after every refresh is still a manual afternoon, a DevOps platform takes most of it off your plate. Serpent's free Essentials plan includes delta deployments and one-click rollback; compare plans on Serpent pricing.
For more practical guides like this one, browse the SF Guides library.
How long should a sandbox refresh runbook be?
Short enough to fit one screen per phase. Keep the runbook as the checklist and put the detail in linked docs.
What is SandboxPostCopy used for?
It is an Apex interface for a class that runs automatically when a sandbox is created, typically to mask data and reset settings.
Why do user emails end in .invalid after a refresh?
Salesforce appends .invalid so production users do not get email from the sandbox. Remove it only for users who need sandbox email.
How often can you refresh a Full sandbox?
Once every 29 days. Partial Copy sandboxes can be refreshed every five days and Developer sandboxes daily.
Commitment free!