MI Restore to Staging From Live

Last modified by Phillip Swanepoel on 2026/06/09 12:46

 

  1. Pull newest scripts from repo using D:/ebsphere/devops/setup-scripts/setup-new.ps1
  2. Stop all services including web site for staging on VM
     
  3. Drop Old DB on Azure portal
    1. drop existing connections
       
  4. Restore DB from Live from last PITR or latest Full backup if DB age is not important
    image-20250411144502-1.png
  5. Give yourself access to the admin group via the powershell script - if needed
     
  6. Wait for group policy SQL JOB [roughly 5-10 minutes] to create groups
     
  7. Run post restore access script SKL_sqlmi_accesss.sql - Repos (azure.com)
    1. This has to be run using SQLCMD mode on the script
    2. [TODO] source passwords from vault
    3. set clearLogins = 2
    4. TODO
       
  8. TODO - post restore script db settings etc
    1. recreate tblDocuments synonym
    2. tblAudit if applicable
       
  9. Run  dba.dbo.sp_scan_db script for '%[_]Live[_]%' (exec dba.[dbo].[sp_scan_db] @includestr = '%DBC[_]Live%', @databasename = 'DBC_Live_Everest')
    1. correct all config found and repoint to Staging
    2. TODO automate (some of the config correcting statements can be generated using [dba].[devops].[sp_change_db_env_post_restore])
    3. 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'
    4. 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
    5. Use doc_central.sql - Repos to update staging documents when restoring from live.
  10. Start all services
    1. check logs to make sure no connections issues
  11. 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

 

Tags:
    

Need help?

If you need help with XWiki you can contact: