Virtual Apps/Desktops: How to reconfigure DB connection strings in DDC during a failed upgrade.

Virtual Apps/Desktops: How to reconfigure DB connection strings in DDC during a failed upgrade.

book

Article ID: CTX218357

calendar_today

Updated On:

Description

Steps on how to reconfigure DB connection strings in DDC


Instructions

The first step is to check the instances on a working or a lab DDC of the same version. As each version at times adds new DB connection instances. The following is the screen shot from a working 7.11 DDC :

User-added image

Once done we need to unconfigure the connection strings on non-working DDC :
  •  Launch Powershell on the controller with “Run as admin” option
  •  Type “Asnp Citrix*”
  •  Next run the below command only one at a time:
 
Set-MonitorDBConnection -DataStore Monitor -DBConnection $null -AdminAddress $Localhost
Set-LogDBConnection -Datastore Logging -DBConnection $null -AdminAddress $Localhost
Set-SfDBConnection -DBConnection $null -AdminAddress $Localhost
Set-EnvTestDBConnection -DBConnection $null -AdminAddress $Localhost
Set-MonitorDBConnection -DBConnection $null -AdminAddress $Localhost
Set-BrokerDBConnection -DBConnection $null -AdminAddress $Localhost
Set-ProvDBConnection -DBConnection $null -AdminAddress $Localhost
Set-HypDBConnection -DBConnection $null -AdminAddress $Localhost
Set-AnalyticsDBConnection -DBConnection $null  -AdminAddress $Localhost
Set-LogDBConnection -DBConnection $null -AdminAddress $Localhost
Set-AppLibDBConnection -DBConnection $null -AdminAddress $Localhost
Set-TrustDBConnection -DBConnection $null -AdminAddress $Localhost
Set-OrchDBConnection -DBConnection $null -AdminAddress $Localhost
Set-AcctDBConnection -DBConnection $null -AdminAddress $Localhost
Set-ConfigDBConnection -DBConnection $null -AdminAddress $Localhost
Set-AdminDBConnection –Force -DBConnection $null -AdminAddress $Localhost

Next we need to configure the instances after they are set to null:

$csSite =”Server=<DatabaseServerName without brackets>; Initial Catalog=<DBName without brackets>; Integrated Security=True”
$csMonitoring =”Server=<DatabaseServerName without brackets>; Initial Catalog=<MonitorDBName without brackets>; Integrated Security=True”
$csLogging =”Server=<DatabaseServerName without brackets>; Initial Catalog=<LoggingDBName without brackets>; Integrated Security=True”

Set-AdminDBConnection -DBConnection $csSite -AdminAddress $Localhost
Set-LogDBConnection -DBConnection $csSite -AdminAddress $Localhost
Set-AnalyticsDBConnection -DBConnection $csSite -AdminAddress $Localhost
Set-ConfigDBConnection -DBConnection $csSite -AdminAddress $Localhost
Set-AcctDBConnection -DBConnection $csSite -AdminAddress $Localhost
Set-HypDBConnection -DBConnection $csSite -AdminAddress $Localhost
Set-ProvDBConnection -DBConnection $csSite -AdminAddress $Localhost
Set-BrokerDBConnection -DBConnection $csSite -AdminAddress $Localhost
Set-MonitorDBConnection -DBConnection $csSite -AdminAddress $Localhost
Set-EnvTestDBConnection -DBConnection $csSite -AdminAddress $Localhost
Set-SfDBConnection -DBConnection $csSite -AdminAddress $Localhost
Set-AppLibDBConnection -DBConnection $csSite -AdminAddress $Localhost
Set-TrustDBConnection -DBConnection $csSite -AdminAddress $Localhost
Set-OrchDBConnection -DBConnection $csSite -AdminAddress $Localhost
Set-MonitorDBConnection -DataStore Monitor -DBConnection $csMonitoring -AdminAddress $Localhost
Set-LogDBConnection -Datastore Logging -DBConnection $csLogging -AdminAddress $Localhost

Note: Take a full backup of Citrix DB and snapshot of all the DDCs before executing these commands.
At any point when executing these commands, if you see error then please restart the controller. Then proceed from where you left off.
If no errors were seen, you are good to launch the Studio.
 

Environment

The above mentioned sample code is provided to you as is with no representations, warranties or conditions of any kind. You may use, modify and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the sample code may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the sample code fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the sample code. In no event should the code be used to support ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SAMPLE CODE, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Although the copyright in the code belongs to Citrix, any distribution of the sample code should include only your own standard copyright attribution, and not that of Citrix. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the sample code.

Issue/Introduction

How To reconfigure DB connection strings in DDC during a failed upgrade.