Clean and initialize the environment

Current version: 10.1

For developers to test a Sitecore implementation, each environment needs to have data that enables them to execute Commerce blocks and pipelines. To facilitate this work, two sample catalogs are available - Habitat and Adventure Works. When testing is done and you want, for example, to move from the test environment, start a new production environment without sample data, or create a new project, you need to clean and initialize the environment. To do this, you use the Postman samples provided in the Commerce Engine SDK. You have the option to initialize a new environment without any sample data, or you can initialize an environment with a complete new set of Habitat or Adventure Works sample data (a sample data set includes catalog data, pricing, relationships, promotion data, and other related sample data).

The Clean Environment request takes the current environment as an input parameter, and uses the environment's ArtifactStoreID to match and remove all data in the Shared Environments database associated with that same ID. The ArtifactStoreID is defined in the environment .json file, stored in the c:\inetpub\wwwroot\<Role>\wwwroot\data\Environments folder.

Note

The Shared Environments database stores all of the commerce data used on the site (for example, catalog data, customer records, pricing information, configured promotions), as well as the generic entities and lists that power the functionality of the various installed plugins.

Any environment data stored in the Global database remains intact.

To clean and initialize the Commerce Engine environment:

  1. In the Postman  Collections pane, expand the SitecoreCommerce_DevOps collection.

  2. Open the 2 Clean Environment folder, and execute the Clean Environment request.

  3. Open the 3 Environment Initialize folder and execute the Ensure\Sync default content paths request.

    Note

    The Ensure\Sync default content path synchronizes all items in the content path. (The default path is /sitecore/Commerce/Commerce Control Panel, as defined in the Commerce.Plugin.Content.DefaultContentPathsPolicy, located in the PlugIn.Content.PolicySet-1.0.0.json file). You can only exercise this request in the context of a clean environment. (To synchronize only a sub-set of new or changed content items, use the sync content item or sync content path samples.)

  4. In the same folder, execute the Initialize Environment request.

    Important

    If you are not using a sample catalog data set in the new environment (Habitat or Adventure Works), set the required sampleData parameter to false when you execute the Initialize Environment request. The process ensures all base relationship definitions needed to build your custom catalog are initialized.

Do you have some feedback for us?

If you have suggestions for improving this article,