Sub topic 9
Creating a Sandbox from Setup
This chapter walks through creating a sandbox in the Salesforce Setup UI. It assumes you know the four sandbox types, their storage limits, and what a sandbox template does. It also assumes you have the "Manage Sandboxes" permission (or are a System Administrator) in the source org.
What you need before you start
A sandbox is a copy of an org. Creating one from production copies metadata, and for some types it also copies data. Check these items first:
- Your org has an unused license for the sandbox type you want. Setup shows the licenses you have and how many are in use.
- You know the purpose of the sandbox, so you can pick the right type.
- For a Partial Copy sandbox, a sandbox template exists. A Full sandbox can use a template too, but it does not need one.
- You have chosen a short name. Names can have up to 10 characters, and the name becomes part of every username in the sandbox.
Steps in Setup
- In Setup, enter Sandboxes in Quick Find and select Sandboxes.
- Click New Sandbox.
- Enter a Name, for example
dev1, and a Description that says who uses it and why. - Choose a Sandbox type. Only types with an available license are enabled.
- For a Partial Copy sandbox, select a sandbox template. For a Full sandbox, choose how much data to copy, including how much field tracking history and how many days of Chatter data.
- For Full and Partial Copy sandboxes, you can also choose an Apex class that runs after creation. This is the
SandboxPostCopyclass covered in a later chapter. - Select the source. Choose Production (the default), or select an existing sandbox to clone it.
- Click Create.
What happens next
Salesforce queues the request and builds the copy in the background. The sandbox shows a status of Pending, then Processing, and finally Completed. Small Developer sandboxes can finish in minutes. Full sandboxes can take hours or days, depending on how much data is copied.
When the copy finishes, Salesforce emails you. The sandbox stays unusable until the status reads Completed.
Logging in
Usernames in a sandbox are the production username with the sandbox name appended. If the production username is [email protected] and the sandbox is dev1, the sandbox username is [email protected].
Log in at https://test.salesforce.com with that username and your production password. You can also click Login next to the sandbox in the Sandboxes list.
Common errors
- The type is greyed out. All licenses of that type are in use. Delete an unused sandbox of that type, or buy more licenses.
- The name is rejected. The name must be alphanumeric, start with a letter, and be unique in the org.
- The Apex class is missing from the list. The class is not in production, or it does not implement
SandboxPostCopy. - Login fails with the production username. Add the
.sandboxnamesuffix.
Exercise
Your production username is [email protected], and you created a sandbox named qa2. What username do you use to log in to the sandbox, and where do you log in?
Show answer
Use [email protected] with your production password, at https://test.salesforce.com (or use the Login link in the Sandboxes list in Setup).