Newer Version Available

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

Create a Scratch Org Snapshot

You can create a snapshot if the source scratch org wasn’t created using a snapshot or with a namespace.

Before you begin:

  • Enable Dev Hub in your production org, or another org you use to create scratch orgs.
  • Enable Scratch Org Snapshots in the Dev Hub org.
  • Be sure that non-admin users have the proper permissions to use scratch orgs and snapshots. See Assign a License and Permissions to Snapshot Users for details.

A snapshot captures the state of a scratch org at a point in time. To update your snapshot, delete it and create another snapshot. Unlike an org shape, a snapshot includes installed packages, metadata, and data. The time to create a snapshot depends on the size of the source scratch org. To speed up snapshot creation time, include only what’s necessary for your project.

If you continue to modify the source scratch org after you run the snapshot command, not all the modifications will be reflected in the snapshot. Instead, complete the configuration of the source scratch org before creating the snapshot.

Note

Command syntax:

1sf org create snapshot --name <name> --source-org <ID or alias of scratch org> \
2--target-dev-hub <username or alias of Dev Hub org> --description <text>

A snapshot name can have a maximum length of 15 characters. It can contain only alphanumeric characters (no special characters or spaces, even if the name is surrounded by quotation marks during creation).

To view the aliases, usernames, and IDs of your authenticated orgs and scratch orgs, run the org list command.

Tip

Example:

1sf org create snapshot --name dhsnapshot --source-org dreamhouse-scratch \
2--target-dev-hub my-dev-hub --description "Dreamhouse app"

Your request is initially InProgress:

1Name               Value      
2──────────────────  ──────────────────── 
3Id                  0Oo1Q0000004C93SXX   
4Snapshot Name       dhsnapshot           
5Description         Dreamhouse app       
6Status              InProgress           
7Source Org          00D050000004ipAEXX   
8Created Date        09/22/2023, 02:07 PM 
9Last Modified Date  09/22/2023, 02:07 PM 
10Expiration Date     2023-12-21

To check the status of the request, see Manage and Maintain Your Snapshots.