Best way to export and then import a datasource with its data
I've got an ES with a compromised file system and many modules which aren't working. Luckily the main datasource seems intact and I would like to back it up onto my PC so that I can restore it later onto a replacement ES that Infinite Automation was kind enough to send me. I had no trouble exporting the datasource definition in XML or CSV and saving that but I was wondering what the best way is to backup and/or export all the data. What makes this task even more challenging is that I currently don't have the password for SSH or Webmin so I am trying to accomplish this purely from Mango.
jeremyh last edited by
How many datapoints?
I think maybe exporting in CSV or XLS (from the watch page) then importing into the new system may be the most straightforward. You may have to do that in batches if you have a lot of points/data.
The best way to save and restore the data source and data point configuration (as well as any other settings) I think is to use the 'configuration import/export' page and generate a JSON file of your system's configuration. When you import this double-check that the system settings you're importing into the new system aren't going to lock you out or anything (eg. by changing the MangoES IP address).
There are only about 113 data points at this time but that's more than I would want to export and import one at a time. I find it odd that you can't simply export an entire datasource's history at once or be given an option on how many days worth to export. Alternately there should be some way to save or copy a backup file from within Mango. Once business resumes again next week I expect I'll get a copy of the ES password back from Infinite Automation so I can copy the backup to my PC so I can restore it on the new ES but thought there might be some way to do it from within Mango that I had overlooked.
I checked out the configuration import / export and tried it out but it doesn't include any data - only the definitions.
jeremyh last edited by
Ah, I see. Yes, the JSON export contains the 'definitions' (configuration) and the CSV/XLS export contains the actual point history.
By exporting the JSON and a CSV/XLS file, then importing them on the new system, you can migrate the entire system's configuration and data history.
I find it odd that you can't simply export an entire datasource's history at once or be given an option on how many days worth to export.
You can do this using the watch list page.
Alternately there should be some way to save or copy a backup file from within Mango.
Mango does make regular backups but you need access to the server to retrieve them. Your circumstance, locked out of the server but able to access Mango, is quite unusual. It is far more likely that someone would be locked out of Mango/unable to start mango but still able to access the server.
phildunlap last edited by phildunlap
Were you sent a USB utility with the first ES and have physical access? I would use the USB utility to either change your SSH password or you can use the backup.properties file. Your USB Utility needs the request.properties file it came with, and empty backup.properties file in USB/script-enabled and USB/MangoES and USB/script-available directories.
Alternatively you could use the Persistent TCP publisher to sync all the data for the points to another Mango.
If I need to move a datasource from one Mango to another, typically I'm moving everything from that Mango, so I just move the whole Mango/databases directory or Mango/databases and a mysqldump if using MySQL