Page 1 of 1

Back-up historical sensor data and start with fresh install

Posted: Friday 13 October 2017 11:46
by iMartien
Hi All,

I would like to start with a freshly new Domoticz install on my Raspberry Pi (too much testing has been done, upgraded to beta's etc), and re-add all my devices by hand (mostly rfxcom 433mhz stuff).

but I don't want to lose all historical data, especially my historical Smart Meter P1 usage history and temperature and rain history.

What would be the best way to achieve this? I don't want to install and dump my complete old database into it, because it has to much old and unused devices etc (my idx count is like 500+)

Thanks in advance!

Re: Back-up historical sensor data and start with fresh install

Posted: Saturday 14 October 2017 15:47
by sincze
Ha only 500. I had the same. Idea with 2000 idx due to testing. Just removed all unnecessary hardware/devices and system is still rock solid and fast. Maybe not the answer you were looking for but keep in mind all hope is not lost with 500+ idx.

Sent from my SM-G925F using Tapatalk


Re: Back-up historical sensor data and start with fresh install

Posted: Saturday 14 October 2017 16:54
by Egregius
Nothing wrong with high idx numbers. The database column is set to integer, witch means the limit is 2147483647.
Don't think you need to worry any time soon...

Anyway, to reply to your question.
Make a copy of your current database. Reinstall Domoticz with a clean database, add all your devices.
Use a SQL3lite explorer to open the copy of the database. Use a query to replace all old idx's in the tables LightingLog, MultiMeter, MultiMeter_Calendar, Percentage, Percentage_Calendar, Temperature, Temperature_Calendar, UV, UV_Calendar, Wind and Wind_Calendar with their corresponding new idx.
Remove any data you don't want to keep.
Export the data and import it in the new database.

Re: Back-up historical sensor data and start with fresh install

Posted: Sunday 15 October 2017 14:54
by sincze
Seems like a lot of work. let's thank the 'integer' for saving me from a lot of manual work.

Sent from my SM-G925F using Tapatalk