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.
- Make sure dev and prod platform sites are running the same version of NWS.Titan.Base package in TPI
- 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)
- Once TPI is upgraded, upgrade the NWS.Titan.Base package to the same version the dev environment has installed.
- Take copies of domain-specific App Variables in dev so you can paste them back in after restoring the dev database.
- DomainConfig app var
- Primary DNS value for each site
- Recaptcha values for each site (if they exist)
- 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)
- Take backup of production database in SSMS
- Run full backup
- Copy-only
- Back up to Disk: \\host-prod-2\f$\Backups
- Open \\sql-dev-1\DatabaseRefresh and paste in the backup file (or whatever the dev server is)
- Make sure repository and prod environments have been synced
- Open a PowerShell window at M:\_tpi\LegacyUpgrades\Databaseupgrade as administrator
- Run RestoreDatabase.ps1
- Enter Client Name
- Enter instance name
- Enter SQL instance
- Enter Full Path to your backup file (DO NOT PASTE IN QUOTES AROUND PATH TO .BAK FILE)
- Leave username defaults
- 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.
- Environment.Refresh
- Environment.Refresh.Dev
- Environment.Debug
- Make URL and User login updates (webmaster and nwssupport only)
- Login via production webmaster credentials and update from Keepass
- Update DomainConfig app var to reflect correct domains
- Update primary DNS for content sites
- Update file piles to make sure upload path reflects correct network drive
- Update file pile download paths to reflect dev (F: instead of G:)
- Update custom app vars that have may rely on domain information)
- Do an app refresh.