Copy Historical data (rra databases) between Toons
Posted: Fri Sep 21, 2018 9:00 pm
Hi all,
EDIT 29/3/2021 This method has been replaced by a much better solution further down on this thread :
viewtopic.php?f=103&t=12168&start=15#p96410
I would like to share my latest (small) activity: copy historical data from one Toon to another one.
Source and target Toons can either be a Toon 1 or a Toon 2.
It was my first Python script ever, so things can probably be done smarter, but hey, it works....
This script looks for matching topics in the rra database config files from both Toons and copy matching items from source to target with the target uuid's in the filename.
Items copied from one Toon to another: electricity and gas usage, electricity produced, OpenTherm boiler data and thermostat data (actual temperature, target temperature, program state)
Short 'manual':
- on your pc create three folders rraSource, rraTarget and rraOutput
- copy the contents of folder /qmf/var/hcb_rrd from the source Toon into the folder rraSource (typically about 80 files or more if you have smart switches)
- copy the contents of folder /qmf/var/hcb_rrd from the target Toon into the folder rraTarget (typically about 80 files or more if you have smart switches)
- copy the contents of folder /qmf/var/hcb_rrd from the target Toon into the folder rraOutput as well
- copy the contents of file /qmf/config/config_hcb_rrd.xml from the source Toon into the folder rraSource (contains the description of the files in rraSource)
- copy the contents of file /qmf/config/config_hcb_rrd.xml from the target Toon into the folder rraTarget (contains the description of the files in rraTarget)
- download the python script below and edit the first lines with actual folder names
- execute the Python script on your pc (e.g.: py CopyDataToon.py)
once executed, all matching data has been copied from the rraSource folder into the rraOutput folder (but renamed to the new uuid's of the target Toon)
- copy all files from rraOutput back to the folder /qmf/var/hcb_rrd on the target Toon
- sync and reboot Toon. That's all folks.
Have fun, comments are welcome of course.
Kind regardz,
Toonz
EDIT 29/3/2021 This method has been replaced by a much better solution further down on this thread :
viewtopic.php?f=103&t=12168&start=15#p96410
I would like to share my latest (small) activity: copy historical data from one Toon to another one.
Source and target Toons can either be a Toon 1 or a Toon 2.
It was my first Python script ever, so things can probably be done smarter, but hey, it works....
This script looks for matching topics in the rra database config files from both Toons and copy matching items from source to target with the target uuid's in the filename.
Items copied from one Toon to another: electricity and gas usage, electricity produced, OpenTherm boiler data and thermostat data (actual temperature, target temperature, program state)
Short 'manual':
- on your pc create three folders rraSource, rraTarget and rraOutput
- copy the contents of folder /qmf/var/hcb_rrd from the source Toon into the folder rraSource (typically about 80 files or more if you have smart switches)
- copy the contents of folder /qmf/var/hcb_rrd from the target Toon into the folder rraTarget (typically about 80 files or more if you have smart switches)
- copy the contents of folder /qmf/var/hcb_rrd from the target Toon into the folder rraOutput as well
- copy the contents of file /qmf/config/config_hcb_rrd.xml from the source Toon into the folder rraSource (contains the description of the files in rraSource)
- copy the contents of file /qmf/config/config_hcb_rrd.xml from the target Toon into the folder rraTarget (contains the description of the files in rraTarget)
- download the python script below and edit the first lines with actual folder names
- execute the Python script on your pc (e.g.: py CopyDataToon.py)
once executed, all matching data has been copied from the rraSource folder into the rraOutput folder (but renamed to the new uuid's of the target Toon)
- copy all files from rraOutput back to the folder /qmf/var/hcb_rrd on the target Toon
- sync and reboot Toon. That's all folks.
Have fun, comments are welcome of course.
Kind regardz,
Toonz