MI Restore to Staging From Live
Version 14.1 by Nikhil Singh on 2025/12/01 07:18
- Pull newest scripts from repo using D:/ebsphere/devops/setup-scripts/setup-new.ps1
- Stop all services including web site for staging on VM
- Drop Old DB on Azure portal
- drop existing connections
- drop existing connections
- Restore DB from Live from last PITR or latest Full backup if DB age is not important
-
- Give yourself access to the admin group via the powershell script - if needed
- Wait for group policy SQL JOB [roughly 5-10 minutes] to create groups
- Run post restore access script SKL_sqlmi_accesss.sql - Repos (azure.com)
- This has to be run using SQLCMD mode on the script
- [TODO] source passwords from vault
- set clearLogins = 2
- TODO
- TODO - post restore script db settings etc
- recreate tblDocuments synonym
- tblAudit if applicable
- Run dba.dbo.sp_scan_db script for '%[_]Live[_]%' (exec dba.[dbo].[sp_scan_db] @includestr = '%DBC[_]Live%', @databasename = 'DBC_Live_Everest')
- correct all config found and repoint to Staging
- TODO automate (some of the config correcting statements can be generated using [dba].[devops].[sp_change_db_env_post_restore])
- exec dba.[devops].[sp_change_db_env_post_restore] @dbname = 'ENV_Staging_Everest', @ClientCode ='ENV', @Sourceenv = 'Live', @TargetEnv = 'Staging',
@domainRev = 'com.site', @domain = 'site.com',@svcUserPass = 'xxx.xxx.xxx.xxx#xx' - After executing the output of the dba.devops.sp_change_db_env_post_restore rerun this SP and make sure there is no objects that hasn't changed
- Start all services
- check logs to make sure no connections issues
- Log into the new DB with Everest and do a happyline test -> search for a member -> view member details -> upload a document -> download a document