Refresh 6.9.5 and later Development Instance from Production

Author:Eric White
Last Updated:November 04, 2021 10:52 AM

The upgrade processes will be described with an assumption that production is HOST-PROD-2 and development is HOST-DEV-2.  The actual servers may be different.

The database and file pile refreshes must occur together.  If done separately, images and files are likely to be missing which can make development difficult.

NOTE: If you are doing a Code Refresh, complete it before doing the Database Reresh .  

Database Refresh

  1. Create Copy Only backup of production database including date in name (e.g. NWS_Titan_Public20211102.bak)
  2. Copy backup to development environment database refresh folder: \\sql-dev-1\DatabaseRefresh
  3. Create Copy Only backup of the development database including date in name (e.g. NWS_Titan_Public20211102.bak)
  4. Run M:\_tpi\LegacyUpgrades\DatabaseUpgrade\RestoreDatabase.ps1
  5. Enter appropriate values when prompted.  Using NWS Public as an example:
    1. Client ID = NWS
    2. Instance/System ID = Public
    3. Server = sql-dev-1\titanclients
    4. database = NWS_Titan_Public
    5. Source SQL ninstance = host-prod-2
    6. Path to backup file = Q:\DatabaseRefresh\NWS_Titan_Public20211102.bak
    7. Source application user = NWS_Titan_PublicUser 
    8. Restored DB application user = NWS_Titan_PublicUser 
    9. Restored DB applciation user password = abc123
    10. Admin application user = NWS_Titan_PublicAdmin
    11. sysadmin role user = use windows authentication>


      Note: Defaults are typically correct, but verify
  6. Select yes to continue and restore the database to the sql-dev-1\titanclient instance (it will overwrite the existing database, so be sure to complete step 3 first)
  7. The restore script should have update the AppControlData table.  However, run the following command against the restored database to confirm:
     
    SELECT DataName, DataValue FROM AppControlData WHERE DataName in ('NetSQLConnAppControl', 'NetSQLConnCMS')
    The connection string values should be pointing at sql-dev-1\titanclients
  8. Login to the TPI site for the instance and upload the following packages:
    1. NWS.Titan.Modules.Environments.Refresh
    2. NWS.Titan.Modules.Environments.Refresh.Dev
    3. NWS.Titan.Modules.Environments.Refresh.Debug
      Note: If the packages are already installed, upload the latest versions then mark all as not installed.
  9. Install the three packages from step 8
  10. Login to the workstation for your instance to ensure the following are correct for the environment you just refreshed:
    1. Primary DNS (e.g. nws-dev.titanclient.com)
    2. File Pile Upload Path (e.g. \\host-dev-2\Files\Sites\NWS\Titan\Public\Wkst\FileServer)
    3. File Pile Download Path (e.g. https://nws-wkst-dev.titanclient.com)
      Note: The dev refresh doesn't handle sub-domains of titanclient.com.  It instead, updates all values to [clientid]-dev.titanclient.com.  If there were custom dev subdomains, those need to be updated manually (or a client-specific dev refresh packages can be created).   A client-specific dev refresh package is strongly recommended anytime the instance has environment settings not handled by the default Dev Refresh package.  This package would be [ClientID].Titan.Modules.Environments.Refresh.Dev
  11. Proceed to the File Pile refresh

 

***** REALLY, REALLY IMPORTANT FILE PILE AND CODE REFRESH INFORMATION *****

When using robocopy, be certain the production server path is specified FIRST and destination server path second.  The robocopy command is copying from SOURCE to DESTINATION.  If you reverse it, you will overwrite production with development files. Also, mirroring will remove files that aren't in production, so make sure there aren't any files in development that need to be kept.
***********************************************************************************************************************************

File Pile Refresh

1. Run the following command from the development server the file pile from production to dev

robocopy \\[Production Server]\Files\Sites\[ClientID]\Titan\[InstanceID]\Wkst\FileServer F:\Sites\[ClientID]\Titan\[InstanceID]\Wkst\FileServer /mir /mt:20
Example:
robocopy \\host-prod-2\Files\Sites\NWS\Titan\Public\Wkst\FileServer F:\Sites\NWS\Titan\Public\Wkst\FileServer /mir /mt:20

This command will mirror the contents of the Production File Pile folders into the Development File Pile folders.

 

Code Refresh

1.  Stop the development server IIS sites for the instance you are refreshing (e.g. NWS_Titan_Public (Display), NWS_Titan_Public (Wkst), NWS_Titan_Public (Platform), NWS_Titan_Public (Services))

2. Stop the Titan Platform Installer Job Runner service in Local Services (e.g. Titan Platform Installer Job Runner: NWS_Titan_Public)

3. Run the following command from the development server the file pile from production to dev

robocopy \\[Production Server]\Files\Sites\[ClientID]\Titan\[InstanceID] F:\Sites\[ClientID]\Titan\[InstanceID] /mir /mt:20
Example:
robocopy \\host-prod-2\Files\Sites\NWS\Titan\Public F:\Sites\NWS\Titan\Public /mir /mt:20

4. Once the copy is completed, make the following file updates (paths under the Instance folder):

  • Platform/web.config
    • TitanPlatformInstallerPassword - update to abc123
    • TitanPlatformInstallerApiBaseUrl - update to dev url (typically adding -dev after platform)
    • RestrictedDatabaseUsername - update to what you specified in database refresh (typically [ClientID]_Titan_[InstanceID]User, e.g. NWS_Titan_PublicUser)
    • RestrictedDatabasePassword - update to what you specified in database refresh (typically abc123)
    • Update the Data Source to point at dev database server, sql-dev-1\titanclients, for the RestrictedAccess and AdminAccess connection strings.  Correct any other values in the connection strings as needed to match values used in dev
       
  • Platform/App_Data/InstanceData/InstanceConfig.json
    • Update all URLs in the file to point to the corresponding development URL.  This can typically be done by running a search and replace.     A search and replace of .titanclient.com to -dev.titanclient.com followed by -prod-dev.titanclient.com to -dev.titanclient.com takes care of all references using standard naming scheme. 

      URLs found in: 
      • publicUrl, internalUrl, listenerUrl properties of the platformSite, wkstSites, displaySites and servicesSites properties.
         
    • Update all paths in the file to point to the corresponding development paths.  In most cases, the paths should be identitical with the only differene being the drive letter.  A host-prod-2 to host-dev-2 refresh, for example, would just need to replace g: with f: in the file. 
       
  • Services/web.config
    • TitanPlatformInstallerPassword - update to abc123
    • TitanPlatformInstallerApiBaseUrl - update to dev url (typically adding -dev after platform)
    • Update the Data Source to point at dev database server, sql-dev-1\titanclients, for the AppControlData connection strings.  Correct any other values in the connection strings as needed to match values used in dev
       
  • Wkst/App_Data/Jobs/BackgroundService/BackgroundService.exe.config
    • Update the Data Source to point at dev database server, sql-dev-1\titanclients, for the AppControlData connection strings.  Correct any other values in the connection strings as needed to match values used in dev
    • In some cases, service endpoints are defined in this config file.  Be sure to check for any URL references and update to corresponding dev URL.   A search and replace of .titanclient.com to -dev.titanclient.com followed by -prod-dev.titanclient.com to -dev.titanclient.com takes care of all references using standard naming scheme.
       
  • Display/web.config, Wkst/web.config, Wkst/App_Data/Jobs/WkstAgent/TitanPlatformInstaller.WkstAgent.exe.config
    • TitanPlatformInstallerPassword - update to abc123
    • TitanPlatformInstallerApiBaseUrl - update to dev url (typically adding -dev after platform)
    •  For Display and Wkst, update all service end point references to corresponding development URL.  A search and replace of .titanclient.com to -dev.titanclient.com followed by -prod-dev.titanclient.com to -dev.titanclient.com takes care of all references using standard naming scheme.
  • Wkst/App_Data/Jobs/JobRunner/TitanPlatformInstaller.JobRunnerService.exe.config
    • Update the AppPath_WkstAgent and AppPath_BackgroundService values to match the dev server paths (in most cases you will only change the drive letter, eg. g: to f: in case of host-prod-2 to host-dev-2) 

5.  Start the development server IIS sites for the instance you are refreshing (e.g. NWS_Titan_Public (Display), NWS_Titan_Public (Wkst), NWS_Titan_Public (Platform), NWS_Titan_Public (Services))

6. Start the Titan Platform Installer Job Runner service in Local Services (e.g. Titan Platform Installer Job Runner: NWS_Titan_Public)

7. Follow the Database Refresh steps to complete the refresh process.  In the event you refreshed the database before doing the code refresh, just steps 8 through 10 of the Database Refresh process.

top