Newer Version Available

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

Create a Snapshot for Use with Namespaced Scratch Orgs

While you can't use a namespaced scratch org to create a snapshot, you can create a namespaced scratch org from a snapshot. That way, you can deploy namespaced metadata to the scratch org. Snapshots are intended to include only dependent packages, metadata, and test data.
  1. Create and register the namespace in the Dev Hub org and add it to the sfdx-project.json file.
  2. When you create the scratch org that you plan to use as the source of the snapshot, be sure to indicate the --no-namespace flag.
  3. Create the scratch org snapshot.
  4. Create a scratch org based on the snapshot.

    The resulting scratch org has a namespace, which means that any unpackaged metadata from the snapshot is now namespaced in the resulting scratch org.