Newer Version Available

This content describes an older version of this product. View Latest

Create a Sandbox Definition File

Before you can create a sandbox using Salesforce CLI, create a sandbox definition file. The sandbox definition file is a blueprint for the sandbox. You can create different definition files for each sandbox type that you use in the development process.

Sandbox Configuration Values

Option Required? Description
apexClassId No A reference to the ID of an Apex class that runs after each copy of the sandbox. Allows you to perform business logic on the sandbox to prepare it for use.
autoActivate No If true, you can activate a sandbox refresh immediately.
copyArchivedActivities No Full sandboxes only. This field is visible if your organization has purchased an option to copy archived activities for sandbox. To obtain this option, contact Salesforce Customer Support.
copyChatter No If true, archived Chatter data is copied to the sandbox.
description No A description of the sandbox (1000 or fewer characters), which helps you distinguish it from other sandboxes.
historyDays No Full sandboxes only. Represents the number of days of object history to be copied in the sandbox.
Valid values:
  • -1, which means all available days
  • 0 (default)
  • 10
  • 20
  • 30
  • 60
  • 90
  • 120
  • 150
  • 180
licenseType Yes Valid values are Developer, Developer_Pro, Partial, and Full.
sandboxName Yes A unique alphanumeric string (10 or fewer characters) to identify the sandbox. You can’t reuse a name while a sandbox is in the process of being deleted.
sourceSandbox Yes (for sandbox cloning) Name of the sandbox being cloned.
templateId Yes (for Partial sandboxes) Optional for Full sandboxes. Not available for Developer and Developer Pro sandboxes.

A reference to the sandbox template as identified by the 15-character ID beginning with 1ps in the URL when viewing a sandbox template in a browser. A sandbox template lets you select which objects to copy in a sandbox.

Sample Sandbox Definition File

Although you can place the sandbox definition file anywhere, we recommend keeping it in your Salesforce DX project in the config directory. When naming the file, we suggest providing a descriptive name that ends in sandbox-def.json, for example, developer-sandbox-def.json.

1{
2     "sandboxName": "dev1",
3     "licenseType": "Developer"
4}