#Lost all my energy data last night [Move to System/DB related]

1 messages · Page 1 of 1 (latest)

red tendon
#

Hi all, I´ve been recording energy data since the release of the energy dashboard. But last night (between 03-04) I lost data! I can only see energy from the time after 04 this morning. Has anyone else experienced complete loss of energy data?

#

Seems log has this statement

sqlite3.DatabaseError: database disk image is malformed

#

Lost all my energy data last night [Move to System/DB related]

lyric narwhal
#

So whenever the database is detected to be corrupt, it gets saved in your config directory to <filename>.corrupt (or something like that), and a new database is created for going forward.

#

Depending on how bad the corruption was, it may or may not be partially recoverable, I do not know. (that's an exercise for the user, HA won't help with that).

#

You could also just restore a backup.

red tendon
#

Luckily I enabled automatic backups two days ago

#

But restoring seems not working properly.

#

It restored, but still seems everything is lost

proud compass
#

If you have an SD card chances are it failed/

red tendon
#

Nope quite new SSD

proud compass
#

k

red tendon
#

The json file in the downloaded backup says partial but I know I selected full

#

I have more backups, but seems backup/restore did not work for me

lyric narwhal
#

That's probably a topic for another thread/github issue.

red tendon
#

Agree. When creating this I had not discovered the DB issue

#

Interesting. Not the first time, almost exactly a year apart 🙂

proud compass
#

Why are you keeping a year old (or any for that matter) corrupt database files. Throw something away...