Welcome! This is my personal blog about Web technologies, software development, open source and other related topics
The ideas and opinions expressed here are solely mine and don't represent those of others, either individuals or companies.The code snippets or references to software products or analogous are to be used without any warranty of any kind. If you enjoy the content, feel free to share it and re-use it as long as you provide a link to the original post.
Create a Blob Container – ngx-translate and create new Virtual Directory i18n
Blob Container and folder name can be any other name. You need to configure this correctly in UI config.See this in later steps
Upload the translation file(optional)
Translation file should be created by Headstart Api while seeding the marketplace further in this blog. This is a test to check if the resource is available. I have attached en.json file here.
Copy URL of the file and check if this is accessible-
Looks like cannot access.
To resolve this error set public access level on Blob container “ngx-translate”
Select Public read access for container and blobs-
Now the resource should be accessible.
Similarly upload resources for fr and jp language.
The resource file should be available in following location – headstart\src\Middleware\src\Headstart.API\wwwroot\i18n
Most of the organisation now want to setup their development environment using docker but if you are currently not considering contanerisation this blog will help you install the Sitecore 10.3 in your local machine.
To install XP Single Developer(XP0) 10.3 on development machine, follow the steps in this blog post
Use the Sitecore Installation Guide for hardware, OS, database and other software requirements
1. Extract downloaded XP Single Developer package to a folder e.g.:- C:\SCInstallation\XP103 2. Extract XP0 Configuration files 10.3.0 rev. 008463.zip in same folder
3. Copy license to the e.g. – C:\SCInstallation\XP103 folder
Install prerequisites before installing XP 10.3
Switch to the installable e.g.:- C:\SCInstallation\XP103 folder and execute following script
1. Create a SOLR folder e.g.:- C:\SOLR and switch to e.g.- C:\SCInstallation\XP103 folder. Open Solr-SingleDeveloper.json file.
2. Change the Install Root for SOLR in Solr-SingleDeveloper.json – DefaultValue if your SOLR installat location is different
"SolrInstallRoot": {
"Type": "String",
"Description": "The file path to install Solr. This config will add the prefix and solr version e.g C:\\Solr becomes C:\\Solr\\[SolrServicePrefix]Solr-8.11.2",
"DefaultValue": "C:\\SOLR"
},
Hopefully this should install successfully on local machine. But if you see any errors below are resoultion to few of the issues I got during installation.
Error while installation
xconnect Marketing Automation fails to start-
Solution–
Disable TLS 1.3 over TCP for xconnect. Rerun the installation script or disable this as soon as the xconnect bindings are setup by script during installation.
Copy the instance xconnect certificate to the “Trusted root..” folde. In my case this is the certificate
Check that trusted root does not contain non-self-signed certificates using the following PowerShell script:
Check if the Asp.Net options in Windows features – Internet Information Services.
Error: .Net SqlClient Data Provider: Msg 12809, Level 16, State 1, Line 5 You must remove all users with password before setting the containment property to NONE.
Follow below steps to configure Sitecore Ordercloud Headstart middlewarewithout having to provision Azure online resources. i.e. setup offline Azure resources
Install Azurite- Pre-requisite is to install node js
npm install -g azurite
Run Azurite- Navigate to the folder where the supporting files should be deployed e.g.: c:\Azurite
azurite start
OR - if you want specfic folder and in debug mode
azurite --silent --location c:\azurite --debug c:\azurite\debug.log
Blob service should listen to http://127.0.0.1:10000
Step 2 – Install Microsoft Azure Storage Explorer
Install Azure storage explorer. Download from here
Step 3 – Configure Blob Containers
Connect to Local Azure Storage
Click on the connect to open the connection dialog box
Select the Local storage emulator
Fill in the required details
Display name
Account name – this wil be used to connect to the blob storage
Blobs port- port used to connect to the vlob storage
Queues and Tables port- port used to connect queues and tables respectively
These are the connection information (you might have to note this)-
Local account is created-
Storage Explorer is now able to conect to Local Storage Emulator i.e. Azurite
Create a Blob Container – ngx-translate and create new Virtual Directory i18n
Blob Container and folder name can be any other name. You need to configure this correctly in UI config.See this in later steps
Upload the translation file
Ideally Container, Virtual Directory and trnslation file should be created by Headstart Api. I couldn’t make it work. Hence alternative this I have attached en.json file here.
Once uploaded you should be able to see the uploaded file-
Set Public Access Level to Blob Container
Select the Public read access for containers and blobs
Configure CORS settings
CORS settings are required for accessing the en.json file to access from the local blob storage
Navigate to – /sitecore/system/Settings/Services/API Keys
Create a new API Key e.g.:- nextjsservice
API key here is Item ID
Create a custom binding-
For this create a self signed certificate with a custom domain name in this case – next-jss-prj.dev.local
New-SelfSignedCertificate -CertStoreLocation C:\certificates -DnsName "next-jss-prj.dev.local" -FriendlyName "My First Next JSS App" -NotAfter (Get-Date).AddYears(10)
Create a new https binding and assign the newly create SSL certificate
Add domain to the host file – next-jss-prj.dev.local
Inititate JSS
Run the command
npm init sitecore-jss nextjs
Where would you like your new app created? C:\projects\nextjs Initializing ‘nextjs’… What is the name of your app? next-jss-prj.dev.local What is your Sitecore hostname (used if deployed to Sitecore)? next-jss-prj.dev.local How would you like to fetch Layout and Dictionary data? REST How would you like to prerender your application? SSG Would you like to include any add-on initializers? nextjs-styleguide – Includes example components and setup for working disconnected Initializing ‘nextjs-styleguide’… Which additional language do you want to support (en is already included and required)? da-DK
Setup JSS
jss setup
Is your Sitecore instance on this machine or accessible via network share? [y/n]: y Path to the Sitecore folder (e.g. c:\inetpub\wwwroot\my.siteco.re): Invalid input. Path to the Sitecore folder (e.g. c:\inetpub\wwwroot\my.siteco.re): C:\inetpub\wwwroot\xp102sc.dev.local Sitecore hostname (e.g. http://myapp.local.siteco.re; see /sitecore/config; ensure added to hosts): next-jss-prj.dev.local Invalid input. Must start with http(s) Sitecore hostname (e.g. http://myapp.local.siteco.re; see /sitecore/config; ensure added to hosts): https://next-jss-prj.dev.local Sitecore import service URL [https://next-jss-prj.dev.local/sitecore/api/jss/import]: https://next-jss-prj.dev.local/sitecore/api/jss/import Sitecore API Key (ID of API key item): {2318A20A-6DF1-4AB8-B49E-F933A3B79160} Please enter your deployment secret (32+ random chars; or press enter to generate one):
Deployment secret– Leave this blank as this will generate new secret key
Deployment secret key is generate and stored in <<jss development folder>>\sitecore\config\next-jss-prj.deploysecret.config
JSS connection settings saved to scjssconfig.json
Connection and the deployment secret is created, now this needs to be deployed to Sitecore instance so the JSS app is able to establish a connection with Sitecoore
To deploy the config setting deploy the config to Sitecore instance-
jss deploy config
Configs are copied to Sitecore instance App_Config\Include\zzz…
Deploy the artifacts to Sitecore instance-
Since we don’t know hte thumbprint use the below command with –acceptCertificate as test
jss deploy app –includeContent –includeDictionary –acceptCertificate test
This will provide the thumbprint. highllighted in red
if you see this error while importing – Message: An item name must satisfy the pattern: ^[\w*\$][\w\s-\$]*((\d{1,})){0,1}$ (controlled by the setting ItemNameValidation)
Change the ItemnameValidation to .* while importing and revert back to original in Sitecore.config file. Refer this –
Execute following command to get this working on port 3000
$env:NODE_TLS_REJECT_UNAUTHORIZED=0
Execute JSS start again-
jss start:connected
ERROR-
Connection to your rendering host failed with a Not Found error. Ensure the POST endpoint at URL http://localhost:3000/api/editing/render has been enabled.
Copy the deploy secret and update the – value of setting of JavaScriptServices.ViewEngine.Http.JssEditingSecret in Sitecore.JavaScriptServices.ViewEngine.Http with the deploy secret.
This now work in connected mode. Any content changes in Sitecore should reflect localhost:3000 and Sitecore instance (https://next-jss-prj.dev.local/)
Sitecore next js working in connected mode with SSL
Error-
Exception thrown while importing JSS app Exception: System.UnauthorizedAccessException Message: The current user does not have write access to this item. User: sitecore\JssImport, Item: ContentBlock ({23CE8001-F405-5E50-AE61-AD3057660BBD}) Source: Sitecore.Kernel
Resolution-
Error-
Resolution-
Check if the API key is correct at the location – /sitecore/system/Settings/Services/API Keys
Also check if the CORS and Allowed Controllers are set correctly
For developement environment put * for both the highlighted fields
1. Extract downloaded XP Single Developer package to a folder e.g.:- C:\SCInstallation\XP102 2. Extract XP0 Configuration files 10.2.0 rev. 006766zip in same folder
Install prerequisites before installing XP 10.2
Switch to the installable e.g.:- C:\SCInstallation\XP102 folder and execute following script
1. Create a SOLR folder e.g.:- C:\SOLR and switch to e.g.- C:\SCInstallation\XP102 folder. Open Solr-SingleDeveloper.json file.
2. Change the Install Root for SOLR in Solr-SingleDeveloper.json – DefaultValue
"SolrInstallRoot": {
"Type": "String",
"Description": "The file path to install Solr. This config will add the prefix and solr version e.g C:\Solr becomes C:\Solr\[SolrServicePrefix]Solr-8.4.0",
"DefaultValue": "C:\\SOLR"
},
Disable TLS 1.3 over TCP for xconnect. Rerun the installation script or disable this as soon as the xconnect bindings are setup by script during installation.
No registration for extension ‘AppPool’ of type ‘Task’
Solution
Check if the Asp.Net options in Windows features – Internet Information Services.
After installation Restart the machine, this should enable the Hyper-V feature
This should also have Docker running and should see the same in system tray
Switch to Windows containers
Right click on Docker icon and switch to Windows Container. See this link for more details as per guide
Download and Prepare for installation
Download and extract the Sitecore Container Deployment Package from the Sitecore Developer Portal and store it on your local workstation or check releases here
Copy and extract SitecoreContainerDeployment.10.1.0.005207.309.zip for e.g:- C:/sc101_install
Navigate to C:\sc101_install\compose\ltsc2019\xp0
Open .env file, we need to fill in this parameters before starting installation. You can find more details in guide for each option.
Download PowerShell script to initialize (init.ps1) the parameters from docker-examples. Parameter values in .env can be populated manually by individually executing the commands for required for each parameter in guide(see Appendices) but I would recommend to use init.ps1 as this is provided by Sitecore and hence tried and tested.
Folder structure should look like this-
Change parameter values in init.ps1 file.
Change the SitecoreAdminPassword, SqlSaPassword and host entries as per requirement. If you are changing host entries also ensure the same is updated in .env file for CM_HOST and ID_HOST parameters. Lets keep the default values.
Populate .env file using init command
Open PowerShell as a Administrator, navigate to the folder having init.ps1 file.
Execute init.ps1 script. You may have to set the execution rights to current user to execute the script-
1. Switch to e.g.- sc101_install folder. Open Solr-SingleDeveloper.json file
2. Change the Install Root for SOLR – DefaultValue
"SolrInstallRoot": {
"Type": "String",
"Description": "The file path to install Solr. This config will add the prefix and solr version e.g C:\Solr becomes C:\Solr\[SolrServicePrefix]Solr-8.4.0",
"DefaultValue": "C:\SOLR"
},
Hope the installation completes without any issues
Post Installation activities
Rebuild the search indexes and the Link database After you install Sitecore Experience Platform, you must rebuild the search indexes and rebuild the Link databases.
To rebuild all the indexes:
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.
To rebuild the Link databases for the Master and Core databases:
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
Uninstall Sitecore Instance
To uninstall Sitecore instance uncomment the Uninstall command in XP0-SingleDeveloper.ps1 file. Comment the install command-
If you are looking for upgrade to Sitecore 10, below are the various options you are able to install Sitecore 10.
Sitecore XP 10
Sitecore Installation Assistant (SIA)
Sitecore Installation Assistant helps guides you through the Sitecore XP Developer Workstation installation. Use this option to review system requirements, install prerequisites and complete the entire installation process. With Sitecore 10 you have a option to also install SXA with SIA.
Sitecore Install Framework (SIF) is a Microsoft PowerShell module that supports local and remote installations of Sitecore Experience Platform.
SIF deploys Web Deploy Packages (WDP) by passing parameters to SIF configuration through a Microsoft PowerShell module and is fully extensible. The Sitecore Experience Platform is designed to be secure-by-default. For developer environments all the required self-signed certificates are created automatically if you do not provide any. In a production environment, you can provide your own certificates In a non-production environment, you can choose to have the module generate the certificates for you.
You must set up SIF before you can install Sitecore Experience Platform
Sitecore Containers support rapid deployment and more efficient solution and team onboarding with modern Docker and Kubernetes technology.
Sitecore Experience Platform 10.0.0 uses Docker Compose as the container orchestrator on developer workstations. Docker Compose is a simple containerdeployment tool that is bundled with Docker for Windows. Sitecore container images can be deployed with other tools but we recommend that you use Docker Compose to deploy the containers that form the Sitecore Experience Platform.
One of the highlights of newly released Sitecore Experience Platform (10.0) is that it brings support to rapid deployment and more efficient solution and team onboarding with modern Docker technology i.e. Sitecore Containers.
To know more about containers here is the official documentation from Sitecore on Containers
Lets get started to create a Sitecore XP 10 development environment using docker.
After installation Restart the machine, this should enable the Hyper-V feature
This should also have Docker running and should see the same in system tray
Switch to Windows containers
Right click on Docker icon and switch to Windows Container. See this link for more details as per guide
Download and Prepare for installation
Download and extract the Sitecore Container Deployment Package from the Sitecore Developer Portal and store it on your local workstation
Login to Sitecore portal before download
Copy and extract SitecoreContainerDeployment 10.0.0 rev. 004346-027.zip for e.g:- C:/SitecoreXPDocker
Navigate to C:/SitecoreXPDocker/ltsc2019/sitecore-xp0
Open .env file, we need to fill in this parameters before starting installation. You can find more details in guide for each option.
Download PowerShell script to initialize (init.ps1) the parameters from docker-examples. Parameter values in .env can be populated manually by individually executing the commands for required for each parameter in guide(see Appendices) but I would recommend to use init.ps1 as this is provided by Sitecore and hence tried and tested.
Folder structure should look like this-
Change parameter values in init.ps1 file.
Change the SitecoreAdminPassword, SqlSaPassword and host entries as per requirement. If you are changing host entries also ensure the same is updated in .env file for CM_HOST and ID_HOST parameters. Lets keep the default values.
Populate .env file using init command
Open PowerShell as a Administrator, navigate to the folder having init.ps1 file.
Execute init.ps1 script. You may have to set the execution rights to current user to execute the script-