commerce

Sitecore Commerce 9.1 Initial Release – Step by step Install Guide on your machine

This one is a summary of my own experience for Sitecore Experience Commerce 9.1 Initial Release (aka Sitecore XC 9.1.0) installation on my machine. I’ve had much experience in the following ones:

so I decided to go only with:

I do hope that this blog post is helpful for your own journey as well.

Setup Prerequisites

Please refer to the Sitecore Experience Commerce 9 Compatibility Table for the software and version prerequisites:

Step-by-step guide

  1. install the ones below if not yet 😀
  2. rebuild the Link databases for the master and core databases if not yet:
    • on the Sitecore Launchpad, click Control Panel, and in the Database section, click Rebuild Link Databases
    •  select the master and core databases and then click Rebuild
    • sc9com_1
  3. rebuild the search indexes if not yet:
    • on the Sitecore Launchpad, click Control Panel, and in the Indexing section, click Indexing manager
    •  in the Indexing Manager dialog box, click Select all, and then click Rebuild
    • sxc902_7
  4. ensure that Experience Analytics is working properly
    • This slideshow requires JavaScript.

    • Note: if there is any error
      • option 1: you will have to solve it before installing XC by opening the Sitecore log and then having a look at the error messages (normally, they’re certificate issues)
      • option 2: you may want to disable xDB and then fix the error later after installing XC successfully
  5. (optional) once it’s configured for HTTPS/SSL so we should open \storefront910.identityserver.local\Config\production\Sitecore.IdentityServer.Host.xml and then add a new AllowCorsOriginsGroup to that file like this if not yet
    • sc910com_11.png
    • DON’T FORGET to do IIS reset
  6. create a new folder D:\sc910_com_install
  7. download MSBuild Microsoft Visual Studio Web targets (available from Nuget) then extract the Web targets package, copy the \tools\VSToolsPath\Web\Microsoft.Web.XmlTransform.dll file into D:\sc910_com_install
  8. download Sitecore Experience Accelerator 1.8.1 for Sitecore 9.1.1 (Note: must log into https://dev.sitecore.net/ before downloading) and put it into D:\sc910_com_install
  9. (optional) download Sitecore Powershell Extensions 4.7.2 then put it into  D:\sc910_com_install
    • Note: if you go with Sitecore Powershell Extensions 5.0, you will probably see NO default Storefront site in Sitecore
  10. download and unzip Packages for On Premise 2019.04-3.0.163 (Note: must log into https://dev.sitecore.net/ before downloading) then put it into D:\sc910_com_install
  11. unzip D:\sc910_com_install\SIF.Sitecore.Commerce.2.0.19 and then rename D:\sc910_com_install\SIF.Sitecore.Commerce.2.0.19 to D:\sc910_com_install\SIF for a better practice
  12. unzip the D:\sc910_com_install\Sitecore.BizFX.2.0.3.zip
  13. unzip the D:\sc910_com_install\Sitecore.Commerce.Engine.SDK.3.0.40.zip file then copy the D:\sc910_com_install\Sitecore.Commerce.Engine.SDK.3.0.40\Sitecore.Commerce.Engine.DB.dacpac file into D:\sc910_com_install
  14. download sc910_com_install.ps1 and put it into D:\sc910_com_install\SIF then open it to correct the following parameters:
    • $Prefix
    • $ScInstallDirectory
    • $SiteHostHeaderName
    • $SqlServer
    • $SolrUrl
    • $SolrRoot
    • $SolrService
  15. (optional) correct the SitecoreUserName and SitecoreUserPassword of your Sitecore XP 9.1.1 instance if you’re using others rather than the default ones
  16. (optional) you can specify any local account (note: it will be created automatically if non-existent) to be set up for the various application pools that are created as part of the deployment at line 80-81 of sc910_com_install.ps1
    • sc910com_4
  17. (optional) open D:\sc910_com_install\SIF\Configuration\Commerce\Connect\Connect_MarketingAutomation.json to correct the name of Marketing Automation Service (the windows service)
    • sc910com_12
  18. (optional) you may get timeout exceptions so I suggest to edit D:\sc910_com_install\SIF\Modules\SitecoreUtilityTasks\SitecoreUtilityTasks.psm1 in order to increase the execution timeout
  19. let’s install it
    • Note 1: somehow, it will be a blank page instead of default Storefront site’s home page if we create SOLR SXA cores before installing so DO NOT create them
    • Note 2: ensure that there is NO custom AllowedCorsOriginsGroup in D:\sc910_com_install\SIF\IdentityServer\Sitecore.Commerce.IdentityServer.Host.xml (they’re added automatically in prior installations)
      • sc910com_10.png
    • launch PowerShell as an administrator
    • change directory to D:\sc910_com_install\SIF
    • execute .\sc910_com_install
    • sc910com_5
    • hopefully there is nothing can stop the installation process now
    • sc910com_6
  20. open a browser then navigate to https://storefront910.local/, you would see the default page of Sitecore website. That’s because we don’t use the default host name sxa.storefront.com so we need to correct it via Sitecore
    • log into https://storefront910.local/sitecore/
    • access /sitecore/content/Sitecore/Storefront/Settings/Site Grouping/Storefront
    • update Host Name to storefront910.local and Database to master
    • sc910com_9
    • (optional) not check the checkbox Cache Html and select Yes for Disable Browser Caching for a better practice
    • sc910com_17
    • refresh https://storefront910.local/ and then add some products, you would see something like this
    • sc910com_18
  21. DO NOT forget to perform Post-Installation Steps

The recommendation

We can remove the tasks completed from D:\sc910_com_install\SIF\Configuration\Commerce\Master_SingleServer.json and re-do Step 19 if there is something wrong (especially for Note: some known issues below) so that we are able to save a lot of time 😀

How to uninstall it?

  • download sc910_com_uninstall.ps1 and put it into D:\sc910_com_install then open it to correct 07 parameters below:
    1. $ScInstallDirectory
    2. $Prefix
    3. $SolrService
    4. $PathToSolr
    5. $SqlServer
    6. $SqlAccount
    7. $SqlPassword
  • launch PowerShell as an administrator
  • change directory to  D:\sc910_com_install
  • execute .\sc910_com_uninstall
    • sc910com_7
  • hopefully, it runs well and cleans everything up

Note: some known issues

  1. Cannot create a file when that file already exists
    • sc910com_1
    • my suggestion: ensure that the site bindings are unique (Ex: host name, port)
  2. The service cannot accept control messages at this time
    • xc903_7.png
    • my suggestion 1: access IIS, start storefront910.local site and storefront910.local application pool manually (note: you may need to do it several times) if they’re in STOP status, somehow IIS cannot restart those ones after stopping them
    • my suggestion 2: have a look at the workaround Start-WebAppPool error when install Sitecore XC 9.1
  3. The remote server returned an error : (400) Bad Request
    • sc910com_21
    • my suggestion: try doing IIS Reset and then perform the current install step again
  4. No catalog data available + Illegal recursion detected: GetModel
  5. the layout for the requested document was not found
    • This slideshow requires JavaScript.

    • log into https://storefront910.local/sitecore/
    • access /sitecore/Commerce/Commerce Control Panel/Storefront Settings/Storefronts/Storefront/Catalog Configuration
    • ensure to uncheck the checkbox Use Direct Navigation
    • sc910com_15

Got issues?

Please send your issues (with screenshots if possible) to viet.hoang.sitecore@gmail.com so that I have a chance to understand your problem and be able to suggest the solution.

Happy Sitecore Commerce Installation!

22 thoughts on “Sitecore Commerce 9.1 Initial Release – Step by step Install Guide on your machine

  1. Great post! I had a minor issue with password other than ‘b’ in the config file causing issues with sync content items during InitializeCommerceEngineUsingHost. I switched my password back to b and everything worked. Thanks

    Liked by 1 person

  2. I see that this post mentions the use of Sitecore XP 9.1 u1. Can I use Sitecore commerce 9.1 initial release with Sitecore XP 9.1 initial release? Are there any known compatibility issues?

    Like

      1. No, my bad. XC 9.0 Update 3 is compatible with XP 9.0 Update 2. Actually, there is no XC version for XP 9.1 Initial Release so we have to upgrade it to 9.1.1. Sorry for my misreading!

        Like

  3. Hi Viet,
    Really great article. Helped me a lot of troubleshooting the issues after the XC9.1 was installed.
    Also, regarding the issue you found “The service cannot accept control messages at this time”, I had written a blog of how to avoid it before run the installation script, please have a look 😉
    http://pengqd.net/archive/start-webapppool-error-when-install-sitecore-xc-91/

    Again, thank you so much. It saved my time!!

    Liked by 1 person

  4. Hi Viet,
    I am installing sitecore commerce 9.1 but getting error ” The remote server returned an error : (400) Bad Request” i’m restart my IIS again perform again run script but same issue it’s not resolved please suggest me any other ways to resolve the issue ?
    [—————————————————————————- GetIdServerToken : GetIdServerToken —————————————————————————-]
    Get Token From Sitecore.IdentityServer
    VERBOSE: POST https://ssc.identityserver.local/connect/token with -1-byte payload
    Install-SitecoreConfiguration : The remote server returned an error: (400) Bad Request.
    At C:\Program Files\WindowsPowerShell\Modules\SitecoreInstallFramework\2.1.0\Public\Install-SitecoreConfiguration.ps1:641 char:25
    + & $entry.Task.Command @paramSet | Out-Default
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration

    [TIME] 00:00:04
    Install-SitecoreConfiguration : The remote server returned an error: (400) Bad Request.
    At D:\sc910_com_install\SIF\sc910_com_install.ps1:95 char:2
    + Install-SitecoreConfiguration @params -Verbose *>&1 | Tee-Object …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration

    [TIME] 00:46:11
    Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
    At D:\deploy\SIF\Modules\InitializeCommerce\InitializeCommerce.psm1:86 char:17
    + … $response = Invoke-RestMethod $UrlIdentityServerGetToken -Method Post …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
    Thank you!

    Like

    1. You should ensure that your Sitecore Identity Server is up and running. If NO, perhaps you installed .Net Core incorrectly (have a look at Identity Server’s log and Event Viewer of Windows)

      Like

  5. Hi Viet,
    I am installing sitecore commerce 9.1 but getting bellow error, please suggest me

    Ensure/Sync default content paths for environment AdventureWorksAuthoring failed, please check Engine service logs for
    more info.
    Install-SitecoreConfiguration : ScriptHalted
    At C:\Program
    Files\WindowsPowerShell\Modules\SitecoreInstallFramework\2.1.0\Public\Install-SitecoreConfiguration.ps1:641 char:25
    + & $entry.Task.Command @paramSet | Out-Default
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration

    [TIME] 00:01:23
    Install-SitecoreConfiguration : ScriptHalted
    At D:\sc910_com_install\SIF\sc910_com_install.ps1:95 char:2
    + Install-SitecoreConfiguration @params -Verbose *>&1 | Tee-Object …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration

    [TIME] 00:44:32
    ScriptHalted
    At D:\sc910_com_install\SIF\Modules\InitializeCommerce\InitializeCommerce.psm1:204 char:19
    + … $(throw Write-Host “Ensure/Sync default content paths for e …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : OperationStopped: (:) [], RuntimeException
    + FullyQualifiedErrorId : ScriptHalted

    log error:

    00004 18:30:19 ERROR Management.block.getitembypath: Sitecore Item Service Get item failed, Item /sitecore/Commerce/Commerce Control Panel not found.
    00004 18:30:19 ERROR CtxMsg.Error.ItemOnPathNotFound: Text=Item on path ‘/sitecore/Commerce/Commerce Control Panel’ was not found.

    thank you !

    Like

    1. Hello, normally, you should ensure that your database server name is correct in the install script by using double-backslash escape if any, ex: “DESKTOP-XXXXXXX\\SQLServer2017”

      Like

Leave a reply to Kautilya Prasad Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.