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

Author:Aaron S. & Amanda A.
Last Updated:April 01, 2022 4:09 PM

Please note that there is only one reason to restore dev to prod. When a new instance is created it will be set up in dev first. Typically initial data will be entered in dev and can be migrated to a new prod environment at that time. If you are attempting to do this in any other situation, there are likely other ways to accomplish what you need.

  1. Make sure dev and prod platform sites are running the same version of NWS.Titan.Base package in TPI
     
  2. Take backup of dev database in SSMS
    1. Run full backup
    2. Copy-only
    3. Back up to Disk: \\sql-dev-1\DatabaseRefresh
       
  3. Open \\host-prod-2\f$\Backups and paste in the backup file (or whatever the prod server is)
     
  4. Make sure repository and prod environments have been synced
     
  5. Open a PowerShell window at M:\_tpi\LegacyUpgrades\Databaseupgrade as administrator
     
  6. 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
    6. Update user password for the restored dbSee Next Step
       
  7. The restore script should have updated the AppControlData table.  However, run the following command against the restored database to confirm:
     
    SELECT DataName, DataValue FROM AppControlData WHERE DataName in ('NetSQLConnAppControl', 'NetSQLConnCMS')

    Note the password for the [client]_Titan_PublicUser.  You will need use SSMS to reset the password for that user (in the RESTORED database) to the value that you see in the query results. This is because when you restore the DB the DEV and PROD passwords for this user will not match. You'll know you have this problem if, after restoring the DB, the workstation shows an internal error: Login failed for user 'client_Titan_PublicUser'
  8. Navigate to prod TPI and install Environment packages. 
    1. Environment.Refresh
    2. Environment.Release
       
  9. Make URL and User login updates (webmaster and nwssupport only) 
    1. Login via dev webmaster credentials and update from Keepass. Make sure prod values used a generated password.
    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 prod
       
  10. Do an app refresh.
     
  11. Copy the DEV File Pile to PROD (if necessary). Example:

    robocopy \\host-dev-2\Files\Sites\{client}\Titan\Public\Wkst\FileServer \\host-prod-2\Files\Sites\{client}\Titan\Public\Wkst\FileServer /mir /mt:20
     
  12. FTP ACCESS: Will the client be uploading files via FTP?  If so, you have some additional steps:
    1. Send a request to NWSIT to get a production FTP Account setup.
    2. On the host server, open the SERVICES MMC app and locate the appropriate Job Runner service (Titan Platform Installer Job Runner: {client}_Titan_Public)
    3. Change the account under which the service runs to Titan Proxy User (see Kee-Pass for password). If you don't do this, Titan can't get to the FTP Root Folder for the client
    4. Create or Modify your Schedule Task with the new FTP root folder path
top