Friday, November 29, 2019

Installing Sitecore 9.3 with SXA and Horizon in a custom location

Installing Sitecore 9.3 - Sitecore Installation Assistant

I've seen many blogs now about installing Sitecore (9.3) with the Sitecore Installation Wizard. If this is still new to you, you might want to read this one from Robbert Hock. With the official release of Sitecore 9.3 and also Horizon, more blogs appeared. If you haven't installed Horizon yet, you might want to read this post by Adam Seabridge.

By default Sitecore (the simple developer version) will install everything in [systemDrive]:\inetpub\wwwroot. But what if you don't want that?

Installing in a custom root path

Installing Sitecore itself in another location has been made fairly easy. Open the setup.exe.config that comes with SIA and add this parameter to the XPSingle template (if that is what you are installing):
<template name="XPSingle" path=".\XP0-SingleDeveloper.json">
  ...
  <parameter name="SitePhysicalRoot" value="[your-path]" />
</template>
That will make sure that Sitecore, xConnect and the IdentityServer are installed on "your path".

SXA

You can also install SXA with the Sitecore Installation Assistant. SIA has a screen for optional modules that includes SXA (actually it includes only SXA at the moment). If you check that, SXA will be installed.

Or not.. if you have set the SitePhysicalRoot, the install will fail
Apparently the json files for SXA were not adjusted to be able to use another physical root. The simple solution is to change the path in SXA-XP0.json:
"Site.PhysicalPath": "[joinpath(environment('SystemDrive'), '...', '...', 'wwwroot', parameter('SiteName'))]"

A more advanced solution would be to change all used sxa json files to pass the parameter into the sxa-XP0.json:
  • Add the parameter in the sxa-XP0.json
  • Replace the variable in sxa-XP0.json with a check for the parameter (copy the code from identityserver.json)
  • Add the parameters in SXA-SingleDeveloper.json just as it was done in XP0.SingleDeveloper.json (you will have 2 - the actual parameter and a reference with SXA: prefix)
  • Add the parameter in setup.exe.config in the SXAXPSingle template section just as it was done in the XPSingle template

Horizon

Sitecore 9.3 comes with the first version of Horizon - which you need to install separately and without SIA (described by Adam as mentioned in the intro). But again - what if your Sitecore is not installed in the default location? And what if you want Horizon to install next to that Sitecore? 

It seems that some things were prepared to make this work, but definitely not all. So I'll guide you through the quick fix to get Horizon on your desired path:

Configs/sitecore-ah.json
  • Find AuthoringHost.Site.PhysicalPath (line 40) and adjust the path as needed 
Configs/sitecore-cm.json
  • Change the parameter Site.PhysicalPath (line 15) to SitePhysicalPath
  • Also make this change to the parameter name in the definition of the Site.PhysicalPath variable (line 46) - the variable can keep the "." in the name
parameters.ps1
  • Set SitecoreIdentityServerPhysicalPath (this is in the file by default)
  • Add SitePhysicalPath = "your-cm-path" to the $sitecoreCM parameters
  • In $sitecoreIS, set the AuthoringHostPhysicalPath to the path you desire for the authoring host (Horizon) - note that this is by default set to c:\inetpub\wwwroot
  • Fill in all other parameters as mentioned in the install guide

That worked for me. There is probably a better solution for the ah.json part to use parameters, but this should get you going at least.

Happy installing!


2 comments: