Friday, November 07, 2014

Change XenDesktop 7.6 SQL Server

If you setup the SQL Express edition and need to move it for production. This is how.

Open PowerShell as and Administrator:

Add-PSSnapin Citrix*
Get-LogDataStore
Get-MonitorDataStore

They BOTH output something like this:


ConnectionString : Server=XDC-PROD01\SQLEXPRESS;Initial Catalog=CTX-XD7-PROD;Integrated Security=True

DataStore        : Site


DatabaseType     : SqlServer


Provider         : MSSQL


SchemaName       : Monitor


Status           : OK



ConnectionString : Server=XDC-PROD01\SQLEXPRESS;Initial Catalog=CTX-XD7-PROD;Integrated Security=True

DataStore        : Monitor


DatabaseType     : SqlServer


Provider         : MSSQL


SchemaName       : MonitorData


Status           : OK



Copy the contents of the BOLD above to a string and change the server name and instance details with server= in the prefix.



$CS = “server=REMOTE-PROD01\SQL02;Initial Catalog=CTX-XD7-PROD;Integrated Security=True”




  • Set-LogSite -State Disabled


  • Set-LogDBConnection -DataStore Logging -DBConnection $null


  • Set-MonitorDBConnection -DataStore Monitor -DBConnection $null


  • Set-MonitorDBConnection -DBConnection $null


  • Set-AcctDBConnection -DBConnection $null


  • Set-ProvDBConnection -DBConnection $null


  • Set-BrokerDBConnection -DBConnection $null


  • Set-EnvTestDBConnection -DBConnection $null


  • Set-SfDBConnection -DBConnection $null


  • Set-HypDBConnection -DBConnection $null


  • Set-ConfigDBConnection -DBConnection $null –force


  • Set-LogDBConnection -DBConnection $null –force


  • Set-AdminDBConnection -DBConnection $null –force



Move the database between the servers.



On the SQL server create the account(s)



sqlcmd -S env3-sql2\AON -q "create login [domainName\ddcName$] from windows"


set-ConfigDBconnection -dbconnection $cs

set-AdminDBconnection -dbconnection $cs


set-LogDBconnection -dbconnection $cs


set-AcctDBconnection -dbconnection $cs


set-BrokerDBconnection -dbconnection $cs


set-EnvTestDBconnection -dbconnection $cs


set-HypDBconnection -dbconnection $cs


set-MonitorDBconnection -dbconnection $cs


set-ProvDBconnection -dbconnection $cs


set-SfDBconnection -dbconnection $cs


set-LogDbConnection -DataStore logging -DbConnection $cs


set-MonitorDbConnection -DataStore monitor -DbConnection $cs


set-LogSite -State Enabled



 

Post a Comment

Blog Archive