---
schema_version: "1"
id: 0f5b1936ee21ea8bb0efc51e8a03b061c10a4db9e32f0d4808db2e8baac2e411
title: Deploy Store Metadata to a Target Org
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/salesforce-commerce/guides/d2c-commerce/b2b-d2c-comm-deploy-store-metadata.md
canonical_url: https://developer.salesforce.com/docs/commerce/salesforce-commerce/guide/b2b-d2c-comm-deploy-store-metadata.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 281099835143a23b74b53317f7f29e54745684b2a9e3b4d47d2409965be7637d
products:
  - B2B Commerce Developer Guide
  - Salesforce APIs
---
# Deploy Store Metadata to a Target Org

The store metadata defines the store functionality.

## Deploying Store Metadata

Before you deploy metadata, review these Salesforce Developer topics:

- [_Metadata Components and Types_](https://developer.salesforce.com/docs/atlas.en-us.250.0.api_meta.meta/api_meta/meta_objects_intro.htm)
- [_Understanding Metadata API_](https://developer.salesforce.com/docs/atlas.en-us.250.0.api_meta.meta/api_meta/meta_intro.htm)
- [_Deploying and Retrieving Metadata_](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/file_based.htm)
- [_Salesforce CLI Command Reference_](https://developer.salesforce.com/docs/atlas.en-us.250.0.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_top.htm)

## Store Metadata Deployment Checklist.

- Extract the store metadata from the source org. You can use Salesforce DX, Metadata API, DevOps Center, or change sets. DevOps Center provides a better and more collaborative experience to manage change sets.
- Deploy the store metadata to the target org, and perform any necessary post-deployment configuration.
- Test the store metadata deployment in the target org. Make sure that all components are working as expected.
- Prepare the Experience Bundle. Package the components of the Experience Bundle metadata, which can include Visualforce pages, Lightning components, Apex classes, and static resources.
- Test the experience metadata deployment in the target org.
- Deploy the Experience Bundle Metadata: Deploy the experience components to the target org.
- Test the entire B2B store experience in the target org to confirm that everything functions as expected.

## Deploy Store Metadata with Change Sets

You can deploy Store and Experience metadata using change sets in the Commerce app. Deploy the Store metadata first, and then the Experience metadata.

Follow the steps outlined in [_Migrate Your Store Configuration_](https://help.salesforce.com/s/articleView?id=commerce.comm_migrate_store.htm&type=5). Make sure that you configure the source and target [_deployment connections_](https://help.salesforce.com/s/articleView?id=platform.changesets_about_connection.htm&type=5), and select [store.org](http://store.org/) as the store component type.

## Deploy Store Metadata with Salesforce Metadata API, Salesforce CLI, and Salesforce DX

Use the Salesforce Extensions for Visual Studio Code on Salesforce CLI to access Metadata API commands. The Salesforce Extensions for Visual Studio Code include tools for developing on the Salesforce platform in the lightweight, extensible VS Code editor. These tools provide features for working with development orgs (scratch orgs, sandboxes, and DE orgs), Apex, Aura components, and Visualforce.

Salesforce CLI is ideal if you use scripting or the command line for moving metadata between a local directory and a Salesforce org. For more information, see [_Salesforce Tools and Toolkits_](https://developer.salesforce.com/tools).

Here’s a high-level overview of how you can use Metadata API to deploy metadata from a source environment to a target environment. Your deployment requirements are unique to your organization and your approach can differ from these guidelines.

The command syntax for the CLI can differ. See the [_Salesforce CLI Command Reference_](https://developer.salesforce.com/docs/atlas.en-us.250.0.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_top.htm) for the most up-to-date information. Additionally, because the CLI is under active development, features and commands can change. Salesforce recommends you consult the latest Salesforce release notes or documentation for guidance on using the CLI for Salesforce Commerce metadata migration.

1. Log in to your source and target orgs to authenticate.
2. Back up your target org’s metadata and data before making changes.
3. Retrieve metadata from the source org.
   a. Identify the metadata components to deploy.
   b. Create a`package.xml` manifest file that lists the components.
   c. To retrieve the metadata, use the `sf project retrieve start` command with the —target-metadata—dir flag.

Example: `sf project retrieve start --target-org SandboxAlias –-metadata CustomObjects -dir ./custom_objects --package-xml ./package.xml`

4. Deploy metadata to the target org using the `sf project deploy start` command.
   a. Example: `sf project deploy start --target-org ProdAlias --source-dir ./custom_objects`
5. Monitor the deployment. Use the `sf project deploy validate` command.
   a. Perform post-deployment steps, such as data deployment or additional configuration in the target org.
   b. To ensure that everything works as expected, test your B2B Commerce store in the target org.

It’s important to establish a DevOps Center strategy that fits your organization’s requirements and to adopt tools that integrate well with your existing development workflow and deliver updates to users with minimal disruption.
