Back Up Metadata to Protect and Restore Your Customizations
Protect your org’s customizations, such as custom fields, custom Apex code, page layouts, reports, and permission sets, by backing up your metadata.
Required Editions
| Available in: Developer, Enterprise, Performance, Professional, and Unlimited editions. |
| User Permissions Needed | |
|---|---|
| To create unmanaged packages: | Create AppExchange Packages and Manage Users |
Backing up your metadata gives you a snapshot of that metadata at a particular point in time. At a future time, you can compare the backed-up metadata with more recent metadata. You might do this to revert your metadata to a previous state or to identify what changes have been made for purposes such as debugging.
To back up your metadata, create an unmanaged package.
- In Setup, enter Package Manager in the Quick Find box, and then select Package Manager.
- Select New, name the package, and select Save.
- In the Components tab, select Add.
- In the Component Type dropdown list, select the types of metadata you want to include in your backup, and click Add To Package for each metadata type.
- To finish creating this unmanaged package, click Upload.
You receive an email when your package has been uploaded to the Package Manager page.
For more advanced metadata backup options, API and CLI commands are available. See Deploying and Retrieving Metadata in the Metadata API Developer Guide and mdapi Commands in the Salesforce CLI Command Reference. To review the metadata types that can be packaged using more advanced developer tools, see the Metadata Coverage Report.
Create a New Version of Your Unmanaged Package
It's likely that your org's metadata is changing daily, and that new metadata types are added. To protect these changes, periodically create a new version of your unmanaged package.
- In Setup, enter Package Manager in the Quick Find Box, and then select Package Manager.
- Click the Package Name for the unmanaged package you created.
- In the Components tab, select Add.
-
In the Component Type dropdown list, select any new types of metadata you want to add to
your backup, and click Add To Package for each metadata
type.
Note Changes to components that were added in a previous package version are captured automatically when you create a new version. - Click Upload, and in the Package Detail screen complete the Version Name field. Consider adding details in the Description field so you know when this version was created, and click Upload.
Each time you create a new package version, you've created a new snapshot of your metadata.
Restore Your Metadata From an Unmanaged Package
We recommend restoring metadata in a sandbox org. Then use your standard method for deployment from a sandbox to your production org.
- In Setup, enter Package Manager in the Quick Find Box, and then select Package Manager.
- Click the Package Name for the unmanaged package you created.
- From the Package Detail page, click the Versions tab, and select the package version number.
- Copy the installation URL from the Package Version Detail page.
- Use the installation URL to install your unmanaged package in a sandbox org.
- Work with a developer to retrieve and redeploy the metadata to restore using either the Metadata API or the Salesforce CLI.

