Site icon WinCert

How to migrate Citrix Xenapp v7.x database to another SQL server

<p>Recently we had to migrate the Citrix XenApp v7&period;x database from SQL Server 2012 to SQL Server 2022&period; Here&&num;8217&semi;s the tutorial on how to do this if you&&num;8217&semi;re using three Citrix data stores or databases &lpar;Site&comma; Monitoring&semi; Logging&rpar;&period;<&sol;p>&NewLine;<p><img class&equals;"alignnone size-full wp-image-554" src&equals;"https&colon;&sol;&sol;www&period;wincert&period;net&sol;wp-content&sol;uploads&sol;2015&sol;01&sol;citrix&period;jpg" alt&equals;"Citrix Box&comma;xenapp&comma;citrix&comma;server&comma;ica&comma;symantec&comma;libraries&comma;license&comma;installer&comma;publish&comma;console&comma;client&comma;publisher&comma;wfshell" width&equals;"720" height&equals;"340" &sol;><&sol;p>&NewLine;<ol>&NewLine;<li><strong>First of all and most important step&excl;<&sol;strong><&sol;li>&NewLine;<&sol;ol>&NewLine;<ul>&NewLine;<li><strong>Create VM snapshots of Citrix DDC &lpar;Delivery Controllers&rpar;<&sol;strong><&sol;li>&NewLine;<li><strong>Backup Citrix database&sol;s<&sol;strong><&sol;li>&NewLine;<&sol;ul>&NewLine;<p>2&period; <strong>Get the Connection Strings for each DB&period;<&sol;strong><&sol;p>&NewLine;<p>Run the following commands in Powershell &lpar;elevated mode&rpar; to get the DB connection strings for each of the three data stores&colon;<&sol;p>&NewLine;<p>Run the <strong>Asnp Citrix&ast;<&sol;strong> command to load the Citrix snap-in commandlets&period;<&sol;p>&NewLine;<p>Site Database&colon;<br &sol;>&NewLine;<strong>Get-BrokerDBConnection<&sol;strong><&sol;p>&NewLine;<p>Logging Database&colon;<br &sol;>&NewLine;<strong>Get-LogDataStore<&sol;strong><&sol;p>&NewLine;<p>Monitoring Database&colon;<br &sol;>&NewLine;<strong>Get-MonitorDataStore<&sol;strong><&sol;p>&NewLine;<p>Write down the Connection Strings you got with the above commands &lpar;example&rpar;&colon;<br &sol;>&NewLine;<strong>ConnectionString&colon; &&num;8220&semi;Server&equals;Contoso&bsol;CITRIX&semi;Initial Catalog&equals;Citrix&lowbar;Xenapp7&lowbar;Site&semi;Integrated Security&equals;True&&num;8221&semi;<&sol;strong><&sol;p>&NewLine;<p>We&&num;8217&semi;ll need this to create Powershell variables that will be used to connect DDCs to a new DB server&period;<&sol;p>&NewLine;<p>3&period;<strong> Detach all DB connections from each Delivery Controller in the farm by running the following commands in Powershell &lpar;elevated mode&rpar;&colon;<&sol;strong><&sol;p>&NewLine;<p>Set-AcctDBConnection -DBConnection &dollar;null<br &sol;>&NewLine;Set-AnalyticsDBConnection -DBConnection &dollar;null<br &sol;>&NewLine;Set-AppLibDBConnection -DBConnection &dollar;null<br &sol;>&NewLine;Set-BrokerDBConnection -DBConnection &dollar;null<br &sol;>&NewLine;Set-ConfigDBConnection -DBConnection &dollar;null<br &sol;>&NewLine;Set-EnvTestDBConnection -DBConnection &dollar;null<br &sol;>&NewLine;Set-HypDBConnection -DBConnection &dollar;null<br &sol;>&NewLine;Set-OrchDBConnection -DBConnection &dollar;null<br &sol;>&NewLine;Set-ProvDBConnection -DBConnection &dollar;null<br &sol;>&NewLine;Set-SfDBConnection -DBConnection &dollar;null<br &sol;>&NewLine;Set-TrustDBConnection -DBConnection &dollar;null<br &sol;>&NewLine;Set-MonitorDBConnection -Datastore Monitor -DBConnection &dollar;null<br &sol;>&NewLine;Set-MonitorDBConnection -DBConnection &dollar;null<br &sol;>&NewLine;Set-LogDBConnection -Datastore Logging -DBConnection &dollar;null<br &sol;>&NewLine;Set-LogDBConnection -DBConnection &dollar;null<br &sol;>&NewLine;Set-AdminDBConnection -DBConnection &dollar;null<&sol;p>&NewLine;<p>Run each of these commands one by one&period; That&&num;8217&semi;s a better approach in case you run into an error with any of these commands&period;<&sol;p>&NewLine;<p>If you run into an error that says&colon; <strong>The operation could not be performed because of a configuration logging error&period;<&sol;strong> &&num;8211&semi; Run the command again with the -force switch and it should be completed successfully&period;<&sol;p>&NewLine;<p><img class&equals;"alignnone size-full wp-image-4975" src&equals;"https&colon;&sol;&sol;www&period;wincert&period;net&sol;wp-content&sol;uploads&sol;2023&sol;03&sol;configuration-logging-error&period;png" alt&equals;"" width&equals;"832" height&equals;"188" &sol;><&sol;p>&NewLine;<p>4&period;<strong> Move the Databases to the new SQL Server&period;<&sol;strong><&sol;p>&NewLine;<p>You might need help from a DB admin since you&&num;8217&semi;ll have to create logins for the DDCs and give required permissions as was the case on the old DB server&period;<&sol;p>&NewLine;<p>5&period; <strong>Run Powershell in elevated mode and create connection string variables for three Citrix Datastores&period;<&sol;strong><&sol;p>&NewLine;<p>&num; Site DB<br &sol;>&NewLine;<em>&dollar;cs &equals; &&num;8220&semi;Server&equals;<strong>Contoso&bsol;CITRIX<&sol;strong>&semi;Initial Catalog&equals;<strong>CitrixXenapp7&lowbar;Site<&sol;strong>&semi;Integrated Security&equals;True&&num;8221&semi;<&sol;em><br &sol;>&NewLine;&num; Logging DB<br &sol;>&NewLine;<em>&dollar;csl &equals; &&num;8220&semi;Server&equals;<strong>Contoso&bsol;CITRIX<&sol;strong>&semi;Initial Catalog&equals;<strong>CitrixXenapp7&lowbar;Logging<&sol;strong>&semi;Integrated Security&equals;True&&num;8221&semi;<&sol;em><br &sol;>&NewLine;&num; Monitor DB<br &sol;>&NewLine;<em>&dollar;csm &equals; &&num;8220&semi;Server&equals;<strong>Contoso&bsol;CITRIX<&sol;strong>&semi;Initial Catalog&equals;<strong>CitrixXenapp7&lowbar;Monitoring<&sol;strong>&semi;Integrated Security&equals;True&&num;8221&semi;<&sol;em><&sol;p>&NewLine;<p>Replace bold parts with your SQL Server name and Instance name&comma; along with the Initial Catalog name or Datastore name that we got in step 2&period;<&sol;p>&NewLine;<p>Now run the three commands above &lpar;italic font&rpar; to set variables for Site&comma; Logging&comma; and Monitoring datastores&period;<&sol;p>&NewLine;<p>6&period; <strong>Connect the Citrix DDCs to the new SQL server by running each of the following commands&colon;<&sol;strong><&sol;p>&NewLine;<p>Set-AdminDBConnection -DBConnection &dollar;cs<br &sol;>&NewLine;Set-AcctDBConnection -DBConnection &dollar;cs<br &sol;>&NewLine;Set-AnalyticsDBConnection -DBConnection &dollar;cs<br &sol;>&NewLine;Set-AppLibDBConnection -DBConnection &dollar;cs<br &sol;>&NewLine;Set-BrokerDBConnection -DBConnection &dollar;cs<br &sol;>&NewLine;Set-ConfigDBConnection -DBConnection &dollar;cs<br &sol;>&NewLine;Set-EnvTestDBConnection -DBConnection &dollar;cs<br &sol;>&NewLine;Set-HypDBConnection -DBConnection &dollar;cs<br &sol;>&NewLine;Set-OrchDBConnection -DBConnection &dollar;cs<br &sol;>&NewLine;Set-ProvDBConnection -DBConnection &dollar;cs<br &sol;>&NewLine;Set-SfDBConnection -DBConnection &dollar;cs<br &sol;>&NewLine;Set-TrustDBConnection -DBConnection &dollar;cs<br &sol;>&NewLine;Set-LogDBConnection -DBConnection &dollar;cs<br &sol;>&NewLine;Set-LogDBConnection -Datastore Logging -DBConnection &dollar;null<br &sol;>&NewLine;Set-LogDBConnection -Datastore Logging -DBConnection &dollar;csl<br &sol;>&NewLine;Set-MonitorDBConnection -DBConnection &dollar;cs<br &sol;>&NewLine;Set-MonitorDBConnection -Datastore Monitor -DBConnection &dollar;null<br &sol;>&NewLine;Set-MonitorDBConnection -Datastore Monitor -DBConnection &dollar;csm<&sol;p>&NewLine;<p>Once done&comma; restart each DDC and try to run the Studio to check that everything is working properly&period;<&sol;p>&NewLine;<p>In the left pane of the Citrix studio administration console&comma; select Configuration to confirm that each of the three data stores is now connected to the new SQL Server&period;<&sol;p>&NewLine;<p>All the connection strings that we added in step 6&period; could be found in Windows Registry on DDC at the following path&colon;<&sol;p>&NewLine;<p><strong>HKLM&bsol;SOFTWARE&bsol;Citrix&bsol;XDservices and HKEY&lowbar;LOCAL&lowbar;MACHINE&bsol;SOFTWARE&bsol;Citrix&bsol;DesktopServer&bsol;DataStore&bsol;Connections&bsol;Controller<&sol;strong><&sol;p>&NewLine;<p>Comments are welcome&excl;<&sol;p>&NewLine;

Exit mobile version