When installing Citrix XenApp/Desktop 7.6 three databases are installed to your SQL instance during site creation.
- Configuration (logging)
- Site database
- Monitoring Database – Contains historical information which is used by Citrix Director allowing you to view trends such as how many sessions were active during the past weeks or months. Non-platinum customers receive a maximum 7 days worth of historical data whilst platinum customers get a default of 90 days data with no maximum period. Since the Monitoring Database collects historical environmental data it is expected to grow largest over time, however that depends on how large and busy your Citrix environment is. What we can do is estimate roughly that a 500 user Monday to Friday operation is likely to generate around 10-15MB of data each week against the Monitoring Database.
Configuration Logging Database – This database contains history of all configurational changes made to the environment. The database has no retention policy however the size depends on how much configuration goes on but will usually be the smallest database of the three. Configuration history can be viewed directly from Citrix Studio by opening Citrix Studio -> Logging. Configuration changes can also be allowed or disallowed when the Configuration Database is offline. To enable/disable this go to Citrix Studio -> Logging -> Preferences -> Allow changes when the database is disconnected.
Citrix recommend that you change the location of the secondary databases once you have created the initial Site database. To do this, browse to Citrix Studio -> Configuration -> Change database once you have clicked on either the Logging or Monitoring database.
Be aware that if you move the databases previous data is not retained so you will lose historical data from Director etc. There is a way to retain the data as I will show, if you want to keep it.
First, you must stop Configuration Logging and Monitoring to make sure that no new data is written to the database during the move.
- Launch PowerShell and add the Citrix PowerShell modules – asnp Citrix.*
- Set-LogSite -State “Disabled”
- Set-MonitorConfiguration -DataCollectionEnabled $false
Now, take a backup of the existing database using SQL Studio and transfer the backup to a new SQL server.
Browse to Citrix Studio -> Configuration -> Change Database against both the Logging and Monitoring databases. Enter your new SQL server name and the database name you would like to create and click OK. You will be told that no such database exists, so click OK to create one.
Now that the new Monitoring and Logging databases are created. Restore the old backed up databases to the new instances/servers. Open SQL Studio, connect to the new environment, right-click databases and select Restore Database.
First click the Options page to the left and select Overrwrite the existing database (WITH REPLACE) and Close existing connections to destination database.
Click back on to the General page and select the Device radio-box. Browse for the backup you made earlier. Make sure the destination database is set to the database that was created through Studio just recently. Click OK to begin the restore.
The restore has completed.
Looking back on Studio the configuration historical data is now present. Director data should also be present.
Don’t forget to enable Configuration Logging and Monitoring again with the Set-LogSite -State “Enabled” and Set-MonitorConfiguration -DataCollectionEnabled $true.
That is it. You have now moved the Monitoring and Logging databases as per Citrix best-practice and restored any historical data.