The new version of Sitecore includes lots of new features and some important updates as well. Some of these changes require sensible server modifications.
For example, the index engine Lucene isn’t supported anymore. This induces the installation of SOLR. Instead of describing each of these solutions, we decided to write a whole tutorial to guide you through these several steps.
Sitecore provides different tools to upgrade your instance easily. This following tutorial show you an easy way to use them and getting your sitecore server ready to rock this version !
Before that, juste make sure to fasten your seat belts, and to install these needed softwares :
Prerequisites
- Windows Powershell version 5.x
- Sitecore license xml file
- MS SQL Server version 2016 (NOT 2017 since it still not supported by Sitecore yet)
- MS SQL Management Studio
- Note: Please ensure the SQL Server is enabled the mixed mode authentication: SQL Server and Windows Authentication mode.
- Java Environment (SDK and JRE) version 8.x
- Web deploy version 3.6
- https://www.microsoft.com/en-us/download/details.aspx?id=43717&tduid=(5d6efda7355a410148cd4206fb33ab3b)(152407)(1806294)(725X175X56c4ef9d4b99a35fedb1ce7809df917c)()
- Note: Please check the compatible table from Sitecore: https://kb.sitecore.net/articles/087164
Let’s go !
STEP 1 Setup and Install required components
Setup Environment variables
Go to My Computer and open Environment Variables as figure below
Add new two environment variables into the list as figure below:
Update the PATH variable:
Click OK to confirm.
Note: We have two separate variables:
- The JAVA_HOME path, where is the Java SDK, installed by download it from Oracle Java website.
- The JRE_HOME is the place of the Java Runtime Environment installation folder
Note:
- Please download both SDK and JRE for ensuring the SOLR can work properly. Download here:
- http://www.oracle.com/technetwork/java/javase/downloads/index.html
- You need to ensure that all files which have been downloaded need to be unblock.
Install SOLR
- Download SOLR version 6.6.2 from the url below which has been fixed the critical lock issue
- Extract it into a specific folder such as D:\solr-6.6.2
- Download the NSSM tool from the link: https://nssm.cc/download
- Note: You can use the pre-release version number 2.2.4-101 to avoid an issue with services failing to start.
- Extract and get the nssm.exe file
- Put it into the same bin folder of the installation SOLR folder:
- Open Command Prompt (run as an Administrator)
- Go the SOLR bin folder as above:
- Type: nssm install solr_6.6.2
- Click on Install service button for installing the Solr windows service
Note: Please turn off all Solr console instance if there is any instance running before we install solr run as a windows service to avoid conflict.
When the SOLR being installed successfully you can access it as figure below:
Setup SSL for SOLR
Download the solrssl.ps1 from the link
Many thanks Kam Figy (https://kamsar.net/index.php/2017/10/Quickly-add-SSL-to-Solr/)
Put it into a specific folder such as: D:\sc9\solrsslconfiguration
Open Windows PowerShell (run as Administrator)
Execute the command line:
Set-ExecutionPolicy -Scope CurrentUser Unrestricted
Press A to allows we can execute script without any problems about the permissions.
Execute command .\solrssl.ps1 as figure below:
Copy two files above and put them in the SOLR installation folder \server\etc folder
Open the solr.in.cmd (this is the configuration as input parameters of SOLR), adding all lines as in the figure put them into the end of file.
Restart the solr_6.6.2 service and now you have to browse the solr admin tool with the https protocol.
Installing the Sitecore Installation Framework
- Launch PowerShell under Administrator right.
- Using Windows PowerShell to install by followings ordering command line: Register-PSRepository -Name SitecoreGallery -SourceLocation https://sitecore.myget.org/F/sc-powershell/api/v2. Note: This command line setup a repository specific to Sitecore
- Install the Sitecore Installation Framework by Powershell: Install-Module SitecoreInstallFramework
- When prompt to install, approving it by press Y and then press ENTER to confirm. Note: If you have installed the Sitecore Installation Framework so you only need to update the latest version of the Sitecore Installation Framework by executing the command line: Update-Module SitecoreInstallFramework
Enable Contained Database Authentication
To enable the SQL server to allow the creation of users when using the Sitecore Installation Framework, you must ensure that the target SQL Server is configured correctly. To configure the target SQL Server to allow users and logins to be contained at the database level:
- Launch MS SQL Server Management Studio and log in as an administrator.
- Run the following Query:
- sp_configure ‘contained database authentication’, 1;
- GO
- RECONFIGURE;
- GO
STEP 2 Installing the Sitecore version 9.1 Update 1
- Go the link: https://dev.sitecore.net/Downloads/Sitecore_Experience_Platform/90/Sitecore_Experience_Platform_90_Update1.aspx
- Download appropriate installation package.
Note:
We install all in one server with full features so we must choose XP Single otherwise for scaled clustering servers such as multiples CDs, CMs and separate database and xDB servers then we have choose XP Scaled.
XM package is the package only available for Content Management system without xDB as well as Marketing module.
3. Unzip it into an individual folder (in the sample we have used D:\SC9\Configuration)
Note: Please Unblock those files for ensuring it allows to run on the server.
4. Unzip XP0 Configuration files 9.0.1 rev.171219.zip and copy and paste all files into the D:\SC9\Configuration:
5. Get three files sitecore-XP0.json, xconnect-XP0.json and sc91_install.ps1 from the place: https://github.com/toanvo/AzureCutomization
Note: Please check and unblock those files.
Copy and overwrite two files: sitecore-XP0.json, xconnect-XP0.json.
Open sc91_install.ps1 script and modify values of parameters in that file:
Execute it by launch Windows PowerShell as Administrator:
After you setup successfully then you can launch the Sitecore website. However, we are still one step to wrap up everything.
STEP 3 Post installation (Configuration for xDB)
1. Configure username and password:
(1) Launch MS SQL Server Management Studio and login as an administrator
(2) Open a new query windows, paste the script below
:SETVAR DatabasePrefix sc91 :SETVAR UserName collectionuser :SETVAR Password Test@12345 :SETVAR ShardMapManagerDatabaseNameSuffix _Xdb.Collection.ShardMapManager :SETVAR Shard0DatabaseNameSuffix _Xdb.Collection.Shard0 :SETVAR Shard1DatabaseNameSuffix _Xdb.Collection.Shard1 GO IF(SUSER_ID('$(UserName)') IS NULL) BEGIN CREATE LOGIN [$(UserName)] WITH PASSWORD = '$(Password)'; END; GO USE [$(DatabasePrefix)$(ShardMapManagerDatabaseNameSuffix)] IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N'$(UserName)') BEGIN CREATE USER [$(UserName)] FOR LOGIN [$(UserName)] GRANT SELECT ON SCHEMA :: __ShardManagement TO [$(UserName)] GRANT EXECUTE ON SCHEMA :: __ShardManagement TO [$(UserName)] END; GO USE [$(DatabasePrefix)$(Shard0DatabaseNameSuffix)] IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N'$(UserName)') BEGIN CREATE USER [$(UserName)] FOR LOGIN [$(UserName)] EXEC [xdb_collection].[GrantLeastPrivilege] @UserName = '$(UserName)' END; GO USE [$(DatabasePrefix)$(Shard1DatabaseNameSuffix)] IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N'$(UserName)') BEGIN CREATE USER [$(UserName)] FOR LOGIN [$(UserName)] EXEC [xdb_collection].[GrantLeastPrivilege] @UserName = '$(UserName)' END; GO
Note:
Please change the parameters (DatabasePrefix, Password) which have been bold on the script above based on your environment. Please consider the Password value has to match with the password which has been configured in the Sitecore
Turn on SQLCMD Mode for ensuring the compiler can compile the script above.
(3) Execute it.
2. Rebuild the Search Indexes and the Link Databases:
After you install Sitecore, you must rebuild the search indexes, and the Link databases by go to Control Panel inside Sitecore Administration:
a. In the Indexing Manager dialog box, click Select all, and then click Rebuild.
b. Rebuild the Link databases for the Master and Core databases.
If you follow properly these steps, your sitecore 9.1 environment should be installed, configured, and ready to be explored. Enjoy your journey !