org create snapshot

Create a snapshot of a scratch org.

A snapshot is a point-in-time copy of a scratch org. The copy is referenced by its unique name in a scratch org definition file.

Use “sf org get snapshot” to get details, including status, about a snapshot creation request.

To create a scratch org from a snapshot, include the “snapshot” option (instead of “edition”) in the scratch org definition file and set it to the name of the snapshot. Then use “sf org create scratch” to create the scratch org.

force:org:snapshot:create

Flag Name (Long)Flag Name (Short)Description
‑‑api‑versionN/AType: Value

Override the api version used for api requests made by this command
‑‑description‑dType: Value

Description of snapshot.

Use this description to document the contents of the snapshot. We suggest that you include a reference point, such as a version control system tag or commit ID.
‑‑flags‑dirN/AType: Value

Import flag values from a directory.
‑‑jsonN/AType: Boolean

Format output as json.
‑‑name‑nType: Value
Required

Unique name of snapshot.
‑‑source‑org‑oType: Value
Required

ID or locally authenticated username or alias of scratch org to snapshot.
‑‑target‑dev‑hub‑vType: Value
Required

Username or alias of the Dev Hub org. Not required if the target-dev-hub configuration variable is already set.

Create a snapshot called “Dependencies” using the source scratch org ID and your default Dev Hub org:

Create a snapshot called “NightlyBranch” using the source scratch org username and a Dev Hub org with alias NightlyDevHub: