Phase 6 part 2: restore from a backup

A restore is staged (checked, the current database backed up) and swapped
in when the app next starts. Settings → Backups restores with a
self-restart, cancels a waiting restore, and takes uploads; supermarket
restore takes a backup name or a file; supermarket backup --with-secrets
makes an archive with the keys, for moving machines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 14:46:36 -07:00
co-authored by Claude Opus 5.5
parent 5313369328
commit fa4792e0fe
11 changed files with 744 additions and 4 deletions
+15
View File
@@ -115,6 +115,21 @@ Throughout, also notice:
terminal; with the app stopped they say to start it.
- [ ] The old `app.db.pre-*` files are gone from the data folder and listed
as "An older copy".
- [ ] *Restore* on a backup asks first; then the page says it's restarting
and reloads by itself within about ten seconds, showing "Restored
from …" and the backup of what was there before. Data made after the
backup is gone; data from before it is back.
- [ ] A backup from a newer Supermarket (a higher schema) has no *Restore*
button; `supermarket restore` refuses it with a reason.
- [ ] *Upload* a downloaded `.db`: it's checked and listed ("uploaded …");
a file that isn't a Supermarket database is refused.
- [ ] `supermarket restore <name>` (a name from `supermarket backups`) and
`supermarket restore ~/Downloads/<file>.db` both work and restart the
app.
- [ ] `supermarket backup --with-secrets` makes a `.tar.gz` in the backups
folder (only you can read it) and warns about it; on another computer
`supermarket restore <file>.tar.gz` brings back the data and the keys
(Settings show them as saved).
## 4. Inventory