Sitecore Docker Upgrade Sitecore CLI to 6.0.23 to enable progressiveMetadataPull

We use Sitecore CLI for content serialization and pushing content changes across various environments, including production. However, we recently encountered a strange error when attempting to push content to production. After consulting Sitecore Support, we were advised to upgrade Sitecore CLI to version 6.0.23, which introduces progressiveMetadataPull, a crucial feature for handling large amounts of data. Given that our production environment contained significantly more items than our other environments, upgrading made perfect sense.

The Upgrade Process

The upgrade instructions provided by Sitecore Support were straightforward, but since we use Docker both locally and in Azure, the process became slightly more complex. Apart from updating Sitecore CLI, we also had to upgrade Sitecore Management Services to version 5.2.33 for compatibility.

Step 1: Updating Sitecore Management Services

To begin, I needed to find the correct Docker image tag for Sitecore Management Services. I referred to the official Sitecore Docker image tags repository:

Sitecore Docker Image Tags

After identifying the required version, I updated the environment file on my local Docker instance:

From:

MANAGEMENT_SERVICES_IMAGE=scr.sitecore.com/sxp/modules/sitecore-management-services-xm1-assets:5.2-ltsc2022

To:

MANAGEMENT_SERVICES_IMAGE=scr.sitecore.com/sxp/modules/sitecore-management-services-xm1-assets:5.2.123-ltsc2022

This change ensured that the correct version of Sitecore Management Services was used in our Docker setup.

Step 2: Upgrading Sitecore CLI

Initially, we were using Sitecore CLI version 5.1.25, so I attempted a standard update:

dotnet tool update sitecore.cli

This updated the CLI to version 5.2.113, but we needed version 6.0.23 to enable progressiveMetadataPull feature. To explicitly install this version, I ran:

dotnet tool update sitecore.cli --version 6.0.23

However, I encountered an error:

Version 6.0.23 of package sitecore.cli is not found in NuGet feeds https://api.nuget.org/v3/index.json;https://sitecore.myget.org/F/sc-packages/api/v3/index.json.

After checking the documentation, I discovered that Sitecore had changed its NuGet feed URL. To resolve this, I had to register the new feed:

dotnet nuget add source -n Sitecore https://nuget.sitecore.com/resources/v3/index.json

This initially failed because a source named Sitecore already existed. To work around this, I registered it under a different name:

dotnet nuget add source -n Sitecore2 https://nuget.sitecore.com/resources/v3/index.json

With the correct feed registered, I successfully updated Sitecore CLI:

dotnet tool update sitecore.cli --version 6.0.23

To confirm the update, I ran:

dotnet sitecore --version

This output confirmed that Sitecore CLI 6.0.23 was now installed.

Step 3: Updating Plugins

After upgrading Sitecore CLI, I checked the installed plugins:

dotnet sitecore plugin list

If any outdated plugins were present, I updated them using:

dotnet sitecore plugin init --overwrite

Verifying the update again:

dotnet sitecore plugin list

This confirmed that all necessary plugins were successfully upgraded.

Step 4: Updating Environment Variables & Docker Configuration

To ensure the upgrade was reflected across environments, I updated the Sitecore Management Services image tag in all environment configuration files. Additionally, I rebuilt the Docker images and redeployed to Azure to apply these changes.

In the Dockerfile responsible for content push (e.g., docker/build/contentsync/Dockerfile), I updated the NuGet source:

From:

RUN dotnet nuget add source -n Sitecore https://sitecore.myget.org/F/sc-packages/api/v3/index.json

To:

RUN dotnet nuget add source -n Sitecore https://nuget.sitecore.com/resources/v3/index.json

With this change, the latest version of Sitecore CLI would be automatically installed when the pipeline ran.

Step 5: Testing and Final Considerations

With everything updated, I tested serialization push and pull commands to confirm it is working as expected. The deployment pipeline was also executed successfully.

Important Note:

The new version of Sitecore Serialization renames many items due to a different naming mechanism. Expect failures when running it against production for the first time. For instance:

_name.yml will be renamed to #name.yml

If you encounter issues, you can run dotnet sitecore ser validate and then dotnet sitecore ser validate –fix to fix any serialization issues.

Conclusion

Even if you are not facing this issue, I strongly recommend updating your Sitecore CLI to the latest version so that you can have it covered before it even becomes a problem. This article focuses on Docker based setup but if you are using Sitecore without docker you can follow Sitecore documentation to perform this update.

#Sitecore, #SitecoreCLI, #ContentSerialization, #Docker, #NuGet, #DevOps, #SitecoreDevelopment, #SitecoreUpdate, #CloudDeployment, #ProgressiveMetadataPull