Upgrade Sitecore XP Database to the XM

The database upgrade is one of the most important steps while upgrading the Sitecore version to the latest 10.2. Sitecore provides its upgrade guide for Sitecore experience platform 10.2 from Sitecore Experience Platform 8.1.0 or later.

Here in this blog, I have taken reference to the pdf document provided by Sitecore SC-XP-10.2.0-Upgrade-Guide and I am going to discuss only the database upgrade steps for the XM topology.

Prerequisites for upgrading:

  1. Back up the database.
  2. Download the Sitecore 10.2.0 rev. 006766 (upgrade files).zip It contains:
    • Database Upgrade Script.zip - contains the SQL scripts that upgrade the database schemas and data.
    • MarketingDefinitionsUpgrade.zip – contains the .aspx pages that help you prepare your marketing definitions for the upgrade from Sitecore XP 8.x.
  3. Download the tools Sitecore.UpdateApp 1.2.0 for Sitecore X.X.X rev XXXXXX.zip
  4. You should be a local admin on SQL Server.

Upgrade Database:

  1. Attach the database to the SQL server.
  2. Extract the database upgrade scripts from the Database Upgrade Script.zip mentioned in step 2 in the prerequisites section.
  3. Run the scripts against the respective database mentioned in the following table upgrade-xp-db-xm-1* If you are not using the security database and the connection strings for the core and security databases are the same, you must apply script H to the core database. Suppose you have extracted the security database from the core database and the connection strings for core and security databases are different. In that case, you must apply script H only to the security database.

Important

The scripts listed in the table must be run against the databases in the order that they are listed in the table. The scripts are:

  • Script A – CMS_core_master_web8x.sql
  • Script B – CMS_core_master_web9x.sql
  • Script C – CMS_core.sql
  • Script D – CMS_master.sql
  • Script E – CMS_web.sql
  • Script F – SXP_experienceforms_storage.sql
  • Script G – SXP_experienceforms_filestorage.sql
  • Script H – CMS_security.sql

Clean up the content databases:

Note If you are upgrading from Sitecore XP 10.1.0 or later and your solution does not contain any modules or connectors, skip this section.

Databases clean-up is a one-time operation.

The Sitecore.UpdateApp tool removes these items, if they have not been modified, from the Core, Master, and Web databases. If you have modified these items, they are not removed, and the tool adds a list of them to its log file.

The Sitecore.UpdateApp is a standalone console tool

To clean up the content databases:

  1. If you do not know the password of the admin then first reset the password of the admin. See the blog post: Reset admin password    
  2. Update connection strings with the new database name.
  3. Do not forget to update the database name in the Sitecore.IdentityServer.Host.xml file as well.
  4. On the Sitecore Launchpad, open the Control Panel, in the Database section, click Clean up databases, select all the databases, and then click Clean.
  5. Locate the Sitecore.UpdateApp 1.2.0 for Sitecore X.X.X rev XXXXXX.zip file that you downloaded earlier and extract its contents to a folder, for example, C:\Sitecore.UpdateApp.
  6. Copy the license file to the Data folder of the tool, for example, C:\Sitecore.UpdateApp\Data\license.XML.
  7. In the C:\Sitecore.UpdateApp\App_Config\ConnectionStrings.config file, and update the connections to your databases.
  8. Open a Command Prompt in the tool folder and run: 
    Sitecore.UpdateApp.exe clean

    The number of items that are removed from each database is listed in the Command Prompt window.

    upgrade-xp-db-xm-2

    Detailed information about any modified items that are skipped is written to the log files in the tool folder – \Data\logs.

  9. To clear the caches, open the <instance_url>\sitecore\admin\cache.aspx page, click Refresh and then click Clear.

Remove XP database launchpad icons from the XM database:

Sitecore does not have any simple steps or SQL script to recommend completely getting rid of all analytics and marketing items from our databases. To remove the icons under the Marketing Application, Control Panel section on the launchpad, see the blog post: Remove Launchpad Icons From Sitecore

Post-upgrade steps:

When you have finished the upgrade and upgraded any Sitecore modules that you use, and before you start using Sitecore XP, you must:

  • Clear the browser cache
  • Clean up the databases
  • Republish your website to every publishing target.
  • Rebuild all content search indexes.
  • Rebuild the link databases.
  • Clear the Queues from Core, Web, and Master databases using the following script
    1. delete from PublishQueue
    2. delete from EventQueue
    3. delete from History

User credential script for database deployment:

The following script is an example of how to specify user credentials when you deploy a database. You must update the script to match the database.

Reference: https://sitecoredev.azureedge.net/~/media/93CC3A931DB7459AAC38BA111E0DD16D.ashx?date=20211207T101247 

Happy Sitecoreing ðŸ˜Š

Comments

Popular posts from this blog

Sitecore Installation Error: Failed to Start Service 'Sitecore Marketing Automation Engine'

Import CSV Data in Sitecore Using PowerShell: Part-3

Sitecore Technology MVP Journey 2022