Skip to main content

Microsoft

How to Install Sitecore 9 with the Sitecore Install Framework

The big news coming out of Sitecore Symposium last week is the release of Sitecore Experience Cloud 9.0. With the release of version 9, Sitecore has brought more and more pieces of its platform into an inevitably microservices-oriented future. The first thing you’ll notice is that there’s no .exe installer anymore – this has regularly a quick way to install Sitecore but with the new dependencies on SSL for xConnect and the various options for configuring xDB and databases, Sitecore has abandoned the .exe installer and replaced it with something much better and much more configurable called the Sitecore Install Framework.
The Sitecore Install Framework (commonly referred to as SIF since every Sitecore product needs a good acronym) can be daunting at first but is actually pretty straightforward. I’ll go into more detail about SIF in a later blog post but basically Sitecore provides what is effectively a PowerShell-based task runner and a handful of tasks that can be performed. This also means that you can create your own tasks to execute as part of the install process that can be tailored for your specific environment(s).
For this blog post, however, we’ll focus on the most basic (and likely most common) install scenario – the all-in-one development installation. This is where all of the Sitecore and xConnect roles are all on a single machine that is also likely hosting SQL Server and Solr as well. For this, we’ll need the Sitecore Install Framework to run the following tasks:

  • Install client certificates for xConnect
  • Install xConnect
    • Install Solr cores for xDB
    • Deploy the xConnect web deploy package
      • Create and deploy the web application
      • Deploy the databases
      • Create the Windows services for marketing automation and search indexing
  • Install Sitecore
    • Install Solr cores for Sitecore
    • Deploy the Sitecore web deploy package
      • Create and deploy the web application
      • Deploy the databases
      • Associate the Sitecore instance with the deployed xConnect instance

Fortunately, Sitecore provides all of these steps for you – all you need to do is to execute them with the proper parameters. In the Sitecore 9 Installation Guide, Sitecore walks you through the various services and how to install each one. The modules can be obtained from the Sitecore download site or more preferably from the Sitecore MyGet repository. To install the modules, run the following PowerShell commands:

# Add the Sitecore MyGet repository to PowerShell
Register-PSRepository -Name SitecoreGallery -SourceLocation https://sitecore.myget.org/F/sc-powershell/api/v2
# Install the Sitecore Install Framwork module
Install-Module SitecoreInstallFramework
# Install the Sitecore Fundamentals module (provides additional functionality for local installations like creating self-signed certificates)
Install-Module SitecoreFundamentals
# Import the modules into your current PowerShell context (if necessary)
Import-Module SitecoreFundamentals
Import-Module SitecoreInstallFramework

If you skip to the end of the deployment guide, you’ll find a convenient block of PowerShell code that executes the installation for you:

#define parameters
$prefix = "sc90"
$PSScriptRoot = "C:SitecoreInstallSitecore 9.0.0 rev. 171002"
$XConnectCollectionService = "$prefix.xconnect"
$sitecoreSiteName = "$prefix.local"
$SolrUrl = "https://localhost:8983/solr"
$SolrRoot = "C:solr-6.6.2"
$SolrService = "solr662"
$SqlServer = "localhost"
$SqlAdminUser = "sc90"
$SqlAdminPassword = "password"
#install client certificate for xconnect
$certParams =
@{
    Path = "$PSScriptRootxconnect-createcert.json"
    CertificateName = "$prefix.xconnect_client"
}
Install-SitecoreConfiguration @certParams -Verbose
#install solr cores for xdb
$solrParams =
@{
    Path = "$PSScriptRootxconnect-solr.json"
    SolrUrl = $SolrUrl
    SolrRoot = $SolrRoot
    SolrService = $SolrService
    CorePrefix = $prefix
}
Install-SitecoreConfiguration @solrParams -Verbose
#deploy xconnect instance
$xconnectParams =
@{
    Path = "$PSScriptRootxconnect-xp0.json"
    Package = "$PSScriptRootSitecore 9.0.0 rev. 171002 (OnPrem)_xp0xconnect.scwdp.zip"
    LicenseFile = "$PSScriptRootlicense.xml"
    Sitename = $XConnectCollectionService
    XConnectCert = $certParams.CertificateName
    SqlDbPrefix = $prefix
    SqlServer = $SqlServer
    SqlAdminUser = $SqlAdminUser
    SqlAdminPassword = $SqlAdminPassword
    SolrCorePrefix = $prefix
    SolrURL = $SolrUrl
}
Install-SitecoreConfiguration @xconnectParams -Verbose
#install solr cores for sitecore
$solrParams =
@{
    Path = "$PSScriptRootsitecore-solr.json"
    SolrUrl = $SolrUrl
    SolrRoot = $SolrRoot
    SolrService = $SolrService
    CorePrefix = $prefix
}
Install-SitecoreConfiguration @solrParams -Verbose
#install sitecore instance
$sitecoreParams =
@{
    Path = "$PSScriptRootsitecore-XP0.json"
    Package = "$PSScriptRootSitecore 9.0.0 rev. 171002 (OnPrem)_single.scwdp.zip"
    LicenseFile = "$PSScriptRootlicense.xml"
    SqlDbPrefix = $prefix
    SqlServer = $SqlServer
    SqlAdminUser = $SqlAdminUser
    SqlAdminPassword = $SqlAdminPassword
    SolrCorePrefix = $prefix
    SolrUrl = $SolrUrl
    XConnectCert = $certParams.CertificateName
    Sitename = $sitecoreSiteName
    XConnectCollectionService = "https://$XConnectCollectionService"
}
Install-SitecoreConfiguration @sitecoreParams -Verbose

One of the prerequisite steps is to have Solr already installed and SSL for your Solr instance configured. While the Installation Guide specifies Solr 6.6.1, I found out the hard way that there is a bug in Solr 6.6.1 which will cause the following error in the deployment process as it tries to start the same cores multiple times:

Invoke-ManageSolrCoreTask : Error CREATEing SolrCore 'sc90_xdb': Unable to create core [sc90_xdb] Caused by: null
At C:Program FilesWindowsPowerShellModulesSitecoreInstallFramework1.0.2PublicInstall-SitecoreConfiguration.ps1:253 char:21
+                     & $entry.Task.Command @paramSet | Out-Default
+                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-ManageSolrCoreTask

This bug is fixed in Solr 6.6.2 and onwards so I would recommend using Solr 6.6.2 instead of 6.6.1. If you’re looking for the Bitnami installer for Solr 6.6.2, there isn’t one – you’ll have to install it the old fashioned way.
You’ll want to make sure the parameters at the top of the PowerShell script contain the correct values and that your web deploy packages, configuration JSON files, and Sitecore license are all located in the $PSScriptRoot  folder. Execute this PowerShell script and you should be up and running in just a couple of minutes!

Thoughts on “How to Install Sitecore 9 with the Sitecore Install Framework”

  1. Thanks for the blog George. You could include a step – 1a to install powershell 5.1. Otherwise the Register-PSRepository won\’t work. Tried this on Server 2012 R2.
    So far not finding this a better installation method but will try to keep open mind

  2. Yes, PowerShell 5.1 needs to be installed as a prerequisite for using the Register-PSRepository command as well as other commands in the Sitecore Install Framework. This is a named prerequisite in the installation guide.

  3. Hey George, great article!
    One minor thing, you don\’t need to install the fundamentals module itself. SIF has a dependency on fundamentals so it\’ll be installed for you. When calling Update-Module for SIF it also will update fundamentals if needed.

  4. George, I\’m working through the scripts, but when I run the Install-SitecoreConfiguration @solrParams -Verbose line, I\’m getting this error: Install-SitecoreConfiguration : Could not find Solr instance: https://localhost:8983/solr. If I put that URL into a web browser, my Solr instance comes up just fine. In the $SolrService parameter, I used the service name from the Services panel; my Solr service is one I wrote in VS so I could manipulate the config when needed. I\’m not sure why the scripts wouldn\’t be finding Solr in this case. Any suggestions? Thanks.

  5. Hey Kieran, good to know! I thought it was the other way around – Fundamentals had a dependency on SIF so it would install SIF if just installed Fundamentals.

  6. Hey Ken, I\’m not sure what\’s going on with that. Has your Solr cert been added to the Trusted Root Certification Authorities container in Windows? You should not be getting any SSL warnings when you hit your Solr URL so make sure that part is all good or else PowerShell will treat it like it doesn\’t exist.

  7. George, it\’s definitely installed with SSL working properly, I get the green Secure message and all, and if I copy/paste the address that it gives back, Solr comes up fine. I tried increasing the PostDelay in the sitecore-solr.json from the default 8000 to 20000, to see if it needed a few seconds more for Solr to kickstart, but that didn\’t seem to work. It just seems like Solr isn\’t back up after the restart by the time the script wants to roll again. I\’m going to keep fiddling with it.

  8. After install I can\’t start XConnect Indexer Service. \”Unhandled Exception: System.Runtime.Serialization.SerializationException: The constructor to deserialize an object of type \’Sitecore.Nexus.Licensing.LicenseException\’ was not found.\”
    Did I miss something?

  9. Hi George-
    Thanks for your help here! I\’m very close, but I ran into the following issue with my installation:
    [StartServices [1]]:[Updating] sc9002.xconnect-IndexWorker
    VERBOSE: Performing the operation \”Invoke-ManageServiceTask -Name sc9002.xconnect-IndexWorker -Status Running -StartupType -Description -DisplayName \” on target \”sc9002.xconnect-IndexWorker\”.
    VERBOSE: Starting Service \’sc9002.xconnect-IndexWorker\’
    WARNING: Waiting for service \’Sitecore XConnect Search Indexer – sc9002.xconnect-IndexWorker (sc9002.xconnect-IndexWorker)\’ to start…
    WARNING: Waiting for service \’Sitecore XConnect Search Indexer – sc9002.xconnect-IndexWorker (sc9002.xconnect-IndexWorker)\’ to start…
    Install-SitecoreConfiguration : Failed to start service \’Sitecore XConnect Search Indexer – sc9002.xconnect-IndexWorker (sc9002.xconnect-IndexWorker)\’.
    At C:sitecore_resourcefilesinstall.ps1:46 char:1
    + Install-SitecoreConfiguration @xconnectParams -Verbose
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration
    [TIME] 00:02:50
    Transcript stopped, output file is C:sitecore_resourcefilesxconnect-xp0.171027 (4).log
    Start-Service : Failed to start service \’Sitecore XConnect Search Indexer – sc9002.xconnect-IndexWorker (sc9002.xconnect-IndexWorker)\’.
    At C:Program FilesWindowsPowerShellModulesSitecoreInstallFramework1.0.2PublicTasksInvoke-ManageServiceTask.ps1:40 char:33
    + $instance | Start-Service
    + ~~~~~~~~~~~~~
    + CategoryInfo : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service], ServiceCommandException
    + FullyQualifiedErrorId : StartServiceFailed,Microsoft.PowerShell.Commands.StartServiceCommand
    Any ideas?
    Thank you!

  10. Hey George- Great article, thanks for your help. I\’m still running into an issue with the build, specifically the xconnect-IndexWorker service. I run into the following issue:
    Install-SitecoreConfiguration : Failed to start service \’Sitecore XConnect Search Indexer – sc9002.xconnect-IndexWorker (sc9002.xconnect-IndexWorker)\’.
    Any ideas? Thanks.

  11. Hi George. What OS were you installing on? We have done it successfully on Win 10. But on 2012 R2 getting an error at line 19 of the install script:
    Install-SitecoreConfiguration @certParams -Verbose
    Install-SitecoreConfiguration : No matching commands include a parameter named \’Signer\’
    Looking into xconnect.createcert.json we can see \’Signer\’ is a parameter here
    \”CreateSignedCert\”: {
    // Create a certificate signed by the root authority.
    \”Type\”: \”NewSignedCertificate\”,
    \”Params\”: {
    \”Signer\”: \”[GetCertificate(variable(\’Root.Cert.DnsName\’))]\”,
    It\’s puzzling because I can see CreateSignedCert here in the json with 5 parameters. However in New-SignedCertificate.ps1 (C:Program FilesWindowsPowerShellModulesSitecoreFundamentals1.0.0PublicWebFeatureSSL) the function seems to have 6 parameters.
    And Signer specifically
    if ($null -eq (Get-Command -ParameterName Signer -Module PKI -Name New-SelfSignedCertificate))
    {
    throw \”Unsupported PKI client cmdlet \’New-SelfSignedCertificate\’ on Windows Server 2012 R2 and Windows 8.1\”
    So really just wondering if it worked for you on 2012 R2, or which OS you were testing on. Regards

  12. Hey George, Nice article. I followed all the steps to install Sitecore 9 but I am getting below error, any thoughts?
    Command start time: 20171028150629
    **********************
    PS>TerminatingError(Get-Command): \”The running command stopped because the preference variable \”ErrorActionPreference\” or common parameter is set to Stop: No matching commands include a parameter named \’Signer\’. Check the spelling of the parameter name, and then try again.
    Parameter name: Signer\”
    >> TerminatingError(Get-Command): \”The running command stopped because the preference variable \”ErrorActionPreference\” or common parameter is set to Stop: No matching commands include a parameter named \’Signer\’. Check the spelling of the parameter name, and then try again.
    Parameter name: Signer\”
    Install-SitecoreConfiguration : No matching commands include a parameter named \’Signer\’. Check the spelling of the
    parameter name, and then try again.
    Parameter name: Signer
    At C:resourcefilesinstall.ps1:19 char:1
    + Install-SitecoreConfiguration @certParams -Verbose
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration
    Install-SitecoreConfiguration : No matching commands include a parameter named \’Signer\’. Check the spelling of the
    parameter name, and then try again.
    Parameter name: Signer
    At C:resourcefilesinstall.ps1:19 char:1
    + Install-SitecoreConfiguration @certParams -Verbose
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration
    [TIME] 00:00:01
    **********************
    Windows PowerShell transcript end
    End time: 20171028150629
    **********************

  13. Hi everyone, thanks for all of the comments.
    Yes, the cmdlet provided in the SitecoreFundamentals module called New-SignedCertificate does have a dependency on the pki module and more specifically the New-SelfSignedCertificate cmdlet. This cmdlet has a different parameter set in Windows 8.1/Server 2012 R2 vs Windows 10/Server 2016 – the -Signer parameter is one of the discrepancies. My install was on a Windows 10 machine so it didn\’t run into this problem. Let me look into this to find a workaround as we\’ve run into this issue internally as well and perhaps another blog post might show up to help resolve it. Thanks!

  14. Ken, I was using Kam\’s SIF-Less install and I found that I was getting the same error it had to do with timing I think because it applies a schema and restarts it and then tries to access it and likely solr is not back up yet. I tried running the script in powershell with a breakpoint on the line Install-SitecoreConfiguration @solrParams
    in the SIF-Less scripts and then hit F10 to step into. Slowing it down like this made it work for me. I am thinking the debugger slowed it down so it had time to restart. Not 100 sure though.

  15. @Ken – I was also getting this error (Install-SitecoreConfiguration : Could not find Solr instance: https://localhost:8983/solr) while my Solr was working fine in a browser as well. Finally noticed in a browser it was redirecting to https://solr:8983/solr (solr instead of localhost) – changed the value for \”$SolrUrl at the top of my install.ps1 accordingly, and got past that line

  16. any help on below issue:-
    Install-SitecoreConfiguration : error processing commands
    At C:\sitecore-Insall-Framework\install.ps1:82 char:1
    + Install-SitecoreConfiguration @xconnectParams
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration
    [TIME] 00:03:12
    Transcript stopped, output file is C:\sitecore-Insall-Framework\xconnect-xp0.180519 (2).log
    Invoke-ManageSolrSchemaTask : error processing commands
    At C:\Program Files\WindowsPowerShell\Modules\SitecoreInstallFramework\1.2.1\Public\Install-SitecoreConfiguration.ps1:253 char:21
    + & $entry.Task.Command @paramSet | Out-Default
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-ManageSolrSchemaTask

  17. When you run solr as a service, it should have -f in the command like this:
    “C:\Program Files\solr-6.6.1\bin\solr.cmd” start -f -p 8983

Leave a Reply

Your email address will not be published. Required fields are marked *

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

George Chang

More from this Author

Categories
Follow Us
TwitterLinkedinFacebookYoutubeInstagram