Safe Direct Modification of MQTT Tag SQLite DB?
Can we safely modify the MQTT Tag SQLite database directly with proper precautions?
We’re looking to implement a script that processes a CSV file of tags that need to be historized or removed, updating the database programmatically instead of using the MQTT Collector tile. This method would be significantly faster for us, as we manage tens of thousands—sometimes hundreds of thousands—of tags per site, and not all of them require historization.
If this approach is feasible, what precautions should we take when making modifications? Should we disable the collection group for the tag rows we plan to modify?
5 replies
-
I've not modified the MQTT Collector database directly. But I have done so with the CygNet Collector. Are you taking daily or hourly backup/snapshots of the disk?
On the CygNet Collector, you have to restart the collector service after every database change. I wonder if you'd have to do that with MQTT collector. Although the MQTT collector allows you to make changes in Admin without restarting the service. So hopefully there's a way to let it know you made changes.
I'm very interested to see how this works. One thing I love about Canary is that most of the configuration is available programmatically through JSON files of SQLite databases.
-
Hi ,
We have had some customers have success in doing this, but it is not something we can officially support as you will be making modifications under the covers which we cannot guarantee what the expected outcome will be. This also makes it difficult for our support team to handle issues that may arise from it. Having said that, any direct modifications are done at your own risk.
The MQTT collector service must be turned off during any modifications and turned back on after modifications are made and committed so that no conflicts arise between processes.
The schema of the mqttcollector.sqlite database can, has, and will change from time to time, requiring maintenance on any scripting or integration work that has been done to modify it when upgrading.
The fields and organization within the database are fairly self-explanatory; however, Canary provides no formal documentation or support in regards to the mqttcollector.sqlite file (like a data dictionary). You can use the UI to configure and run some tests to see how the collector works.