Moving the Logging and Monitoring Database

When installing Citrix XenApp/Desktop 7.6 three databases are installed to your SQL instance during site creation.

  • Monitoring
  • Configuration (logging)
  • Site database

1-min

 

 

  • 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.2-min

 

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.3-min

 

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.

  1. Launch PowerShell and add the Citrix PowerShell modules – asnp Citrix.*
  2. Set-LogSite -State “Disabled”
  3. Set-MonitorConfiguration -DataCollectionEnabled $false

4-min

 

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.5-min

 

6-min

 

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.7-min

 

First click the Options page to the left and select Overrwrite the existing database (WITH REPLACE) and Close existing connections to destination database.8-min

 

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.9-min

 

The restore has completed.10-min

 

Looking back on Studio the configuration historical data is now present. Director data should also be present.11-min

 

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.


2 Comments

  • Kedar Pavaskar

    December 14, 2016

    Was facing an issue with regards to the monitoring and Logging DB mirror which i hadnt pre-created before setting up the Xenapp Site. eventually after I did, the monitor and Log DB would lose connections to DDC when i did SQL failover.
    Followed this article and it Worked flawlessly! Pre-created an empty DB mirror on the SQL servers and then followed the steps above! Perfecto!
    Thank you!

    Reply
    • George Spiers

      December 14, 2016

      Brilliant. Great work!

      Reply

Leave a Reply