Skip to main content

Commerce Server Staging

If you are having issues setting up Commerce Server Staging, I have some tips here to get started. The documentation from Sitecore is not quite clear on what it is and how to use it. This post is not a guide on how to configure CSS as the literature already covers this procedure.

What is Commerce Server Staging (CSS)?

The MSDN documentation on this topic is about 10 years out of date, so let's give a more up to date definition. As we don't typically build Commerce Server Sites using all the bits and pieces, the "Web sites" part doesn't apply anymore.

The role of the CSS service in Sitecore Commerce (as I understand) is to copy business data from one Commerce Server site to another. As noted in the MSDN documentation, several network topologies are supported. For this article I'm just going to cover the most basic type of replication, which is same-server from one site to another.

The scenario

In my Commerce Server instance I have got two Commerce Server sites.

  1. An authoring environment where products are created and enriched
  2. A publishing environment where transactions occur.
These two sites link to Sitecore Content Management (CM) and Content Delivery (CD) respectively. Note that it is not necessary to have more than one Commerce Site in your solution, but this post focuses on how we can use Commerce Server Staging to "publish" our data. If you have set up CSS correctly and Sitecore is configured to use it, you will see the following dialog box when you publish:


The dialog box shows all configured Commerce Server Staging projects in your system.

Pitfalls

There are a few issues that can stop CSS replication from working properly. They are documented here below.

Incorrect service user

The Commerce Server installer application is supposed to allow you to set the service user that the service will run under. In most installations, this needs to be the "xxxRunTimeUser" that you create to run all the Commerce Server components and IIS AppPools under. In some cases the Commerce Server Configuration wizard will quit during this process and fail to perform the action to do this.

The implication of the CSS service not running under your run time user is that it quite possibly may not work. Sitecore may not even be able to talk to the CSS DCOM component to kick off the staging project. When you try to start the staging project, you might get a number of unexplained errors that look similar to the following:


To resolve this issue, you need to change the service user of the CSS Service. To do this, follow this procedure:
  1. Open services.msc. Search for the Commerce Server Staging Service.
  2. Open the properties and go to the Log On page. Set the service account to be the RunTimeUser that you created when installing Commerce Server.
  3. Restart the service and try to run the staging project again. Check that the entities you selected are copied to your target CS Site.

Sitecore can't talk to the CSS Service

When you publish in Sitecore, you might get a message similar to the following:

Error: An unexpected error was encountered while connecting to the Commerce Server staging system. See the sitecore log file for more information.

This can happen for a variety of reasons, but they all stem from the fact that Sitecore has incorrect permissions. Check the following is true:
  • The IIS AppPool user is set to be the RunTimeUser that you created when installing Commerce Server.
  • The RunTimeUser has appropriate permissions to use the CSS DCOM component.
  • You have defined a staging project in Commerce Server Staging Manager.
  • The Commerce Server Staging service is running.
Note that I experienced the issue where the service crashed every time Sitecore tried to communicate with it. The root cause was found to be that the service user was not the same as the IIS AppPool user. This is really important!

Comments

Popular posts from this blog

Load testing Sitecore Experience Commerce with Taurus

Performance and load testing is a topic often talked about, but many of our customers have not yet seen a practical implementation of it on Sitecore Commerce. The requirements for an eCommerce website are a little different to that of a brochureware or plain content website. Additionally, we are typically dealing with a distributed system involving web servers, payment gateways and in Sitecore Commerce's case, a separate application that handles the eCommerce functionality.

This post aims to provide an overview of a load testing approach that can be applied to eCommerce implementations with a specific focus on Sitecore Commerce. In future posts I'll be expanding on the approach to address scenarios such as Checkouts, integrating with CI/CD pipelines, and running tests at-scale.
Terminology There a few terms that need to be clarified before we proceed. If you're already familiar with load testing, then you'll be familiar with terms such as: Response time (RT) a.k.a. lat…

About this blog

Hey all,

This blog is a space for me to share my experiences in working with Sitecore Commerce, as well as other eCommerce platforms, Sitecore CMS and other web related topics.

My aim is to help others who might run into the same issues, questions and situations that might arise from Sitecore Commerce development.

About me My name is Ray Tran. I have been working with Sitecore since version 6.5 and content management systems since a long time ago.

Currently, I am working as a Commerce Solution Architect at Sitecore Australia. My job is to help our partners and customers succeed in delivering amazing Sitecore experiences.

DISCLAIMER ALL INFORMATION AND ADVICE ON THIS SITE IS PROVIDED WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. NO GUARANTEES ARE PROVIDED REGARDING THE ACCURACY OR CORRECTNESS OF THE INFORMATION PRESENTED.