What Is a Salesforce Sandbox? [Updated 2022]

Share this article...

A Salesforce Sandbox environment enables you to test new configuration, code, and automation outside of your production (live) instance – it’s like a replica of your production instance with some or all of your metadata and data depending on your sandbox type (which we’ll explore shortly!).

This article includes everything you need to know about sandboxes, including the different types and how to use them – we’ll be taking a look at sandboxes in a Salesforce context.

Key Terms

These key terms will help your overall understanding of Salesforce Sandboxes.

  • Metadata is your Salesforce configuration data such as Fields, Layouts, Profiles, and Automations.
  • Data Storage relates to how much space there is for Salesforce records.
  • File Storage defines how many files (e.g. documents, images, etc.) can be stored.
  • A Sandbox Type relates to the different sandbox options which have different Data Storage and Refresh Intervals.
  • Refresh Interval defines how often you can update a sandbox from production.
  • A Sandbox Template defines what Salesforce records are copied into the new sandbox.

What Is a Salesforce Sandbox?

A Salesforce Sandbox is a test environment that provides a way to copy and create metadata from your production instance – it is a separate environment where you can test with data (Salesforce records) including Accounts, Contacts, and Leads.

It is considered best practice to configure and test in a sandbox prior to making any live changes; this ensures that any development doesn’t disrupt your live environment and isn’t rolled out before it’s been thoroughly tested.

The data that is available to you is dependent on the sandbox type. There are multiple different types and each has different considerations. Some sandbox types support, or require, a sandbox template.

Sandbox Types

There are four types of sandbox, each with its own set of characteristics that make it fit for a specific purpose. Each sandbox type has a few different variables to consider:

  • How often you can refresh a sandbox to mirror your production instance.
  • How much information you can store across data storage and file storage.
  • Whether just metadata or data is copied over.
  • Which Salesforce editions include which sandbox types.

1. Developer Sandbox

The most basic type of testing environment is the Developer Sandbox. These are included with most Salesforce licenses and allow you to create a testing environment with a copy of your metadata from production.

Developer Sandboxes can be refreshed once per day, and have a data and file storage limit of 200MB each.

2. Developer Pro Sandbox

Developer Pro Sandboxes are very similar to standard developer environments but have slightly higher storage limits. They provide you with 1GB for both data storage and file storage, and the refresh limit is one day.

Developer Pro Sandboxes are only included with Unlimited and Performance editions of Salesforce, but can be purchased separately.

3. Partial Copy Sandbox

This is the first type of sandbox that allows you to not only copy metadata, but also a portion of your data. As the name suggests, you can select a sample set of data using a sandbox template.

This sandbox is very helpful if you wish to test new functionality on live data, or if you wish to train users using live data in a test environment.

Partial Copy Sandboxes are included with Enterprise, Unlimited, and Performance edition Salesforce licenses, and can also be purchased separately.

The Partial Copy Sandbox has a refresh interval of five days, and allows data storage up to 5GB, with file storage mirroring that of your production org.

4. Full Sandbox

A full copy sandbox copies all of your production metadata and data. This gives you an exact replica of your production instance in order to fully test functionality, as well as train new users.

Full Sandboxes have a 29-day refresh interval, and mirror the storage limits of your production org for data and file storage.

These sandboxes are only included with Unlimited and Performance editions of Salesforce, but can be purchased separately.

Salesforce Sandbox Templates

A sandbox template enables you to choose specific objects and data to copy into your sandbox. Note that sandbox templates are only available with Full and Partial Copy Sandboxes.

If the sandbox doesn’t support a template, then no records will be copied over as part of its creation. In this instance, you or your users will need to create test data. This can be done by manually creating Salesforce records, importing data, or using APEX.

How to Create a Salesforce Sandbox

Now that you know the different sandbox options available, let’s go through the steps to creating a sandbox.

If you are planning to use a template, be sure to set this up before you try to create the sandbox!

From Salesforce Setup search for Sandboxes, then select New Sandbox.

Define a name and description, select the type, set the sandbox template (where applicable), and optionally choose to run some scripts that will run after creation (for example, to create some test data). Once you are done select Create to start the process.

The length of time it takes to ‘spin’ up a new sandbox can be anywhere from a few minutes for Developer Sandboxes, to 24 hours (or more) for a Full Copy version. This will depend on the amount of data and metadata that is being copied over.

When a sandbox is created every user will have .invalid added onto their email (apart from you) and .sandbox name added onto their username. For example, mine would be [email protected] for a sandbox called “Dev”. To log in to a sandbox, use test.salesforce.com instead of login.salesforce.com. Passwords will be copied from production, but be sure to make the email addresses valid in case a user needs a password reset!

How to Refresh a Salesforce Sandbox

Let’s say you created a sandbox a while ago and it’s now out of date when compared to production. To ensure your sandbox provides an up-to-date snapshot of the live system, you’ll need to refresh the sandbox.

Refreshing will wipe (delete) all data and metadata from the sandbox as it copies the latest configuration from production. Only refresh if you are happy for any changes in your sandbox to be overwritten!

From Salesforce Setup, use the Quick Find to search for Sandboxes. Next to the name of the sandbox, click Refresh to get started, and then follow the wizard.

You’ll only be able to refresh a sandbox if it’s available for a refresh. Once a sandbox has been refreshed, if you didn’t select it to “auto activate”, you’ll get an email when it’s ready.

How to Deploy From Sandbox to Production

There are various different ways to move changes from your sandbox into production – these include:

Summary

You may be thinking: Why do I need a Sandbox anyway? The simple answer is that using a sandbox pipeline for development and testing can ensure changes are thoroughly tested and do not interrupt your live environment. Salesforce Developers and Architects may also be interested in learning about scratch orgs.

A sandbox pipeline might resemble something like this:

Often, when a customer doesn’t have a Full Copy sandbox, they use a Partial Copy instead. If a customer has both a Partial and Full Copy Sandbox, the Partial Copy would appear before the Full Copy in the Sandbox pipeline.

One final thought – if you haven’t used a particular sandbox for a while, Salesforce will delete it after 180 days, so be sure to log in if you want to keep it active!

Resources

15 thoughts on “What Is a Salesforce Sandbox? [Updated 2022]

  1. Salesforce Sandboxes are really great as it only takes a couple of clicks to create a copy of your production environment. But the one thing a little annoying is with the partial sandboxes. They only copy the first 50k records of an object. So if you have a large org you usually end up with the oldest and usually most incompleate records in your org. It would be much better if you got the latest 50k records instead or have a choice.

  2. This is a great topic – thanks for posting this and giving some good insights into the possibilities. We see Salesforce customers doing all kinds of odd things to provision sandboxes and the like, but it is good to see the choices!

  3. Hi, small mistake in your description about Developer sandbox “These sandboxes are meant to be used for testing and/or coding in an isolated environment. This sandbox includes your production org’s meta data, can be refreshed every 29 days and whose storage limit is based on your productions.” -> Developer – may be refreshed every day, does not include any data automatically but allows 200 MB of data to be imported or created.

  4. Small correction in your description (“Performance Edition includes licenses for 1 Full sandbox, 1 Partial Copy sandbox, 5 Developer Pro sandboxes, and 30Developer sandboxes.”)…Performance Edition includes 100 Developer Sandbox

  5. Note – Only 10K rows / object gets copied over into Partial Copy. It would be great to choose the range. Not entirely sure of the order of records that gets copied over.

  6. Can I ask, Is it advisable to have a full sandbox available to use? I am working in an Enterprise edition and we are not using a Full Sandbox? In my experience, I’ve always used a full sandbox to to the final testing. Thanks for any advice?

  7. What type of sandbox is typically used for hotfix branch in CI/CD scenario. Logically, I would choose a Developer Pro, or a Developer Sandbox because it can be refreshed everyday. But then again, perhaps a Partial would be better so you can get some data. What is the best practice?

    1. I have the same question about the hotfix. I think that Developer and Developer Pro is the apt solution here. In case you get hotfixes very regularly, a possibility to refresh the hotfix after each deployment would make things so much easier. In my opinion, Partial copy and Full copy with longer refresh intervals are not good enough.

  8. Does anyone know the server performance capacity for sandboxes V production? There used to be a page a few years ago in Salesforce help pages but I haven’t been able to find it again. I often get the request for a prod like environment for performance testing but its hard to explain to non-salesforce people the sandbox landscape without any details from Salesforce

Add Comment