Skip to content

Upgrade Sitecore.CLI in Sitecore 10.2 JSS with Docker

Posted in :

rbatallas

In order to migrate to Sitecore.CLI 5.2.109 or greater over docker, we need to do the following steps:

SITECORE CLI

Open the backend folder project with a power shell terminal

Run the following command:

dotnet tool update sitecore.cli --version 5.2.109

Then, after the upgrade is done run the following command for initializing the plugins

dotnet sitecore plugin init

Now, let’s verify the upgrade with the following command

dotnet sitecore --version

And finally, we need to update sitecore.json file, so, run the following command to do it

dotnet sitecore init

If you want to validate the new plugins installed, run this command

dotnet sitecore plugin list

With these simple steps, you can upgrade the Sitecore CLI in your project, but also, in order to complete the upgrade you need to upgrade the Sitecore Management Services

SITECORE MANAGEMENT SERVICES

Down your containers if are running.

Open the directory .\run and over each folder like xm1 or xp0 , you need to modify the .env file in each one

Open the .env file and modify or replace the variables

  • MANAGEMENT_SERVICES_IMAGE
  • HEADLESS_SERVICES_IMAGE

Replace the lines with the following ones:

MANAGEMENT_SERVICES_IMAGE=scr.sitecore.com/sxp/modules/sitecore-management-services-xp1-assets:5.2.109-1809
HEADLESS_SERVICES_IMAGE=scr.sitecore.com/sxp/modules/sitecore-headless-services-xp1-assets:20.0.2-1809

Go to this directory .\docker\build\cm and open the Dockerfile and verify if the following instruction in on it, otherwise add it:

# Copy the Sitecore Management Services Module
COPY --from=management_services C:\module\cm\content C:\inetpub\wwwroot

And finally, start again your containers and that is it, you will see that the new images are downloaded.

Hope I can help you with it.

Happy coding 🙂

Leave a Reply

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