Problem with home_assistant_v2.db

Hi! I deleted the home_assistant_v2.db file following a YouTube tutorial to fix a problem with the status history, and since then I can’t access the Home Assistant interface, even locally. Looking at the “terminal” on the Raspberry Pi (server), it loads perfectly and doesn’t display any errors, so it seems to be starting normally. Can anyone help me restore a backup or that file? If I try to access it from an external connection, it says 502 BAD GATEWAY, and locally, it tells me the page won’t load because it has no data.

Thanks!

Make sure you also delete the temp files for sqlite:

  • home-assistant_v2.db-shm
  • home-assistant_v2.db-wal

But now I don’t have access to the interface through the browser, so I can’t delete anything. I can only access it through the server’s CLI by connecting a keyboard to the Raspberry Pi. I don’t know what to do to restore it so I can manage it from the PC interface.

Just login through the CLI and delete those two files (or rename them to be on the safe site): home-assistant_v2.db-shm and home-assistant_v2.db-wal.
Restart HA thereafter.

But how can I do that? What commands do I have to enter in the CLI? I can only access the Raspberry CLI, so I can only type commands.

As soon as I have some time, I’ll try restoring a backup from the CLI. Although I’m realizing I didn’t recover the backup from when the problem started, and now it’s being overwritten, so it might not help me at all…