1.Disconnect all controllers from the DB by setting all the DB connection strings to $null:

<Set-BrokerDBConnection -DBConnection $null>

2.Make sure the recovery model is set to full on the existing site DB

3.Backup the site DB on the existing SQL Server e.g. SQLServer1

4.Restore the DB on the 2nd  SQL Server e.g. SQLServer2 (make sure to set the option to leave the DB non-operational i.e. RESTORE WITH NORECOVERY– this is VERY important)

5.Enable Mirroring for the DB from SQLServer1 (Witness server used for automatic failover)

6.Create Security logins for each Controller on SQLServer2 (Security logins are not included in DB backup)

7.Set new DB connection strings for all Controller services and include the Failover Partner and Network (Optional) parameters:

Example:

‘Data Source=SQLServer; Failover Partner=SQLServer2; Initial Catalog=CitrixXenDesktopDB; Integrated Security=True; Network=dbmssocn’

Note: Network=dbmssocn explicitly forces the connection to use TCP/IP rather then Shared Memory or Named Pipes if available.

8.Stop the SQL instance running on SQLServer1 and verify that the state of the DB on SQLServer2 shows as (Principle, Disconnected)

9.Check the status of each Controller service and confirm the status returned is OK (Optional but good practice and will validate that the services can talk to the mirrored DB)

<Get-BrokerServiceStatus>

10.launch a desktop to confirm full functionality against the Mirrored DB

11.Start the SQL instance running on SQLServer1 and verify that the state of the DB on SQLServer2 shows as (Principal, Synchronized) while the DB on SQLServer1

appears as (Mirror, Synchronized / Restoring…)

Notes:

-Applies to XD5.x & 7.x

-Witness server can be SQLExpress (no license required)

-Witness server only required for automatic failover (alternative option would be to do a manual failover once the principle DB goes down – Not RECOMMENDED)

-Mirror DB script can be used to automate the creation of the Security logins on the Restored/Mirrored DB. This and can be created during the Desktop Deployment wizard or through PoSH by creating a Login script for one of the core services: see http://support.citrix.com/static/kc/CTX127254/help/Get-BrokerDBSchema.html

-Same general concepts apply to The Configuration Logging and Monitoring DB in XD7.x

If the Configuration logging and Monitoring DB’s have been seperated from the main site DB then you can set the DB connection strings as follows:

<Set-LogDBConnection -DBConnection “main site database string”>

<Set-LogDBConnection -DBConnection “Configuration Logging database string” -DataStore “Logging”>

<Set-MonitorDBConnection -DBConnection “main site database string”>

<Set-MonitorDBConnection -DBConnection “Monitoring database string” -DataStore “Monitoring”>

Best Regards
Mick Glover (aka XD Tipster)
Senior Readiness Specialist,
Worldwide Support Readiness [EMEA]
Citrix Systems, Inc