Clean and initialize the environment
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.
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:
-
In the Postman Collections pane, expand the SitecoreCommerce_DevOps collection.
-
Open the 2 Clean Environment folder, and execute the
Clean Environment
request. -
Open the 3 Environment Initialize folder and execute the
Ensure\Sync default content paths
request.NoteThe
Ensure\Sync default content path
synchronizes all items in the content path. (The default path is /sitecore/Commerce/Commerce Control Panel, as defined in theCommerce.Plugin.Content.DefaultContentPathsPolicy
, located in thePlugIn.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.) -
In the same folder, execute the
Initialize Environment
request.ImportantIf 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.