Tagged: Sitecore 10.2

Sitecore Serialization: Rapid CLI Setup and Configuration

 

The Sitecore Command Line Interface (CLI) is a developer tool that provides a command-line interface to interact with Sitecore instances for serializing templates, layouts, and renderings.

Let’s explore the installation and Configuration on Sitecore 10.x.

Prerequisites: 

Preparation:

  • Download Sitecore Management Services
    • I picked the latest version Sitecore CLI 4.1.0 (compatible with Sitecore 10.1 and 10.2)

Installation:

  • Login to Sitecore 10.2 CM instance, navigate to Control Panel, and Install a package.

  • Accept the Terms and Conditions

  • Installation was throwing the below error – Access to the path is denied

After researching, came to know the IIS permission is missing for the CM instance.

Once the instance is up and running, run the below command in PowerShell to get into the C:\inetpub\wwwroot folder of the instance.

Run the below command to resolve the issue. It takes some time, and you can get a coffee!

icacls.exe 'C:\inetpub\wwwroot' /grant 'IIS_IUSRS:(F)' /t

Now that the permissions are all set, I installed the package and it’s succeeded!

Let’s install the Sitecore CLI – 

  • Run the below commands in the Sitecore project CD folder.

dotnet new tool-manifest
dotnet nuget add source -n Sitecore https://sitecore.myget.org/F/sc-packages/api/v3/index.json
dotnet tool install Sitecore.CLI

  • To initialize a new project, run the below command.

dotnet sitecore init

Note: Starting from 4.1.0, the sitecore init command takes care of installing default plugins (Sitecore.DevEx.Extensibility.SerializationSitecore.DevEx.Extensibility.PublishingSitecore.DevEx.Extensibility.Indexing, and Sitecore.DevEx.Extensibility.ResourcePackage). 

Skip the below step if you are installing Sitecore CLI 4.1.0 or above.

  • Install the plugins.

dotnet sitecore plugin add -n Sitecore.DevEx.Extensibility.Serialization
dotnet sitecore plugin add -n Sitecore.DevEx.Extensibility.Publishing

 To see what plugins are installed, run the below command.

dotnet sitecore plugin list

Let’s log in –

Run this command in Powershell.

dotnet sitecore login --authority https://<Sitecore identity server> --cm http://<Sitecore instance> --allow-write true

It will open a Sitecore identity server URL in a browser to authenticate.

It’s successfully logged in, explore (push, pull, and publish to database) Sitecore CLI.

  • sitecore login: Authenticate with the Sitecore instance.
  • sitecore ser pull: Pull serialized items from the Sitecore instance.
  • sitecore ser push: Push serialized items to the Sitecore instance.
  • sitecore publish: Publish content changes.

Happy Sitecoring!

0

Install Sitecore 10.2 using Docker in 5 Easy steps!

 

Happy New Year! I just thought trying out Sitecore 10.2 using Docker. Installed it with minor hiccups. Let’s share my experience.

Prerequisites:

  •  Sitecore 10 license.
  • OS: Windows 10 1903 or later.
  • Docker Desktop for Windows.
  • 32 GB of RAM (It can be 16 GB for XM1 or XP0). I always recommend 32 GB for better experience.
  • CPU: Quad-core processor or higher.
  • Disk: 25 GB free space.

Preparation:

  • The following ports needs to be available for containers

The following ports need to be available for running the Docker instance. Make sure you are using stopping the services so it’s available for Docker to consume.  

Note: Always use iisreset /stop in the command line rather than stopping it in IIS. 

  • To check the port availability, run the following in PowerShell. It shouldn’t return any process. 

netstat -ano | findStr 127.0.0.1:443

netstat -ano | findStr 8079

netstat -ano | findStr 8984

netstat -ano | findStr 14330

Installation:

  1. Extract the file zip file downloaded into Sitecore_10.2(or any folder name).

             

      2. Execute this command to set the execution policy unrestricted.

Set-ExecutionPolicy -Scope CurrentUser Unrestricted

       3. Navigate to XP1 folder (Sitecore_10.2\SitecoreContainerDeployment.10.2.0.006766.683\compose\ltsc2019\xp1) in PowerShell and run compose-init.ps1 script.

.\compose-init.ps1 -LicenseXmlPath <License Path>

  • Note: I’m installing XP1, If you want XP0, navigate to XP0 folder and follow the same exact steps.   

    4. Run docker-compose pull

docker-compose pull

      5. Run docker-compose up (It takes some time, you can get a coffee!)

docker-compose up –d

Once it’s done, let’s bring in CM instance – 

https://xp1cm.localhost/sitecore

Login as admin using ‘Password12345‘ password (not b though)

It’s so cool see the new desktop view! Cool work Sitecore!

It’s time for CD instance – 

https://xp1cd.localhost/

 

Errors and Resolutions:

If you get unhealthy for any nodes, don’t worry. It’s very common, I get this most times. 

Run the following in PowerShell, It should fix it. Thank you Sitecore Staff Exchange!   

docker-compose down

iisreset /stop

docker-compose up –d

 

To check if all nodes are healthy, run docker-compose ps 

If you want to change the Sitecore and/or SQL password, you can change it in docker-compose.ps1 file. 

Hope this helps someone. Happy Sitecoring!

3