Tips And Tricks While Upgrading Sitecore Docker Solution

Hello everyone, I would like to share my experience while upgrading Sitecore 10.1 SXA to Sitecore 10.3 SXA. Our solution was based on Docker, so will try to provide some quick tips for the same. Also will provide some docker commands, that were really helpful during the upgrade process.

I will divide the blog section into 2 parts, one for local upgrade and another for higher environment upgrade.

Local Upgrade

Step 1: Navigate to Sitecore 10.3 download page. Download the container based package.Also download the upgrade guide form there. Once downloaded, you will get below folder structure. Here

Below image has detail for how to upgrade the Database. The two important file is docker-compose-upgrade.yml and upgrade.env file. In local we can run this component directly by below command. Just fill the upgrade.env with your local instance. But for local, instead of upgrading, go with new instance. Add all module as layer in your docker image files. Then you can restore your content items using package or through serialization.

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

You can refer the below image for updating your old images with the 10.3 docker compose file if you are having your own structure created for your solution.

Step 2: Once updated all environment related data in your .env file, you can run the composite.init powerShell script. You can refer below docker command for your reference. You can also refer Sitecore installation guide for docker for more clarity what each file is performing.

       
       .\compose-init.ps1 -Topology "{Toppology)}" -LicenseXmlPath "{path of license file}" -IdHost {custom_Id_host_name} -CdHost {custom_cd_host_name} -CmHost {custom_cm_host_name} -SitecoreAdminPassword {your_password_for_Sitecore_admin} -SqlSaPassword {your_password_for_sql_sa_user}
	   

Step 3: Navigate where your docker-compose.yml file is there and run docker compose up command in detach mode.

       
       docker-compose up -d
	   

To check the version or tags used for your Sitecore images, you can visit here. Select raw files from the page. It will list the tags used for all sitecore modules available. For 10.3 we use identity sever 7 as shown below

You can see, now, that your instance should be up now. Add your content items.Populate your Solr schema.Build your Solr indexes.Rebuild your link databases.

Step 4:Now upgrade your solution dll files. Build your solution and deploy your solution.Now verify your website. You can refer my blog for how to upgrade solution files Here

Environment Upgrade

Step 1: Update your images required for your Sitecore version. mssql-upgrade image as layer to your existing docker file.Once database is upgraded, you can removed this layer from your compose file.

Step 2: Run the Database clean up task. You can find how to perform it Here

Step 3: Deploy your solution and test your website. One important thing, we encountered is that the upgrade continer guide is given by Sitecore does not define clear steps for local upgrade. That's why better go with clean vanila instance.

Below are use full docker commadn which will come handy during upgrade process.

       
# To verify what directory is there inside sitecore-xp1-mssql-upgrade image
docker run -it -e Database_Upgrade_From_Version="10.1.0" -e Database_Upgrade_To_Version="10.3.0" --entrypoint "powershell" scr.sitecore.com/sxp/sitecore-xp1-mssql-upgrade:10.3-ltsc2019 

# Download whole folder structure from container
docker cp {container-id}:/data C:/{folder name}

# Run a particular image and check the folder structure
docker run -it --rm  
	   

Note: Always have a clean vanila instance downloaded in your directory from CM conatiner before deploying your solution. Create a New Sitecore SXA tenant and website for referencing if any missing item in 10.3. Once completed, delete that site and tenant.

Error Encountered

1: Identity Server throwing 404 : Here

2: Scriban object sc_beginfield sc_endfield not supporting link text from general link field in 10.3 be default : Created custom scriban link field object. To know, how we can create a custom scriban object Here

3. Redirect Not Working : Verify two steps, The Redirect Mapping Grouping template should be replace with Redirect Maps while creating Redirect Folder under Settings.Change the Datasource of Redirect Map item from feature to foundation for Redirect Enums.

3. Sitemap XML Not Working : Verify the _SiteMapSettings template and check SiteMapMode is pointing to right datasource(/sitecore/system/Settings/Foundation/Experience Accelerator/SiteMetadata/Enums/SitemapStatus). In 10.3 we have to create Sitemap item inside settings folder to generate proper sitemap for the site.

Hope you will get some information for next Sitecore upgrade. Thanks for reading. Happy Learning!!

You can check my other blogs too if interested. Blog Website

Comments

Popular posts from this blog

Sitecore XM Cloud Form Integration with Azure Function as Webhook

Automate RSS Feed to Sitecore XM Cloud: Logic App, Next.js API & Authoring API Integration

Create and Fetch Content From Sitecore Content Hub One using GraphQL and React