Salesforce allows you to create multiple copies of your production organization in separate environments for different purposes, like testing, development and training, without affecting data and applications of production instance. These copies are called Sandboxes.
Sandboxes are similar to Production instance but isolated from real Production environment. So, the changes you make in Sandbox will not be affect the production instance, and vice versa.
Salesforce provides four types of Sandboxes:
- Developer Sandbox
- Developer Pro Sandbox
- Partial Copy Sandbox
- Full Copy Sandbox
- A developer sandbox contains a copy of production’s metadata.
- Using Developer Sandbox, you can create configuration data, like workflow, approval process, reports, dashboards and code. Also, you can use it as a testing environment.
- It does not copy the data from Production.
- There is a maximum of 200 MB data that can be created.
- A developer sandbox can be refreshed once per day.
Developer Pro Sandbox
- Developer pro sandbox mainly used for development and testing purposes, like the Developer Sandbox.
- However, it has larger storage than the Developer Sandboxes. So, it allows for more robust test data sets, and enables this environment to handle more development and quality assurance activities.
- Developer Pro sandboxes have a 1 GB storage limit and it can be refreshed once per day.
Partial Copy Sandbox
- Partial Copy Sandboxes are mainly used for quality assurance purposes, such as user acceptance testing, integration testing and training.
- This sandbox contains the copy of production organization’s metadata and data which is defined by a sandbox template.
- Storage limit is 5 GB and it can be refreshed once in 5 days.
Full Copy Sandbox
- This sandbox is a replica of Production instance, including all data, like object records and attachments.
- Full Copy Sandboxes are used for testing purpose.
- It supports all performance testing and load testing.
- Storage limit is same as Production instance.
Creating a Sandbox
- Follow the below steps for creating a new sandbox.
- Click Setup -> Data Management -> Sandboxes
- Click -> New Sandbox
5) Select the type of sandbox you want.
6) Select the data which you want to push into your sandbox (This option is only available for a Partial Copy or Full sandbox).
7) Click -> Create.
Please read here to understand more about the types of Salesforce Sandbox environments: Understanding Types Salesforce Sandbox Environments
Now the sandbox has been created successfully.
Refreshing a Sandbox
- You can refresh an existing sandbox to update it with the latest data from your production organization.
- Click -> Refresh link available next to the Sandbox name
- Select the data you want to copy ( This option is available only, if you are refreshing the Full or Partial Copy Sandboxes)
- Click -> Refresh. Now, Salesforce starts to copy the metadata changes and data from Production to the selected Sandbox instance.
Creating or Editing Sandbox Templates
Sandbox template controls what objects/data are moved from production to sandbox. When creating / refreshing a full or partial copy sandbox, you should select the objects/data to copy to the sandbox.
Follow the below steps to create a Sandbox Template:
- Click -> Setup -> Data Management -> Sandboxes
- Click -> Sandbox Templates tab
- Click -> New Sandbox Template
5) Select the checkbox for each object you want to move data
The Sandbox Template has been created successfully. To learn more about creating or editing Sandbox Templates, please visit here: [Creating or Editing Salesforce Sandbox Templates |https://help.salesforce.com/HTViewHelpDoc?id=data_sandbox_templates.htm&language=en_US]
It is a best practice to use Sandbox environment for all the development as well as testing activities, since the Sandbox creation will not affect any original Production data. So, once the development and testing are complete in sandbox, we can deploy the changes to production.