In my previous post I wrote about Installing Sitecore XP 9.1.1. Now I can continue my journey with the installation of Sitecore Experience Commerce (XC) 9.1 and the SXA for both (XP and XC).
Before we can start
Before you start with the installation of Sitecore XC ensure that your Sitecore XP installation is working properly. To be on the safe side you should work through following checklist:
- Open a web browser and navigate to your Solr server. My server is running on port 8983 and therefor on my system is the Url: https://localhost:8983/solr
- You may get a warning in Firefox “MOZILLA_PKIX_ERROR_SELF_SIGNED_CERT”. This warning occurs because we use a self-signed certificate. It is safe to ignore this warning.
- To get rid of this warning you could generate a Root CA certificate and a CA signed certificate for localhost.
- Next, we will check if the Sitecore administration website is working. On my system I had to navigate to http://playground.sc/sitecore. Sitecore will redirect us to the identity server for the login. After the login the Sitecore launchpad should be visible.
- With the login we have already checked the basic functionality of the identity server.
- Next, we will rebuild the search indexes to make sure that Sitecore and Solr are properly connected: Control Panel > Indexing Manager > Select all > Rebuild
- Wait until the rebuild is completed.
- The Sitecore XC Installation script will use Windows Authentication to connect to the SQL Server. You have to ensure that your current Windows logon user has proper database permissions. An easy way to check this, is to open the SQL Server Management Studio and connect with your Windows User to the SQL Server.
- To check your Sitecore Install Framework version open a Windows PowerShell and start following command:
- Get-InstalledModule -Name SitecoreInstallFramework -AllVersions
- I recommend to only have one version installed at the same time. The installation of Sitecore XC 9.1 requires version 2.1.0
- Sitecore Experience Commerce release package
- Click on the link “Packages for On Premise 2019.04-3.0.163” to start the download.
- You will need your Sitecore credentials to be able to download this package.
- Sitecore PowerShell Extension 4.7.2
- Click on download and accept the legal notice.
- Scroll down and click on the “Package” link next to “Full 4.7.2 release for Sitecore 8/9”
- Sitecore Experience Accelerator for 9.1.1
- Click on the link “Sitecore Experience Accelerator for 9.1.1” to start the download.
- You will need your Sitecore credentials to be able to download this package.
- Click on “Download package”.
- This file is a zip container. To extract the file, you can either change the file extension to zip or use a zip program of your choice to extract it directly. I used 7-zip to extract the package.
Prepare the installation directory
- Create an empty directory where you want to place all required files for the installation. I used the directory D:\Sitecore\Deploy XC 9.1
- Extract the contents of the Sitecore.Commerce.2019.04-3.0.163.zip into this directory.
- Open the directory and extract following files. After the extraction you should get three new directories in the main directory.
- Copy the Sitecore Experience Accelerator 1.8.1 rev. 190319 for 9.1.1.zip into the main directory.
- Copy the Sitecore PowerShell Extensions-4.7.2 for Sitecore 8.zip into the main directory.
- Copy the extracted folder “msbuild.microsoft.visualstudio.web.targets.184.108.40.206” into the main directory.
Customize the deployment script
Open the script file “Deploy-Sitecore-Commerce.ps1” with a text editor of your choice. I use Visual Studio Code to edit PowerShell scripts. The file is located in the directory “D:\Sitecore\Deploy XC 9.1\SIF.Sitecore.Commerce.2.0.19” on my system.
The first step to prepare the script for a successful execution, is to set the correct values in the first parameter section:
param( [string]$SiteName = "playground.sc", [string]$SiteHostHeaderName = "playground.sc", [string]$SqlDbPrefix = "playground", [string]$CommerceSearchProvider = "SOLR", [string]$IdentityServerSiteName = "playground.identityserver" )
My installation directory of xconnect differs from the way the script expects. Therefore, I had to set the directory explicitly:
XConnectInstallDir = "c:\inetpub\wwwroot\playground.xconnect"
My Solr installation differs in several ways. So, I had to update the values for URL, root and service.
SolrUrl = "https://localhost:8983/solr" SolrRoot = "D:\\Tools\\solr-7.2.1" SolrService = "Solr 7.2.1"
The script is unable to resolve the paths for SitecoreCommerceEnginePath and SitecoreBizFxServicesContentPath because with the wildcard it gets more than one result. To solve this problem, I have replaced the wildcard with the explicit value.
SitecoreCommerceEnginePath = Resolve-Path -Path "..\Sitecore.Commerce.Engine.3.0.163.zip" SitecoreBizFxServicesContentPath = Resolve-Path -Path "..\Sitecore.BizFX.2.0.3"
Because I had copied the zip files for the PowerShell extension and the SXA for 9.1.1 directly into the main directory, I had to adjust also these lines of the script.
PowerShellExtensionsModuleFullPath = Resolve-Path -Path "..\Sitecore PowerShell Extensions*.zip" SXAModuleFullPath = Resolve-Path -Path "..\Sitecore Experience Accelerator*.zip"
And finally, we have to correct the version number from 1 to 2 for the commerce sxa modules.
SXACommerceModuleFullPath = Resolve-Path -Path "..\Sitecore Commerce Experience Accelerator 2.*.zip" SXAStorefrontModuleFullPath = Resolve-Path -Path "..\Sitecore Commerce Experience Accelerator Storefront 2.*.zip"
After I have changed all these lines of the script, I was able to successfully install Sitecore Experience Commerce 9.1 on my machine.
After the installation you have five new sites in IIS. SitecoreBizFx is the business tools site for the merchandising management. The other four commerce sites are the four roles of the commerce engine.
You can read more about the commerce engine roles on the official documentation.
There are also two new databases installed to the SQL Server. SitecoreCommerce9_Global and SitecoreCommerce9_SharedEnvirontment are the dedicated databases for Sitecore Commerce.
The business tools are accessible from the Sitecore launchpad. After you click the button you will be redirected to another site.
If you open the content editor from the Sitecore launchpad, you will see that a demo SXA storefront site was added. To be able to navigate to this site, you must configure the host name of this site. Open the item “/sitecore/content/Sitecore/Storefront/Settings/Site Grouping/Storefront” in the content editor and scroll down to the field Host Name. In this field you can configure to which host name the demo site will response.
There are three additional steps necessary to be able to use this host name.
- Add the hostname to your hosts file in C:\Windows\System32\drivers\etc
- Start a text editor of your choice as administrator.
- Open the hosts file
- Add following line to the file: 127.0.0.1 store.playground.sc
- Generate a self-signed certificate for your host name
- You can either use openssl or PowerShell scripts to do this.
- First generate a CA root certificate
- And then generate a certificate for your host name which is signed with the CA root certificate
- Edit the bindings of your Sitecore site
- Open the Internet Information Services (IIS) Manager
- Expand to your Sitecore site (e.g. playground.sc)
- Right-Click on the site and choose “Edit Bindings…”
- Add a binding for http and another one for https using your self-signed certificate
Open a browser and navigate to the host name you have configured.
This is a very brief summary of my experience with the installation of Sitecore XC 9.1. If you have any questions, don’t hesitate to leave a comment. Enjoy playing around with Sitecore Commerce! In my next posts I will focus on the Commerce Engine, the Business Tools and how you can customize these.