After Update HA no statistic data

Hi all,

after update to HA V 2023.5.1 and core_2023.3.6 all statistics are gone.
From the log to the energy dashboard data. Only current data runs in since the update. Is it possibly known why the data is gone after the update? Or how do I get this statistic data back?
Can I somehow check in the DB whether these are still available to me, but why are they no longer displayed?

thx and happy Weekend

It sounds like your database may be corrupted. If you SSH to your HA system check for the home-assistant_v2.db. If the current .db file is a pretty good size then you might have corruption and either may need to restore from backup or delete it and start fresh.

Having the same problem.
PS: For the moment I restored to 2023.4.

okey i search the DB…

-rw-r--r--    1 root     root       69.7M May  6 19:40 home-assistant_v2.db
-rw-r--r--    1 root     root       32.0K May  6 19:40 home-assistant_v2.db-shm
-rw-r--r--    1 root     root        4.4M May  6 19:40 home-assistant_v2.db-wal
-rw-r--r--    1 root     root      939.5M May  5 09:54 home-assistant_v2.db.corrupt.2023-05-05T07:55:03.725865+00:00

looks like the DB was really broken and a new one was created? Or what does the file “home-assistant_v2.db.corrupt.2023-05-05T07:55:03.725865+00:00” mean?
This DB was 939 MB in size. Is there a limit here? What can I do now to get my data back? Can the Corrupte be “fixed”?

edit:
i have a backup from 2023-05-05 1 AM.
Can i copy paste it from the Backup or is this not possible because the HA Version is different …

I have the same problem. After upgrading Home Assistant Core from 2023.3.1 to 2023.5.2, all statistic data is gone.

Maybe this post “No Data after HA core update from 23.1.1 to 23.5.0” helps the one or the other, especially if you come from an older release.

For me it has been solved now. What I did?
I just restored a backup (shortly before the update) as mentioned above and so the statistics were back again. And after a few days I simply updated again (this time to 2023.5.2). Now it works.

I hope this helps you.

Thank you, Red1! The post you referred to did help me. After applying intermediate updates, this is now resolved for me as well. Thanks again!

1 Like

same problem here, is there a way to recover it without restoring the previous backup ?

Hi all, I have the same issue here. After updating from 2023.3.6 to 2023.5.x. I have tried 5.1 5.2 and 5.3 but the same result. Running it in a vm so was able to revert to an earlier snapshot. Any way to update without db corruption?