Moving Modbus datapoint history and events from one datasource to another datapoint/datasource
I am reading many Modbus datapoints from Modbus Source S. I need to reconfigure Mango to instead poll the same datapoint from new Modbus datasources A, B, and C. At that point, I may disable datasource S. I could create the new sources by exporting then editing the datasource S JSON and then importing, but what SQL command would I use to transfer the history and the point link data so the old pointvalue database and events are linked to the new point in the new data source, so that the new datapoint will be able to display the old history values? Will that command unlink the history from the old point in datasource S, or will the point history be accessible from both datasource points? In other words, do I have to disable or delete the point from the old datasource at that time?
I'm using NoSQL to store pointValues and mySQL for configuration and events.
JoelHaggar last edited by
Hi Pedro, You can move a data point from one data source to another as long as the data sources are correct. You just need to update the dataSourceId field in the dataSources table.
An example SQL command would be:
update dataPoints set dataSourceId = 23 where deviceName = "XYZ"
Where the data source ID you want them moved to is 23.
The full command is going to depend on how you are going to filter out your data points to move only the ones you want to move.