Understanding of SIF Install – Concept behind the steps

Dear Sitecore Enthusiasts,

Story:

Recently, we had a few new hires join, from the background of being .Net Developers with less than 3 years of experience in our India Office and we created a training plan for getting them onboarded on Sitecore.

One of the reasons why I love being at Horizontal Integration – is they give great opportunity to talent as well as help them getting on-boarded on Sitecore by giving the necessary training.

With the introduction of SIF, Sitecore is moving to a more standard way of installation. As we are all used to installing Sitecore using SIM, we feel its so difficult using SIF and why did Sitecore come up with all this complexity. But actually, if we just sit back and try to understand the PowerShell Script provided by Sitecore in their Installation Guide, it will be pretty simple.

As a part of the onboarding process, we were having a look SIF installation for Sitecore 9. And as anyone would expect, the new hires were getting a little nervous about the installation script. So we started the installation and side by side, started some white-boarding, so that we can divide and understand each part of the install script.

Well, today, I thought, why not share the same white board notes with the community? I am sure there might be many who still haven’t installed Sitecore 9 or even if they have, they might not know the basics. I believe this is the right time to do so.

So, lets have a quick look at how the complete Installation PowerShell Script, given in the Documentation of Sitecore 9 – divide it and try understanding it conceptually.

Challenge:

Understand the Concept of SIF Install Script.

Solution:

With Sitecore 9, we all know that we have Sitecore XConnect and to take care of all the additional configurations for setting up Sitecore 9 and getting it up and running, Sitecore moved to a more standardized way using PowerShell Scripts. This would be the same for local Dev instances or Prod environments. And moving forward, it seems Sitecore is going to support the same – like say for installing Sitecore Commerce, its using a similar script, which is a great thing for all the devs like us. I’d like to add, I’m going to cover Sitecore XP0 installation with this post – if you feel this helpful, and would like to write for XP1 or other scaled environments, I’d like to encourage you to do so.

So, the way in which the PowerShell Script provided by Sitecore works, is it calls a PowerShell Function written by Sitecore called Install-SitecoreConfiguration, takes the JSON files available in the XP Configuration Zip file (that is available when we download the On Premise zip) as its basis and above that, considers the parameter values that we pass from the install.ps1 Script of PowerShell.

The install.ps1 of Sitecore, is divided into six steps:

  1. The Custom parameters that we as developers give to the script – which includes things like the Name of the prefix, the Solr Service, the location of Solr, SQL Server etc. etc.
  2. Create and install Certificate for xConnect Website.
  3. Install the Solr Cores for xConnect
  4. Install xConnect – using the ZIP of xConnect website – which is available in the zip that we download from the On Premise link.
  5. Installing/Adding the Solr Cores that will be used by the Sitecore Instance.
  6. Install the Sitecore Website.

Pretty Simple, isn’t it?

The above is kind of the gist of it. Interested in knowing further?

Well, lets have a look.

First Part: The Custom Parameters


$prefix = "SC-902"
$PSScriptRoot = "C:\Varun\Sitecore-Plain-Instance-Repository\SC-9-Update-2\PowerShell-Scripts"
$XConnectCollectionService = "$prefix.xconnect"
$sitecoreSiteName = "$prefix.sc"
$SolrUrl = "https://solr:9393/solr"
$SolrRoot = "c:\solr\SC902\solr-6.6.2"
$SolrService = "solrSC902"
$SqlServer = ".\sqlexpress16sp1"
$SqlAdminUser = "sa"
$SqlAdminPassword="123456"

In this section – we specify all the Parameters required for configuring the the Sitecore Instance. As we notice, we specify the prefix of the Sitecore and xConnect instances, the Script Root – the location where the scripts are placed, the Solr instance url which the script can use along with its physical location, the SQL instance, along with the admin user and password. With this step, we are mainly prepping for the main execution of the installation.

Second Part: Create and Install Certificate for xConnect


$certParams = @{
Path = "$PSScriptRoot\xconnect-createcert.json"
CertificateName = "$prefix.xconnect_client"
}
Install-SitecoreConfiguration @certParams -Verbose

In this step, we create and install the Certificate that is going to be used for xConnect.

The thing to notice, as we discussed above, it takes the JSON file which Sitecore provides us and the Certificate Name is taken from the parameters we had specified in the first Section.

Third Part: Install cores in Solr for xConnect Website


$solrParams = @{
Path = "$PSScriptRoot\xconnect-solr.json"
SolrUrl = $SolrUrl
SolrRoot = $SolrRoot
SolrService = $SolrService
CorePrefix = $prefix
}
Install-SitecoreConfiguration @solrParams

In this step, we add create Cores in Solr that are going to be used by our xConnect instance. As we might notice again, there is a JSON file, that Sitecore has provided, along with the combination of the parameters that we had given the values in the First Step.

Fourth Part: Install xConnect Website


$xconnectParams = @{
Path = "$PSScriptRoot\xconnect-xp0.json"
Package = "$PSScriptRoot\Sitecore 9.0.2 rev. 180604 (OnPrem)_xp0xconnect.scwdp.zip"
LicenseFile = "$PSScriptRoot\license.xml"
Sitename = $XConnectCollectionService
XConnectCert = $certParams.CertificateName
SqlDbPrefix = $prefix
SqlServer = $SqlServer
SqlAdminUser = $SqlAdminUser
SqlAdminPassword = $SqlAdminPassword
SolrCorePrefix = $prefix
SolrURL = $SolrUrl

}
Install-SitecoreConfiguration @xconnectParams

In this step, we install the xConnect Website. Its so clear why this has been designed this way. We first install all the dependencies of xConnect – the creation and installation of the certificate and the creation of cores in Solr – and now we proceed with installing xConnect.

As we might notice, it has 3 things in specific – the JSON file from Sitecore, the package or the ZIP file from Sitecore and the rest are initialized using our custom parameter value.

Fifth Part: Install cores in Solr for Sitecore Instance


$solrParams = @{
Path = "$PSScriptRoot\sitecore-solr.json"
SolrUrl = $SolrUrl
SolrRoot = $SolrRoot
SolrService = $SolrService
CorePrefix = $prefix
}
Install-SitecoreConfiguration @solrParams

As you might guess, after this step would be installing the Solr cores that will be required by the Sitecore instance to be up and running. As we see, it has a JSON file given by Sitecore and values from our Custom parameters.

Sixth Part: Install the Sitecore Website.


$sitecoreParams = @{
Path = "$PSScriptRoot\sitecore-XP0.json"
Package = "$PSScriptRoot\Sitecore 9.0.2 rev. 180604 (OnPrem)_single.scwdp.zip"
LicenseFile = "$PSScriptRoot\license.xml"
SqlDbPrefix = $prefix
SqlServer = $SqlServer
SqlAdminUser = $SqlAdminUser
SqlAdminPassword = $SqlAdminPassword
SolrCorePrefix = $prefix
SolrUrl = $SolrUrl
XConnectCert = $certParams.CertificateName
Sitename = $sitecoreSiteName
XConnectCollectionService = "https://$XConnectCollectionService"
}
Install-SitecoreConfiguration @sitecoreParams

The last step in the installation script, is about installation of the Sitecore Instance. It takes the JSON file and the Sitecore website zip provided by Sitecore and rest are the values which we give as custom parameters in the First Step.

Nicely Architected Script — isn’t it?

Looking back, now we feel how much value does the first step add to the whole script – we initialize the variables once and the same value is passed on to the steps that follow.

The best thing about installation script, is you can use it for installing Sitecore 9 Initial Release, Sitecore 9 Update 1 as well as Sitecore 9 Update 2 – with minimum changes.

Guess what? Perfect, you got that right!

  1. Updated values for the Custom Parameters of Step 1
  2. Updated Value of Package – in Step 4 and 6

Hope the post helps you getting more understanding about Sitecore Install Framework.

Also, one of the pre-requisites of installing a Sitecore 9 instance is to setup Solr over SSL. In case you want to have an ease for that – refer to this article of mine – Install As Many Solr Instances As you Want on your Local Dev Machine for Sitecore 9

Thank you Sitecore for making our life easy with Sitecore Install Framework!

Happy Sitecoring and Happy Installing Sitecore using SIF!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s