Sitecore Commerce provides end-to-end commerce system and highly integrated with Sitecore to leverage the analytics and marketing features. Sitecore has replaced the Commerce Server with a .Net core Commerce Engine. While we will go through the various features of commerce in later posts, this post talks about the installation of Sitecore commerce with all its associated services. Before we proceed I assume you have gone through the Installation of Sitecore 9 with SXA and SOLR. Now we will install commerce on top of previous vanilla Sitecore installation.
Sitecore Commerce Requires Basic Sitecore installation with following enabled. If you do not have the Sitecore Installation, please visit the previous post.
- Sitecore 9.2 installed with SXA.
- Sitecore Powershell Extension.
- SOLR 7.5 with Https enabled
- Sitecore Commerce Installation. (Sitecore.Commerce.WDP.2019.07-4.0.165)
- MsBuild nuget package. (msbuild.microsoft.visualstudio.web.targets.22.214.171.124.nupkg)
- .NET Core SDK 2.1.7
- Redis ( https://github.com/microsoftarchive/redis/releases/download/win-3.0.504/Redis-x64-3.0.504.msi)
Before procedding to Sitecore Commerce installation, ensure
- prerequisites are met
- Install .Net Core SDK and Redis.
- UnZip the Sitecore commerce package to "c:\deploy\commerce"
- You will find lots of zip files. Unzip the SIF.Sitecore.Commerce.3.0.28.zip file.
- Rename the Nuget Package to *.zip
- Unzip the content to a folder within "c:\deploy\commerce",like c:\deploy\commerce\msbuild.microsoft.visualstudio.web.targets.126.96.36.199
Step 1: Update Setup Script
Sitecore Commerce uses PowerShell script to automate the installation process, However, we must update the script with parameters w.r.t. our local instance. Go to the unzipped folder c:\deploy\commerce\SIF.Sitecore.Commerce.3.0.28. You will find the PowerShell script Deploy-Sitecore-Commerce.ps1. Before we make changes to the script, make a copy of the file for reference. Open the file in any text editor and update the following parameters accordingly.
|$SiteNamePrefix||Siteprefix provided during sitecore installation||sc92|
|$SiteName||sitecore site hostname||sc92sc.dev.local|
|$IdentityServerSiteName||Sitecore Identity Server hostname||sc92identityserver.dev.local|
|$skipInstallDefaultStorefront||true if you want to install default storefront site|
|$SqlPass||sql user password|
|$XCInstallRoot||unzipped folder path where all zip files are present||D:\deploy\setup|
|InstallDir||Sitecore installation directory||C:\inetpub\wwwroot\sc92sc.dev.local|
|XConnectInstallDir||xconnect installation directory||C:\inetpub\wwwroot\sc92xconnect.dev.local|
|CommerceInstallRoot||Commerce installation root||C:\inetpub\wwwroot\|
|SitecoreCoreDbName||Core DB Name|
|SolrRoot||Solr root folder||C:\Solr\solr-7.5.0\solr-7.5.0|
|SolrService||Solr service name||solr|
|RedisInstanceName||Redis service name||Redis|
|RedisInstallationPath||Redis installation path||C:\Program Files\Redis|
|SitecoreDomain||Sitecore domain to login||Sitecore|
|SitecoreUsername||Sitecore user to login||admin|
|SitecoreUserPassword||Sitecore user password||b|
Review all other parameters to make sure all variables are correct. Any mistake here will create a lot of issues during installation.
Step 2: Restart Identity Server
Sitecore Commerce talks to the Identity server for authentication and authorization. So during the installation, it will update the identity server configuration to add a new client to make API calls. So, we must restart the app pool of the identity server site BUT DO NOT BROWSE THE SITE. If the site is browsed IIS will lock the files for modification and it will fail during installation. DO NOT STOP THE APPPOOL, as instal script will access the site post updating the configuration.
Step 3: Execute Script
Towards the end of Deploy-Sitecore-Commerce.ps1, you will find the install script. Open PowerShell in admin mode navigate to the folder c:\deploy\commerce\SIF.Sitecore.Commerce.3.0.28. Execute the following commands.
In the prompt provide All.
The process will execute and install Sitecore commerce.
Once the installation completed we can browse http://sxa.storefront.com.
- Understand the Installation Json Files. Review all the parameters again. Majority of installation Issues are due to all parameter and properties are not carefully reviewed.
- Make sure all the pre requisites (Software/Hardware/Windows features) are installed.
- Review the Installation log file for the detailed error.
- Make sure IdentityServer IIS site's apppool is recycled and site is not browsed. As part of installation it will add a client configuration to the Identity Server and call its APIs.
- One of the common error we get, when the installation process will do an IISSTOP for the sitecore site, but unable to start it. To address this start the apppool manually and rerun installation script.
for #5 we will see the error message ike,
Install-SitecoreConfiguration: The service cannot accept control messages at this time. (ExceptionBefore rerun the installation script make sure,
from HRESULT: 0x80070425) At C:\Program Files\WindowsPowerShell\Modules\SitecoreInstallFramework
- In the Deploy-Sitecore-Commerce.ps1, update the log file name. Else it will overwrite previous logfile.Install-SitecoreConfiguration @params -Verbose *>&1 | Tee-Object "$PSScriptRoot\
- If as part of deployment, db changes are made. you can uninstall and start installation again. update the same script and replace the Install-SitecoreConfiguration command with following,UnInstall-SitecoreConfiguration @params -Verbose *>&1 | Tee-Object "$PSScriptRoot\XC-UnInstall.log"