Fix corrupted / malformed SQLite database (home-assistant_v2.db)

I got sqlite3 “dump” to work on one of my older snapshots.
I tried to overwrite it in the /config directory. I then restarted HA.
It promptly deleted the database and created a new one.
How are you all copying the files ? Is there a way to partially shut down HA to do this ?
I’m using HAOS, the SSH terminal add-on, and scp / cp commands to transfer and copy the DB files over.

Its something like copy db to my linux pc, on cli do
sqlite3 home-assistant_v2.db1 ".recover" |sqlite3 home-assistant_v2_fixed.db
ssh into HA, do
ha core stop
replace the db using samba addon
ha core start

Thanks. Are you talking about the “Samba share” add-on ?
Also, if I ssh into HA and do “ha core stop”, I can no longer ssh afterwards to “ha core start”. But I can go to the CLI on my HAOS VM terminal and type “ha core start” there.

i use Advanced SSH & Web Terminal