Page 1 of 1

Database reset due to huge data gap in sensor data....

Posted: Monday 30 July 2018 17:24
by kimhav
Are there any quick way of performing a quick and easy reset of the database? Asking since I've noticed that over the last month when running Domoticz on a Rpi3 it hasn't for what ever reason not stored the values for any sensor at all and therefor I got a huge gap in the data now and for the sake of it I just want to make clean wipe of the database but keeping the devices.

Why Domoticz managed to generate a huge gap in the data is another story and currently I don't know why and I've never in the past have had such problem. Only difference is that I in the past ran on a proper server and now in the Rpi3 so I guess that it's usage of Pi3 and SD as storage which might be the cause here. But, open for suggestion on how to avoid this again.

Re: Database reset due to huge data gap in sensor data....

Posted: Monday 30 July 2018 19:26
by waaren
kimhav wrote: Monday 30 July 2018 17:24 Are there any quick way of performing a quick and easy reset of the database? Asking since I've noticed that over the last month when running Domoticz on a Rpi3 it hasn't for what ever reason not stored the values for any sensor at all and therefor I got a huge gap in the data now and for the sake of it I just want to make clean wipe of the database but keeping the devices.

Why Domoticz managed to generate a huge gap in the data is another story and currently I don't know why and I've never in the past have had such problem. Only difference is that I in the past ran on a proper server and now in the Rpi3 so I guess that it's usage of Pi3 and SD as storage which might be the cause here. But, open for suggestion on how to avoid this again.
the history from device, scenes and sensor date is stored in many different tables in the domoticz.db
Spoiler: show
Fan
Fan_Calendar
LightingLog
Meter
Meter_Calendar
MultiMeter
MultiMeter_Calendar
Percentage
Percentage_Calendar
Rain
Rain_Calendar
SceneLog
Temperature
Temperature_Calendar
UV
UV_Calendar
Wind
Wind_Calendar
you could make two copies of your domoticz.db and delete all rows from these tables on one copy. Stop domoticz and copy the modified database over the current domoticz.db. If everything works OK, you are where you want te be. If not copy back the second copy.