Newer Version Available

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

Move Metadata Changes to and from a Scratch Org

Use a scratch org to develop and test changes to metadata. You can perform your development within or outside the scratch org using Salesforce CLI or Salesforce Extensions for VS Code, which leverage the power of Metadata API.

Scratch orgs are created empty so that developers can specify the exact metadata and data to include from the source control system. The lifespan of a scratch org is indicated during creation, 1–30 days. They’re ephemeral to ensure the source of truth is always the source control system, and not the org itself.

You can move metadata from the source control system or to the scratch org using Salesforce CLI. Because scratch orgs use source tracking to identify changes, the CLI is the most efficient way to move metadata between your local repository and the scratch org. Continue to iterate through this process of moving metadata between your local file system and your scratch org until development is complete.