Introduction to Sandboxes

What is a Sandbox?

A sandbox is a copy of a production environment used for a variety of purposes, commonly including testing and development.

Here’s how it works:  When you create or refresh (essentially deletes and recreates a sandbox using the same name) a sandbox, a copy of the production environment at that point in time is made.  The vast majority of the configuration remains the same as the production org.  There are a few tweaks to sandboxes during the copy process – for example the sandbox name (e.g. Dev1) is appended to the username of all users within the sandbox.  Some types of sandboxes will allow you to specify data to be copied from production into the sandbox as well (see below).  If no data is copied (e.g. developer edition sandbox), then all of the configuration (metadata) will be migrated, but no records will be present.

What’s the goal?

Let’s say that I want to build a new Force.com application – I would start by building and testing that application in a sandbox.  Once I am satisfied with the application, I can then migrate the metadata and data (if applicable) to the production environment.  By performing this configuration in a non-production environment, I am free to test and experiment without running the risk of creating unused configuration/fields, interfering with an existing application in use, and other such concerns.

Many enterprise companies will use a multi-staged deployment methodology – the most common example is development and unit testing in one sandbox (usually a developer sandbox), promotion to QA (usually a full sandbox), then promotion to production.

Sandbox Overview
[Should / Short / Salesforce.com]

Developing and Testing with Sandbox (Trailhead)
[Should / Long / Salesforce.com]

Sandbox Types

TypeCopies MetadataCopies DataRefresh LimitData Limit
DeveloperYesNoDaily200MB
Developer ProYesNoDaily1GB
Partial CopyYesPartial5 Days5GB
FullYesYes29 DaysSame as Production (at time of copy)

Login URLs

To login to a sandbox, you must use the sandbox URL.  Likewise, logging into production requires using the production URL.  This applies to login via the website and API alike.

Production: https://login.salesforce.com
Sandbox: https://test.salesforce.com

Migrating Metadata Between Environments

Several tools exist to help an administrator or developer migrate metadata (configuration changes) from one environment to another.  The two most-commonly used tools are:

1. Change Sets: native tool, admin-friendly (development experience not required)

Note that the use of change sets requires a production environment with an accompanying sandbox.  Developer Edition does not include a sandbox and therefore change sets are not available in DE orgs.  You need an Enterprise Edition or higher org to use change sets.

Change Sets Overview
[Could / Short / Salesforce.com]

Salesforce's Change Set Feature
[Could / 22m / Nubik]

2. Force.com IDE: developer toolkit, desktop application (developer-oriented)

Force.com IDE
[Could / Medium / Salesforce.com]

This guide will not cover these tools in any more depth, as this is out of scope for the Salesforce.com Certified Administrator Exam.

Lessons Learned

This guide will not cover sandboxes in depth, as it is not required for ADM201 certification.  However, I would like to share a few lessons I’ve learned working extensively with sandboxes throughout the years:

  • Your sandbox will get out of sync with your production environment almost immediately.  If you make regular configuration changes in your production environment (or in multiple development environments), this is problematic.  Plan accordingly; there isn’t an easy solution.
  • Test your deployment.  Change sets are a great tool, as is the IDE.  Both can act in ways you might not expect- create another sandbox and test your deployment from one sandbox to another (assuming you have the sandboxes to do so), especially if you are new to the process.  Use the preview deployment feature of change sets to your advantage.
  • Promotion of profiles is problematic; change sets are much easier.
  • The amount of data in your production org can dramatically increase the time it takes to create a full sandbox (with all data included).  In one case, I saw a sandbox take over 5 days to be created (millions of records).
  • When you create a full sandbox, the record IDs (accounts, contacts, etc.) will match the production environment (the org id will be different).  However, as soon as you create new records in either environment, the new record IDs will not match.

63 Responses to “Introduction to Sandboxes”

  1. AbdullahPalisoc April 17, 2017 at 5:07 am #

    I am going through the review list one by one and just decided to study trailhead in unison with your website. I noticed that trailhead discusses App creation a lot. Is that something that I should be focusing on on my ADM 201?

  2. Dee_kochar February 20, 2017 at 10:45 pm #

    Hi John ,,

    What if i create a custom object and the relevant tab in a sandbox environment but while migrating through change sets , i dont add the tab component . Will the migration fail or only the object will be mgrated without the tab ?

    • JohnCoppedge March 13, 2017 at 6:34 pm #

      It would migrate with only the object.

      If you tried to migrate the tab without the object (and the object did not exist in the target org), then it would fail (as the object would be a dependency).

  3. Roswell Tan January 20, 2017 at 12:00 am #

    What are reasons to specify an Apex Class when creating a partial data Sandbox? Do I need one if I’m simply doing base configurations and no development?

  4. mrajesh123 January 13, 2017 at 10:58 am #

    As defined in salesforce help, “A Developer Pro Sandbox is intended for development and testing in an isolated environment and can host larger data sets than a Developer Sandbox.”

    Your table above shows No Data is copied. But what does hosting larger data sets imply?

    • JohnCoppedge January 19, 2017 at 2:32 am #

      It means that you can test with large data sets (up to 1 GB) – the developer will need to populate the data set though… it wont carry over from production automatically

  5. mrajesh123 January 13, 2017 at 10:54 am #

    John, under Sandbox types, I think Partial Data is now called Partial Copy? Salesforce help calls it Partial Copy.

  6. akshadaks December 15, 2016 at 2:04 am #

    Hi John,

    I am very new to Salesforce and was going through the “Salesforce’s Change Set Feature” video from Nubik. However I don’t see any Deployment options on the left-side bar. Please assist.

    The url I am using – https://ap4.salesforce.com/

    Regards
    Akshay

  7. danielflippance December 1, 2016 at 7:05 pm #

    The link to Force.com IDE seems to be broken: http://wiki.developerforce.com/page/Force.com_IDE

    Clicking returns the following error:

    Bad Request

    Your browser sent a request that this server could not understand.
    Size of a request header field exceeds server limit.
    Cookie

    • JohnCoppedge December 5, 2016 at 3:12 pm #

      Looks like it works for me – I was having some strange issues with the Salesforce websites last week. Try clearing your browser cache (or using another browser)

  8. Shashank_Bhattacharya August 23, 2016 at 2:34 pm #

    Hi John,
    Could you please tell me hoe to activate and work on the sandbox in the developer edition(free SF account).
    Thanks in advance

  9. bookworm July 4, 2016 at 8:10 pm #

    John
    Thanks for your help in putting this extensive documentation together. I cleared the test 6/29. There were a lot of questions on communities, chatter, activities, service cloud. For some odd reason, I wasn’t expecting them. Needless to say, its critical that prospective candidates focus on all the topics and corresponding details.
    Thanks. Happy 4th.

  10. cclwong May 19, 2016 at 7:24 am #

    I didn’t really get this part.. .sorry:
    If no data is copied (e.g. developer edition sandbox), then all of the configuration (metadata) will be migrated, but no records will be present.

    Do you mean, if there is any data copied, not all metadata is migrated? Thanks.

    • JohnCoppedge May 19, 2016 at 11:06 am #

      All of the metadata (config, fields) is copied – the data (eg account records) would not be copied in developer sandboxes.

  11. Sairamarkt February 26, 2016 at 6:16 pm #

    Hi John,
    Am preparing for both ADM201 and app builder. Could you please provide the answer for this question. “what happens when new object is promoted with profile from sandbox to prod with change set but respective tab is not included. In this case whether tab will be visible, hidden or turned off for all users?” Thank you.

    • JohnCoppedge February 26, 2016 at 10:58 pm #

      If the tab wasn’t included in the change set then there would be no tab at all- e.g. no place to select “hidden”… there’s no tab to hide.

  12. grege01 February 18, 2016 at 7:42 pm #

    This is perhaps not quite the right place to ask… but I will anyways 😉

    It appears the 401 certification is now or will soon be defunct, and has been replaced by a combination of others :

    Platform App Builder (declarative only/ replacement for 401?)
    Platform Developer 1 (programming)
    Platform Develop 2 (programming)

    (There is still alot of material out there talking about 201 and 401, and this confused me as the SF certification “curriculum” seems to have changed fairly recently. Hopefully this will save others some time/confusion.)

    Is that your understanding as well John, re: the 3 certs above, as they are related to the Admin certification? Would be nice of SF published and “old” vs “new” map 😉

    • JohnCoppedge February 22, 2016 at 9:58 pm #

      Good Q (and quite common)-

      App Builder is definitely the closest to ADM201- I’ve taken the migration exam from 401 to App Builder myself (as I am not a programmer, thus Dev 1 is not appropriate).

      Old to New:
      401 –> App Builder
      (No old offering that matches) –> Dev 1
      501 –> Dev 2

      Salesforce is moving away from the “developer” term NOT involving code… which I applaud. It confused a lot of folks 🙂

  13. g.levy@mamacash.org January 23, 2016 at 9:51 am #

    Hi John,

    Could you please explain what you meant here: “Promotion of profiles is problematic; change sets are much easier.” – I did not understand it.

    Thank you,
    Gil

    • JohnCoppedge January 25, 2016 at 7:57 pm #

      If you are moving permissions (e.g. profile or permission sets) from one org to another (e.g. from a sandbox to production), permission sets are a bit easier to work with as they are more self contained (a profile touches much more of the system and will not always deploy exactly as you intended- requires manual verification). For example I once deployed a profile and it did not override any of the settings contained within the profile (this had to be done by hand).

  14. Esmeralda Clavel January 11, 2016 at 9:05 pm #

    Hi John,

    Your article and material are very well articulated! Thank you this website!

  15. ClarSal19 November 16, 2015 at 5:06 am #

    Hi John,
    Can you elaborate what you mean by “Promotion of profiles is problematic; change sets are much easier” ? I followed pretty well up until this point.

    Thanks!
    Clarissa

    • JohnCoppedge November 20, 2015 at 5:21 am #

      This is not important for the admin exam – but basically it is easier to package and promote (move from one environment to another) a change set because change sets have a limited impact (e.g. only a subset of permissions).

      When you package a profile into a permission set it only changes the profile in the context of the other components that are packaged in that same change set (e.g. you include the ‘sales person’ profile and the ‘commission’ field, then profile would only be changed for the ‘commission’ field). This can lead to packaging components you wouldn’t want to include (such as a field that already exists).

  16. Raajesh Kumar June 14, 2015 at 3:20 pm #

    Tabular column says Developer edition can only copy metadata in sandbox. But I believe for developer edition sandbox is not available right. Am I missing something?

    • JohnCoppedge June 15, 2015 at 1:46 pm #

      Developer edition is a production account – one that you signed up for at the beginning of this guide. There are no sandboxes in a DE org, correct.

      There are also “developer” sandboxes which are available through Enterprise Edition and up.

  17. sksood May 18, 2015 at 1:23 pm #

    Hi John
    The videos made sense after having read the material on Sandboxes albeit Nubik’s went thru his material too fast.

    Thanks
    Sanjay

  18. Joanna Korda April 17, 2015 at 9:22 am #

    Great section on Sandboxes! As I am not a full Administrator for my company I had always wondered how they worked. Articles & video has given me a much better understanding how it works. Thank you.

  19. PRAVEEN YERRAMSETTY April 14, 2015 at 12:55 am #

    Hi John,
    i am trying to login into the test.salesforce.com site, using developer site credentials but it’s erroring out . Am i doing it wrong ?

  20. Harleen MANN December 14, 2014 at 11:33 am #

    @John you should really start an online tutorial site for multiple technologies. your content is really strong and well articulated.

  21. Taylor Ochs December 2, 2014 at 9:54 pm #

    John, I need help understanding this statement. I have been using the data loader and doing testing of data loader with my sandbox. Can you explain why the Record ID’s change? How and when with an example would be beneficial. Thank you!
    ***When you create a full sandbox, the record IDs (accounts, contacts, etc.) will match the production environment (the org id will be different). However, as soon as you create new records in either environment, the new record IDs will not match.

    • JohnCoppedge December 3, 2014 at 2:35 pm #

      The record ID is established when the record is created in the org. Therefore if you are creating a record in one org (sandbox) and another org (production) at the same time, the IDs are not likely going to match.

      However, when a full sandbox is created, it can retain a copy of some or all records from the production environment. In this case, the IDs of the records are the same (because the sandbox is inheriting the records from production) – however, this is realistically the only time where this is likely to occur.

      After the copy has completed, if you were to create records in the sandbox and in production, the IDs again would not match.

      Does that help?

      • Taylor Ochs December 3, 2014 at 2:57 pm #

        Very helpful! Thank you that makes sense.

  22. Frank Verrill July 17, 2014 at 8:45 pm #

    John,
    I created a test org from my partner account then created a sandbox from the test org to test the change set function. The related video on this page was helpful.
    Frank

  23. Cindy Gavelek May 30, 2014 at 10:48 pm #

    Grammar catch – …am free to test and experiment without running the risk of created/creating unused configuration/fields…

    Should be creating instead of created in the above…

  24. Srini Muthu May 15, 2014 at 7:18 am #

    Hi John,
    Do you offer similar study guide for DEV401 certification?

  25. Swapna Kalmekolen May 11, 2014 at 11:58 pm #

    What does daily developer sandbox refresh mean?

    • JohnCoppedge May 16, 2014 at 7:06 pm #

      It means that you can refresh the sandbox once per day. With a some sandboxes you are prevented from frequent refreshes.

      • Sourabh Khosla October 6, 2015 at 9:20 pm #

        John –
        I have a follow up question then – why would a Full Sandbox not allow the refresh until the cycle of 29 Days is completed? I am not sure I follow.

        • JohnCoppedge October 10, 2015 at 2:55 pm #

          That’s a limitation from Salesforce. For high volume orgs a full sandbox refresh can take over 24 hours and is quite resource intensive. Therefore you can’t refresh full sandboxes more than once per 30 days.

  26. Mugdha Ralegaonkar May 5, 2014 at 9:26 pm #

    In the lesson learned section ADM 201 certification is mentioned but this is study guide for dev 401 certification. Is my understanding correct?

    • JohnCoppedge May 10, 2014 at 10:09 pm #

      This study guide is for ADM201 certification, however, there is significant overlap between the content for DEV401 and ADM201.

  27. Sai kumar March 9, 2014 at 8:24 pm #

    According to Salesforce.com site:

    “Developer sandboxes are limited to 200 MB of test or sample data, which is enough for many development and testing tasks.”

    But In the Table it is mentioned: 10 MB.

    Please correct me If I am wrong

    Thanks,
    Sai

  28. Michael OHern February 19, 2014 at 2:00 am #

    I believe this needs updating or clarification => “I would start by building and testing that application in one or more sandboxes ‘before migrating the implementing the application’ in production.

  29. Varun Mehta December 25, 2013 at 9:02 pm #

    Hello John,

    Thanks for the nice content 🙂
    As I am kind a new to Sales force and preparing for my first Admin certification.
    I am trying to check the change sets features but Not getting the Sandbox option (Developer Edition-Free 14 release) in the Setup ? I did try to login with test.Salesforce.com for the same also not getting through with my same user name and password.

    Let me know where I am going wrong or did I miss something?

    Thank-you
    Varun

    • JohnCoppedge December 28, 2013 at 4:29 pm #

      Hi Varun,

      As a developer edition does not have a sandbox, change sets are not available. You would need an Enterprise or above org. Good question! Thanks,

      John

  30. John November 18, 2013 at 12:03 pm #

    Configuration Only is now called Developer Pro as of the Winter ’14 release.

Leave a Reply