Admins / Consultants / Developers

What Is a Salesforce Sandbox?

By Tom Bassett

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 tom@email.com.dev 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

The Author

Tom Bassett

Tom is a 31x Trailhead certified, 2x Slack certified, and an 11x accredited professional with over six years of experience in the Salesforce ecosystem.

Comments:

    Francis Pindar
    September 21, 2015 7:33 am
    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.
    Clinton Jones
    September 21, 2015 2:09 pm
    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!
    Wenda McMahan
    September 26, 2015 5:42 pm
    Really nice, concise summary of Salesforce sandboxes. I'd come back here any time I need a refresher. Your site is easy on the eyes too.
    Katja Kantola
    October 26, 2016 6:43 am
    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.
    Bhavesh Patel
    July 07, 2017 6:49 pm
    Samll correction in your description...Performance Edition includes 100 Developer Sandbox
    Bhavesh Patel
    July 07, 2017 6:49 pm
    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
    Gova
    July 31, 2017 2:37 pm
    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.
    Joo Kang
    October 14, 2019 4:37 pm
    Agree!
    Anupa
    July 22, 2020 3:05 pm
    Very Informative
    Mia
    October 27, 2020 8:29 pm
    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?
    Frank Mamone
    July 23, 2021 3:59 pm
    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?
    Hayley Coxon
    December 15, 2021 2:11 am
    Francis, At Prodly, we 100% agree. That's why we built a seeding solution to allow you to specify exactly what records you want. Would love to show it to you sometime.
    Derek Black
    December 15, 2021 2:21 am
    I made a similar blog post that's a bit more up to date that may answer your question. https://prodly.co/blog/choosing-the-right-salesforce-org/ I'd recommend to use the "least expensive" org for hot fixes. So, a scratch org or a dev (not dev pro) org. Prodly provides data metadata seeding+promotion tools to extend the usability of dev and scratch to be on par to full or partial copies for most tasks.
    Harsh
    January 09, 2022 9:50 am
    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.
    Bryan
    May 17, 2022 1:46 am
    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
    Charmaine Rhule
    February 06, 2023 10:18 am
    There is no information relating to the number of System Admins and Integration Admins can be created in each Sandbox Type. Should the staging ( Full copy) sandbox have multiple System admin users accessed to an API #Connect App.
    Tom Bassett
    February 10, 2023 6:49 pm
    When you create a sandbox the user licences and users copies over from your Production Org. This means this would have the same users setup in the sandbox on creation as your Production org. If you needed to you could also create users explicitly in a sandbox for development purposes too. Please let me know if anything is unclear!
    Arrify
    February 11, 2023 5:14 am
    Great post, Tom! Your guide to Salesforce Sandboxes is a valuable resource for Admins and Developers. Your discussion on the different types of Sandboxes and how to create them is especially helpful. Your clear explanation of the benefits, like testing and development, highlights the importance of Sandboxes in maintaining data integrity and preventing errors. Thanks for sharing!
    Beth
    May 18, 2023 3:55 pm
    Should a business have a different full sandbox for UAT vs Development of new projects? Current company is not updating the UAT sandbox for months/years at a time because of a larger project in development. They are making smaller updates directly in Production and data in UAT is months out of date.
    Tom Bassett
    May 20, 2023 4:12 pm
    A Company should usually have a Developer Sandbox > Developer Pro > Partial > Full > Production sandbox type pipeline in terms of 'Best Practice'. However this depends on exact business needs and processes so can differ. If you are finding your UAT sandbox being 'held to ransom' by other development then it sounds like it's time to rethink your development pipeline.
    Sandip
    June 16, 2023 5:05 am
    Full copy sandbox - is this the best place to set up data integrations or Partial Dev? How does data masking come into play in sandboxes with live integrations that can override masked data?
    Tom Bassett
    June 23, 2023 9:49 pm
    Ideally Integrations should be tested in a Full Copy or Partial Copy sandbox. Data Masking is a topic that could in it's own right be a separate article. More info here; https://www.salesforce.com/products/platform/features/data-mask/

Leave a Reply