When installing Citrix XenApp/Desktop 7.6 three databases are installed to your SQL instance during site creation.
- Monitoring
- 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.
Kedar Pavaskar
December 14, 2016Was 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!
George Spiers
December 14, 2016Brilliant. Great work!
Jay
May 2, 2018Thanks alot for the help! You rock it.
Nirmal Thangarasu
January 31, 2019George, 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.
George Spiers
January 31, 2019I don’t at present but have found some articles online that may help:
https://www.citrix.com/blogs/2014/10/29/updating-database-connection-strings-in-xendesktop-7-x/
https://support.citrix.com/article/CTX140319
Anonymous
February 11, 2019ok. 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?
George Spiers
February 12, 2019Can 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.
Nirmal Thangarasu
February 14, 2019Disabling Logging is not sufficient. have to clear connection to existing DB as you said. That clears the cache. thank you
Kiran
March 21, 2019Buddy any Idea on how long will the configuration logging be stored?
George Spiers
March 21, 2019I’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.
Anonymous
March 22, 2019Thanks much for your Reply
Bit-101
July 17, 2019I´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)
George Spiers
July 17, 2019Hello yes in the same instance.