How to Restore a XenDesktop 5 Database on a SQL 2008 Server
This article contains information about restoring a XenDesktop 5 database on a SQL 2008 Server
It is assumed that the administrator has basic knowledge for SQL administration or has appropriate resources to assist with the execution of the SQL statement command.
When using Microsoft SQL Server, consult the Database Server product documentation for scheduling automated backups of the Data Store. In most cases, daily backup is sufficient to prevent loss of farm data.
In this scenario, it is expected that the Citrix Data Store is unavailable until the procedure is complete. Therefore, complete all the steps in the following procedure within the same change window.
- It is strongly recommended that no administrative changes be attempted until the Database is back online and verified.
- All Management Consoles should be closed.
Review throttling and idle pool settings as soon as you restore the DB to mitigate the possibility of boot storms
The following environmental data is used as an example:
- Restore the most recent database backup onto the target server.
Refer to the Copying Databases with Backup and Restore web page of Microsoft msdn library for more information
- Verify that all DDCs have valid logins for their machine account in the form DomainName\Computername$ on the database server. If verified, move to Step 3.
- To create machine logins for all DDCs on the database server, complete the following procedure:
- Start SQL Server Management Studio or SQLCMD,
- Run the CREATE LOGIN [DOMAIN\MACHINE$] FROM WINDOWS query, as displayed in the following screen shot:
- Each DDC Machine Login should have a corresponding user account under the restored Database. Locate these accounts and verify that their Database role membership is set to the following role, as displayed in the screen shot:
- At each DDC, open a PowerShell window and run the following commands where <dbserver> is the name of your SQL server, which is the instance if defined and <dbname> is the name of the XenDesktop database. This process loads the Citrix PowerShell Snap-in, clear the database connection and then configure the correct connection for each service:
Add-PSSnapin 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 Set-ConfigDBConnection -DBConnection “Server= <dbserver>;Database= <dbname>;Trusted_Connection=True”
Set-AcctDBConnection -DBConnection “Server= <dbserver>;Database= <dbname>;Trusted_Connection=True”
Set-HypDBConnection -DBConnection “Server= <dbserver>;Database= <dbname>;Trusted_Connection=True”
Set-ProvDBConnection -DBConnection “Server= <dbserver>;Database= <dbname>;Trusted_Connection=True”
Set-PvsVmDBConnection -DBConnection “Server= <dbserver>;Database= <dbname>;Trusted_Connection=True”
Set-BrokerDBConnection -DBConnection “Server= <dbserver>;Database= <dbname>;Trusted_Connection=True”
The XDDBDiag utility can be used to verify the consistency of your database after the move.
If any Virtual Desktop Agents were running when the DDC services were shut down in Step 1, then it could take up to 10 minutes before the Virtual Desktop Agents re-registers. No other action should be necessary.
Refer to the following Knowledge Center articles for more information:
- CTX128075 – XDDBDiag for XenDesktop
- CTX127254 – XenDesktop 5 SDK Cmdlet Help
- CTX114501 – Supported Databases for Citrix Products
- CTX128364 – Error: An error has occurred while connecting to the requested resource