Newer Version Available

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

Scratch Org Definition for Org Shape

During org shape creation, we capture the features, settings, edition, licenses, and limits of the specified source org. This way, you don’t have to manually include these items in the scratch org definition file. You can create a scratch org based solely on the source org shape. Or you can add more features and settings in the scratch org definition file to include functionality not present in the source org.

In the scratch org definition, indicate the 15-character sourceOrg instead of edition. The sourceOrg is the org ID for the org whose shape you created. Use only the first 15 characters rather than the full 18-character org ID.

Important

Simple Scratch Org Definition File

If your Dev Hub org, source org, and org shape are all on the same Salesforce version, you can use the simple scratch org definition.

1{
2  "orgName": "Acme",
3  "sourceOrg": "00DB1230400Ifx5"
4}

Scratch Org Definition File during Salesforce Release Transitions

During the Salesforce major release transition, your Dev Hub org and source org can be on different versions. If your Dev Hub org is on a different version than your source org, add the release option to your scratch org definition file to create scratch orgs using the org shape.

1{
2  "orgName": "Acme",
3  "sourceOrg": "00DB1230400Ifx5",
4  "release": "previous"
5}
Source Org/Org Shape Version Dev Hub Version Supported Scratch Org Version Release Option to Use in Scratch Org Definition File
Current Preview Current version only "release": "previous"
Preview Current Preview version only "release": "preview"

Scratch Org Definition File for DevOps Center

If you create a scratch org based on an org shape with DevOps Center enabled, we still require that you add the DevOps Center feature and setting to the scratch org definition. We require that customers explicitly enable it for legal reasons as part of the DevOps Center terms and conditions.

1{
2    "orgName": "Acme",
3    "sourceOrg": "00DB1230400Ifx5",
4    "features": ["DevOpsCenter"],
5    "settings": {
6        "devHubSettings": {
7            "enableDevOpsCenterGA": true
8            }  
9        }  
10    }

Scratch Org Definition File with Other Features and Settings

To test features that your source org doesn't have, you can add more scratch org features and Metadata API settings. Settings refer to the Settings metadata type, not all metadata types.

1{
2  "orgName": "Acme",
3  "sourceOrg": "00DB1230000Ifx5",
4  "features": ["Communities", "ServiceCloud", "Chatbot"],
5  "settings": {
6      "communitiesSettings": {
7          "enableNetworksEnabled": true
8      },
9      "mobileSettings": {
10          "enableS1EncryptedStoragePref2": true
11      },
12      "omniChannelSettings": {
13          "enableOmniChannel": true
14      },
15      "caseSettings": {
16          "systemUserEmail": "support@acme.com"
17      }
18  }
19}

Next: Create a scratch org using the org shape scratch org definition file.