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.


13 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
  • Jay

    May 2, 2018

    Thanks alot for the help! You rock it.

    Reply
  • Nirmal Thangarasu

    January 31, 2019

    George, do you have similar article for Site DB migration? I am trying to follow https://docs.citrix.com/en-us/advanced-concepts/implementation-guides/database-connection-strings.html. It is not clear.

    Reply
    • George Spiers

      January 31, 2019
      Reply
      • Anonymous

        February 11, 2019

        ok. thank you. we have tight access ctrl policy in SQL env. we can get only security admin role. i have to create DBusing script and make connection to DB from studio. I was able to configre mornoting DB successfully. however for logging DB, it keep saying DB is already created and used by other product. though there is no connection to DB. any idea?

        Reply
        • George Spiers

          February 12, 2019

          Can your SQL team perform the DB migration and then you can update the connection strings?
          get–command set–*DBConnection should all return $null values for DB connection.

          Reply
  • Nirmal Thangarasu

    February 14, 2019

    Disabling Logging is not sufficient. have to clear connection to existing DB as you said. That clears the cache. thank you

    Reply
  • Kiran

    March 21, 2019

    Buddy any Idea on how long will the configuration logging be stored?

    Reply
    • George Spiers

      March 21, 2019

      I’m not sure there is a limit. From the Studio console you can see 6 months of historical data. You can alternatively create a custom report that shows data from years back.

      Reply
      • Anonymous

        March 22, 2019

        Thanks much for your Reply

        Reply
  • Bit-101

    July 17, 2019

    I´m refering to your example in my post on Citrix Forum:
    https://discussions.citrix.com/topic/403962-site-monitoring-and-logging-how-to-put-these-datastores-into-the-same-database-instance/#comment-2045674
    I only want to know – was your Site, Logging and Monitoring in the same Database instance from the beginning. It look so in your example – see picture number 1 in your post where the Database is called XenApp.
    Really appreciate your answer.
    :0)

    Reply
    • George Spiers

      July 17, 2019

      Hello yes in the same instance.

      Reply

Leave a Reply