Merge old database with new (statistics)

Hi,
open the page set up old DB and new DB click RUN but nothing happend.


Can you help me?

Thanks for this tool. Has anyone recently tried the provided scripts?

My sqlite Home Assistant database is in a bad state and long-term statistics are not automatically calculated anymore. I would hate to loose a year of past data.

I haven’t used this tool for quite some time now since I’ve made it as I didn’t need it anymore. @arough mentioned it worked for him a month ago so I assume it should still work as intended.
Hoever, Home Assistant did change a lot overtime so it could be that the script needs an update. Anyone is free to make a pull request for an update!

Thanks for your reply @jory! I managed to fix my problem in the meantime with a little bit beginner SQL fu. It was probably caused by a migration that did not finish properly. I will save this thread though and come back to it, should the need arise.

I tried the tool again (my db keeps getting corrupt :frowning_face:) and have the same problem as the others.
Clicking on run seemingly does nothing, but creates copies of the newer database and appends _new-${timestamp}.


I get no output in the browser console or in the docker container.

I went back to the version of the PHP container I used when adding docker support to exclude docker as the error. Nothing changed.

Sadly I’m no jQuery guru and can’t figure out why nothing happens when clicking “Run”.

1 Like

Just to give an update on the topic:
I’m blind and do get an error in the network tab.
SQLSTATE[HY000]: General error: 11 database disk image is malformed.
I managed to fix it manually by dumping and reapplying the database.

I’m now adding a check and fix for this particular error to the tool.
At least I’m trying to :sweat_smile: