Created
September 20, 2023 18:17
-
-
Save keyan1603/8a7fb9ead92fca517c99c525ff952260 to your computer and use it in GitHub Desktop.
re-use the Sitecore Shard databases after database restore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Execute below statement in all the shard DBs | |
UPDATE [__ShardManagement].[ShardsLocal] SET ServerName ='<new db server name>', DatabaseName = '<restored new shard xDB db name with new prefix>' | |
# Execute below statement in the ShardMapManager DB against each Shard DB | |
UPDATE [__ShardManagement].[ShardsGlobal] SET ServerName ='<new db server name>', DatabaseName = '<restored new shard xDB db name with new prefix>' WHERE DatabaseName = '<new shard xDB db1 name with old prefix>' | |
UPDATE [__ShardManagement].[ShardsGlobal] SET ServerName ='<new db server name>', DatabaseName = '<restored new shard xDB db name with new prefix>' WHERE DatabaseName = '<new shard xDB db2 name with old prefix>' | |
UPDATE [__ShardManagement].[ShardsGlobal] SET ServerName ='<new db server name>', DatabaseName = '<restored new shard xDB db name with new prefix>' WHERE DatabaseName = '<new shard xDB dbn name with old prefix>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment