Sitecore tips and tricks and community news !

Post Top Ad

Post Top Ad

Upgrading xCommerce Shared DB


 I was facing with situation when I had to attach our 9.0.3 xCommerce DBs to xCommerce 9.3 to check performance improvements connected with newer version of the tool. I started to do it and I found interesting steps.



So I've started to executing SQL upgrade scripts from WDP packages to upgrade xCommerce schema from 9.0.3 -> 9.1 -> 9.2 -> 9.3 to let me assign our DB to xCommerce 9.3.

From current version 9.0.3 to 9.1 I didn't have any issues. But during running last step from xCommerce upgrade guide 9.1 to 9.2 :

Run the SitecoreCommerce9.2.0_DataMigration_SharedEnvironments.sql script
against the Shared Environments database to migrate data from Sitecore XC 9.1.x to 9.2.0, I have an issue.

It looks like after upgrading schema, database contains tables only in new schema, so it can't achieve "dbo" instead of "sitecore_commerce_storage" what appeared after schema upgrade in previous steps. Hence procedure can't pass properly.



 

What I established is that, we could struggling with this issue, because the [dbo] tables are no longer present on the Shared database. Looks like all [dbo] tables were removed when deploying dacpac because of colliding table names in [dbo] and [sitecore_commerce_storage] schema (if there was "potential data loss" message in Management Studio - this means all [dbo] tables will be removed). The purpose of SitecoreCommerce9.2.0_DataMigration_SharedEnvironments.sql script is to migrate data from [dbo] tables into [sitecore_commerce_storage] tables, thus the script is failing.

 

Workaround, here are possible options:

  • backup Shared db with [dbo] schema (Shared db after upgrading to 9.1).
  • Restore the backup on the machine where SqlPackage tool is installed. 
  • Executing the ps1 script on this machine and move the Shared db with both schemas back to the initial machine.

Alternatively it is important to check if dacpac files can be directly deployed via Management Studio without overriding tables with same names but different schema.

Bests!

No comments:

Post a Comment