1. Upgrade

Modules upgrade

Version: 10.5

To upgrade a Sitecore solution that has some modules installed, you must build custom mssql- upgrade image.

To build custom mssql-upgrade image, you must download the latest Sitecore XP, XM mssql-upgrade image from the container registry and create a custom Docker file on top of it.

The Sitecore XP, XM mssql-upgrade image contains configuration presets for each of the available upgrades paths.

If a module requires you to run SQL scripts, you must modify the corresponding configuration file.

The name of the configuration files has the following pattern: <DatabaseUpgradeFromVersion>-<DatabaseUpgradeToVersion>.json.

All the configuration files have the same structure:

database.png

If a module requires you to execute some custom SQL scripts, you must store the scripts in the C:\data\DatabaseUpgradeScripts\<DatabaseUpgradeToVersion>\<custom SQL scripts> folder.

To enable the mssql-upgrade container to run the script:

  1. Create a powershell script that modifies the C:\data\<DatabaseUpgradeFromVersion>-<DatabaseUpgradeToVersion>.json file.

    The script must add your instruction to the <DatabaseUpgradeFromVersion>- <DatabaseUpgradeToVersion>.json file which is going to run sql statements to modify the databases.

  2. Save the configuration with your modifications.

  3. In the Dockerfile, add a URL command that downloads the Items as Resources packages for the modules.

  4. Extract the Items as Resources files from the downloaded module to a temporary folder.

    The package for each module contains folders for the different versions of the module.

  5. Select the Sitecore version from which you are going to upgrade and copy the content of the Data folder for the module version you are upgrading from into the C:\data\ResourceItems\<DatabaseUpgradeFromVersion>\modules\ folder.

  6. Build a custom mssql-upgrade image.

You can now run the mssql-upgrade container and use the custom upgrade image that you have just built.

To run the mssql-upgrade container with a custom image for Docker compose:

  1. Update all the required parameters in the upgrade.env environment variable file.

    Modify the docker-compose.upgrade.yml file to use the image you built earlier and update the value of the image node with your image:

    image: <custome mssql-upgrade image>

  2. To run the mssql-upgrade container, use the following Docker Compose command:

    docker compose -f .\docker-compose.upgrade.yml --env-file .\upgrade.env up

To run the mssql-upgrade container with a custom image for Kubernetes:

  1. Update the secrets .txt files in the ./configuration folder.

  2. Modify the K8s specification files to use the image you built earlier and update the mssql-upgrade.yaml, kustomization.yaml file.

  3. From the root folder of the desired topology, run the following command:

    kubectl apply -k .\

If you have suggestions for improving this article, let us know!