Monday 24 October 2016

Move Existing XenDesktop 5.6 Database to New SQL Server

In the event of a db failure and mirror not kicking in - I still need to figure out why...


ensure all users are logged off, this may be redundant as they may not be able to get in.


on each DDC run the following PowerShell:


asnp Citrix*

Set-ConfigDBConnection -DBConnection $null
Set-AcctDBConnection -DBConnection $null
Set-HypDBConnection -DBConnection $null
Set-ProvDBConnection -DBConnection $null
Set-PvsVmDBConnection -DBConnection $null
Set-BrokerDBConnection -DBConnection $null


Each of these lines if successful will return a DBUnconfigured in PowerShell.



DB connections have to be set to $null before they can be pointed elsewhere. This is a built in thing.




These steps above and below have to be done in the order presented otherwise some of the connections won't be nullified.






Next we point to the new SQL instance and set the new mirror too along with some other essential setting:





Set-ConfigDBConnection -DBConnection "Data Source=DBServerName\DBInstance; Failover Partner=MirrorDBServerName\MirrorDBInstance; Initial Catalog=XENDESKTOP; Integrated Security=True; Network=dbmssocn"

Set-AcctDBConnection -DBConnection "Data Source=DBServerName\DBInstance; Failover Partner=MirrorDBServerName\MirrorDBInstance; Initial Catalog=XENDESKTOP; Integrated Security=True; Network=dbmssocn"

Set-HypDBConnection -DBConnection "Data Source=DBServerName\DBInstance; Failover Partner=MirrorDBServerName\MirrorDBInstance; Initial Catalog=XENDESKTOP; Integrated Security=True; Network=dbmssocn"

Set-ProvDBConnection -DBConnection "Data Source=DBServerName\DBInstance; Failover Partner=MirrorDBServerName\MirrorDBInstance; Initial Catalog=XENDESKTOP; Integrated Security=True; Network=dbmssocn"

Set-PvsVmDBConnection -DBConnection "Data Source=DBServerName\DBInstance; Failover Partner=MirrorDBServerName\MirrorDBInstance; Initial Catalog=XENDESKTOP; Integrated Security=True; Network=dbmssocn"

Set-BrokerDBConnection -DBConnection "Data Source=DBServerName\DBInstance; Failover Partner=MirrorDBServerName\MirrorDBInstance; Initial Catalog=XENDESKTOP; Integrated Security=True; Network=dbmssocn"

Each of these lines if successful will return an OK in PowerShell.

Once these steps have been carried out across all of your controllers, your Studio Console will fire back up without issue, and users should be able to login.






Next to deal with is PVS.




We had to try to rerun the PVS config wizard but were being prompted for SQL credentials and couldn't continue. Fortunately our DBA managed to repair and restore the original PVS DB.

No comments:

Post a Comment