#Historic energy data gone after updating and changing local domain name

1 messages · Page 1 of 1 (latest)

terse scarab
#

I updated Home Assistant a while back, while also fixing hostname, and noticed recently that all my historical energy data for the last 3ish years is gone. It may perhaps be related to updating the Huawei Solar at the same time?
I'm hoping someone here would be able to help a somewhat newbie like me with how to locate the data and get it back into the energy overview, as I'm at a loss for where to start.

Thanks for helping

wintry hull
#

Are you sure you're connected to your old DB? I've had it happen where the DB was not ready when doing an update and then HA makes a new one.

abstract edge
#

Do you have a .corrupt database file in your config folder?

terse scarab
#

@abstract edge Yes!
"The file is not displayed in the text editor because it is very large (228.98MB)."

#

What do I do now 🙂 Google how to recover it? 🙂

abstract edge
#

If you have a backup the best thing is to probably restore that backup.

#

How to un-corrupt a corrupt database is something I can't help with.

#

.corrupt is when HA detects that there is corruption in your database and it can't use it anymore. Could be your hardware storage is failing, don't know.

terse scarab
#

Is there any way I can avoid losing the data from the intervening period?

#

home-assistant_v2.db.corrupt.2025-10-12

abstract edge
#

Not easily. If your really handy with databases maybe you can merge them somehow. But HA won't help with that.

terse scarab
#

I use mysql in my daily job for somewhat simple stuff... I guess I would know how to export data series, but man I imagine it could quickly become a huge task..

abstract edge
#

there are custom components that can import historical records to statistics

#

maybe if you just need to keep a handful of entities longterm you can re-import them into your new database, if they are recoverable from the corrupt file

terse scarab
#

Alright. Well so far so good. Thanks a lot for the pointer. I'll check my backups. Hopefully I still have one from back then

#

yeah.. I'm guessing I'm not the first hitting this issue so hopefully I can google something here.