Migrate XenDesktop database

 

Disable Monitoring

Set-MonitorConfiguration -DataCollectionEnabled $False

Disable Configuration Logging

Set-LogSite -State “Disabled”

Create machine account login (new query from SQL Server Management Studio)

Create login [domain\computeraccount$] from windows

Create login [SLDT\DDC01$] from windows

Each Delivery Controllers Machine Login should be mapped to an account under the restored Database. Locate these logins and verify that their Database role membership is set to the following role, as displayed in the screen shot:

ROLE Account (one for each Broker) Version
ADIdentitySchema_ROLE DOMAIN\MACHINE$ 7.0 Onwards
Analytics_ROLE DOMAIN\MACHINE$ 7.8 Onwards
AppLibrarySchema_ROLE DOMAIN\MACHINE$ 7.8 Onwards
chr_Broker DOMAIN\MACHINE$ 7.0 Onwards
chr_Controller DOMAIN\MACHINE$ 7.0 Onwards
ConfigLoggingSchema_ROLE DOMAIN\MACHINE$ 7.0 Onwards
ConfigLoggingSiteSchema_ROLE DOMAIN\MACHINE$ 7.0 Onwards
ConfigurationSchema_ROLE DOMAIN\MACHINE$ 7.0 Onwards
DAS_ROLE DOMAIN\MACHINE$ 7.0 Onwards
DesktopUpdateManagerSchema_ROLE DOMAIN\MACHINE$ 7.0 Onwards
EnvTestServiceSchema_ROLE DOMAIN\MACHINE$ 7.0 Onwards
HostingUnitServiceSchema_ROLE DOMAIN\MACHINE$ 7.0 Onwards
Monitor_ROLE DOMAIN\MACHINE$ 7.0 Onwards
MonitorData_ROLE DOMAIN\MACHINE$ 7.0 Onwards
OrchestrationSchema_ROLE DOMAIN\MACHINE$ 7.11 Onwards
StorefrontSchema_ROLE DOMAIN\MACHINE$ 7.8 Onwards
TrustSchema_ROLE DOMAIN\MACHINE$ 7.11 Onwards

Also make sure the SQL Logins for the Controller machines accounts are mapped to the Logging and Monitoring databases

Test connection from XenDesktop to (new) database

asnp citrix.*
$ServerName=”DDC01.SLDT.local
$SiteDBName=”CitrixXenDesktop7Site
$cs=”Server=$ServerName; Initial Catalog=$SiteDBName; Integrated Security=True”
Test-AcctDBConnection -DBConnection $cs
Test-AdminDBConnection -DBConnection $cs
Test-AnalyticsDBConnection -DBConnection $cs     # 7.6 and newer
Test-AppLibDBConnection -DBConnection $cs     # 7.8 and newer
Test-BrokerDBConnection -DBConnection $cs
Test-ConfigDBConnection -DBConnection $cs
Test-EnvTestDBConnection -DBConnection $cs
Test-HypDBConnection -DBConnection $cs
Test-LogDBConnection -DBConnection $cs
Test-MonitorDBConnection -DBConnection $cs
Test-OrchDBConnection -DBConnection $cs     # 7.11 and newer
Test-ProvDBConnection -DBConnection $cs
Test-SfDBConnection -DBConnection $cs
Test-TrustDBConnection -DBConnection $cs     # 7.11 and newer

Unregister the Delivery Controllers from the current database

Tip : Appending ‘-force’ to the commands may help with setting values in some cases

Note: AdminDBConnection must be the last command.

Set-ConfigDBConnection -DBConnection $null
Set-AcctDBConnection -DBConnection $null
Set-AnalyticsDBConnection -DBConnection $null     # 7.6 and newer
Set-AppLibDBConnection -DBConnection $null     # 7.8 and newer
Set-OrchDBConnection -DBConnection $null     # 7.11 and newer
Set-TrustDBConnection -DBConnection $null     # 7.11 and newer
Set-HypDBConnection -DBConnection $null
Set-ProvDBConnection -DBConnection $null
Set-BrokerDBConnection -DBConnection $null
Set-EnvTestDBConnection -DBConnection $null
Set-SfDBConnection -DBConnection $null
Set-MonitorDBConnection -DataStore Monitor -DBConnection $null
Set-MonitorDBConnection -DBConnection $null
Set-LogDBConnection -DataStore Logging -DBConnection $null
Set-LogDBConnection -DBConnection $null
Set-AdminDBConnection -DBConnection $null -force

Error? Restart all the Citrix services

Get-Service Citrix* | Stop-Service -Force
Get-Service Citrix* | Start-Service

After restarting all the Citrix services, you must restart the server.

Rerun the original set of command to confirm that the existing connection is properly removed and returns status: DBUnconfigured.

Create database connection

Note: AdminDBConnection should be first

$ServerName=”DDC01.SLDT.local
$SiteDBName=”CitrixXenDesktop7Site
$LogDBName=”CitrixXenDesktop7Log
$MonitorDBName=”CitrixXenDesktop7Mon
$cs=”Server=$ServerName; Initial Catalog=$SiteDBName; Integrated Security=True”
$csLogging=”Server=$ServerName; Initial Catalog=$LogDBName; Integrated Security=True”
$csMonitoring=”Server=$ServerName; Initial Catalog=$MonitorDBName; Integrated Security=True”
Set-AdminDBConnection -DBConnection $cs
Set-ConfigDBConnection -DBConnection $cs
Set-AcctDBConnection -DBConnection $cs
Set-AnalyticsDBConnection -DBConnection $cs     # 7.6 and newer
Set-HypDBConnection -DBConnection $cs
Set-ProvDBConnection -DBConnection $cs
Set-AppLibDBConnection –DBConnection $cs     # 7.8 and newer
Set-OrchDBConnection –DBConnection $cs     # 7.11 and newer
Set-TrustDBConnection –DBConnection $cs     # 7.11 and newer
Set-PvsVmDBConnection -DBConnection $cs
Set-BrokerDBConnection -DBConnection $cs
Set-EnvTestDBConnection -DBConnection $cs
Set-SfDBConnection -DBConnection $cs
Set-LogDBConnection -DBConnection $cs
Set-LogDBConnection -DataStore Logging -DBConnection $null
Set-LogDBConnection -DBConnection $null
Set-LogDBConnection -DBConnection $cs
Set-LogDBConnection -DataStore Logging -DBConnection $csLogging
Set-MonitorDBConnection -DBConnection $cs
Set-MonitorDBConnection -DataStore Monitor -DBConnection $null
Set-MonitorDBConnection -DBConnection $null
Set-MonitorDBConnection -DBConnection $cs
Set-MonitorDBConnection -DataStore Monitor -DBConnection $csMonitoring

Enable Monitoring

Set-MonitorConfiguration -DataCollectionEnabled $true

Enable Configuration Logging

Set-LogSite -State “Enabled”

Restart Citrix Studio

Test database connection services

From each Controller, test the database connection services to the new database:

Note: some of the ServiceStatus cmdlets were only added in later versions of XenApp/XenDesktop and might generate “not recognized” errors on older versions.

Get-AcctServiceStatus
Get-AdminServiceStatus
Get-AnalyticsServiceStatus     # 7.6 and newer
Get-AppLibServiceStatus     # 7.8 and newer
Get-BrokerServiceStatus
Get-ConfigServiceStatus
Get-EnvTestServiceStatus
Get-HypServiceStatus
Get-LogServiceStatus
Get-MonitorServiceStatus
Get-OrchServiceStatus     # 7.11 and newer
Get-TrustServiceStatus     # 7.11 and newer
Get-ProvServiceStatus
Get-SfServiceStatus

 

Leave a Reply

Het e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *