Sei sulla pagina 1di 13

How to Backup and Restore your XenApp/XenDesktop

Database
Objective
This article describes how to back up and restore a XenDesktop database on Microsoft SQL Server.

Requirements
This article assumes you are an SQL administrator with basic knowledge of SQL Server or appropriate
resources to assist with the execution of the SQL statement command.

Background
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.
Instructions
Backup
The following process describes how to perform a one-time, manual backup. It does not prevent the need
to perform scheduled backups of the database. This backup captures a snapshot of the database at that
time it is performed. It is recommended that no administrative changes be performed while the backup is
in progress.
Complete the following procedure:

1.

Verify the name of the database and database server that is currently used by starting
PowerShell from the Desktop Studio Console.

2. Run the following command: Get-BrokerDBConnection to get the name of the database
server/Data Source and the Database/Initial Catalog name.
Example 1
PS C:\> Get-BrokerDBConnection
Server= sqlserver.training.local;Database= CitrixXenDesktopDB ;Trusted_Connection=True"
Example 2
PS C:\> Get-BrokerDBConnection
Data Source=SQLServer; Failover Partner=SQLServer2; Initial Catalog=CitrixXenDesktopDB; Integrated
Security=True; Network=dbmssocn
3. Connect to the SQL server and open the Microsoft SQL Server Management
Studio.

3. Connect to the Database Engine.

5. Expand the Databases node for your server and navigate to the database identified in Step 2.

6. Right-click database, select Tasks > Back Up.

7. Verify that the backup type is set to Full and verify the information listed. There is an option
you can leverage to verify the backup when finished.

8. Cick OK and ensure that the backup completed successfully.

See Creating Full and Differential Backups of a SQL Server Database.

Restore
Important

Remove any hotfixes applied after the backup before performing the restore.

As a precaution, back up the present database before the restore.


The following process describes how to perform a restore from the backup done in the previous section.
This process returns the database to the point in time when the backup was performed. Any changes
made after that point in time will be lost.
Complete the following procedure:

1.

Connect to the Database Engine.

2.

Expand the Databases node for your server and navigate to the name of your XenDesktop
database.

3. Right-click database, select Tasks > Restore > Database.

4.

Select the backup set that you want to restore from the list or go to the next step on how to select a file.

The source can be changed to From device then select the browse icon

5.

Select Add to locate the backup file from its folder.

6. Ensure the correct backup set is selected then click Options.

7. From Options , click Overwrite the existing database and Restore with recovery.

8. Click OK.

9. Restart Each Broker.


9. From each broker, open a PowerShell prompt and run the following commands to verify the
status of each service:
Add-PSSnapin Citrix.*
Get-AcctServiceStatus
Get-BrokerServiceStatus
Get-ConfigServiceStatus
Get-HypServiceStatus
Get-LicServiceStatus
Get-ProvServiceStatus
Get-PvsVmServiceStatus

Note: Verify that all preceding commands have returned a result of OK. If a result other than OK is
returned for any of these commands, it might be necessary to enable logging or tracing to determine the
cause of the connection failure.
11. Use the XDDBDiag utility - CTX128075 - XDDBDiag for XenDesktop to verify the consistency of
the database after the restore. If any Virtual Desktop Agents were running when the DDC
services were shut down in Step 1, it could take up to 10 minutes before the Virtual Desktop
Agents reregister. No other action is required.
11. Read to the Desktop groups all changes including catalogs, hosts, or assignments made after the
backup date.
Applicable Products

XenDesktop

XenApp 7.5

Potrebbero piacerti anche