Restore a Dev Database (v6.9.5+) from Production

Author:Aaron S. & Amanda A.
Last Updated:January 06, 2022 4:50 PM

For updated information see this note: https://developers.titancms.com/Developer-Notes/Refresh-6.9.5-and-later-Development-Instance-from-Production.htm.

  1. Make sure dev and prod platform sites are running the same version of NWS.Titan.Base package in TPI
    1. If you need to upgrade production, make sure you update TPI to at least 1.0.0.11 (IF ON OLDER THAN 0.1.0.114, UPGRADE TO TPI PRERELEASE 0.1.0.114, THEN 1.0.0.11) 
    2. Once TPI is upgraded, upgrade the NWS.Titan.Base package to the same version the dev environment has installed.
  2. Take copies of domain-specific App Variables in dev so you can paste them back in after restoring the dev database.
    1. DomainConfig app var
    2. Primary DNS value for each site
    3. Recaptcha values for each site (if they exist)
    4. Go through custom app variables (i.e. Cart Configurations) that may rely on correct domains to function properly. (See step 9 for restoring these values)
  3. Take backup of production database in SSMS
    1. Run full backup
    2. Copy-only
    3. Back up to Disk: \\host-prod-2\f$\Backups
  4. Open \\sql-dev-1\DatabaseRefresh and paste in the backup file (or whatever the dev server is)
  5. Make sure repository and prod environments have been synced
  6. Open a PowerShell window at M:\_tpi\LegacyUpgrades\Databaseupgrade as administrator
  7. Run RestoreDatabase.ps1
    1. Enter Client Name
    2. Enter instance name
    3. Enter SQL instance
    4. Enter Full Path to your backup file (DO NOT PASTE IN QUOTES AROUND PATH TO .BAK FILE)
    5. Leave username defaults
  8. Navigate to dev TPI and install Environment packages. These will reset most environment specific settings in the instance. Check the specific properties mentioned in step 9 to confirm they are correct.
    1. Environment.Refresh
    2. Environment.Refresh.Dev
    3. Environment.Debug
  9. Make URL and User login updates (webmaster and nwssupport only)
    1. Login via production webmaster credentials and update from Keepass
    2. Update DomainConfig app var to reflect correct domains
    3. Update primary DNS for content sites
    4. Update file piles to make sure upload path reflects correct network drive
    5. Update file pile download paths to reflect dev (F: instead of G:)
    6. Update custom app vars that have may rely on domain information) 
  10. Do an app refresh.
top