DB image malformed. How to fix it?

For all ya googlers (or ducckduckgoers). I fixed mine!

  • shut down HA
  • via shell cd into config folder and execute:

sqlite3 ./home-assistant_v2.db “.dump” | sqlite3 ./home-assistant_v2.db.fix
mv ./home-assistant_v2.db ./home-assistant_v2.db.broken
mv ./home-assistant_v2.db.fix ./home-assistant_v2.db

  • Start ha and check logs and history via ui if fixed
  • Delete home-assistant_v2.db.broken
31 Likes