From efca73bcd4fc47e4ab2845fef8a9b80c4cbc6db0 Mon Sep 17 00:00:00 2001 From: David Young Date: Sat, 21 Nov 2026 20:05:59 -0700 Subject: [PATCH] PLAN: database backup and restore; messages survive #fragment redirects The redirect helper put ?msg= after the #fragment, so "imported" and "saved" never showed after lead-source imports or campaign assignments. Co-Authored-By: Claude Opus 5.5 --- PLAN.md | 52 ++++++++++++++++++++++++++++++++++++- internal/web/server.go | 9 +++++-- internal/web/server_test.go | 14 ++++++++++ 3 files changed, 72 insertions(+), 3 deletions(-) diff --git a/PLAN.md b/PLAN.md index 2bf73c3..e99c5d9 100644 --- a/PLAN.md +++ b/PLAN.md @@ -83,7 +83,8 @@ running a Federated Core can install as a CoreDesktop sibling. `~/.hermes/.env`. - **No inbound webhooks.** Nothing on the internet can reach the app, so Stripe and the social platforms are polled. Stripe's Events API makes this cheap. -- **Data in SQLite.** That means one file to back up. The existing +- **Data in SQLite.** That means one file to back up (see Future + enhancements: back up and restore). The existing `posts.json`, `dismissed.json` and `state.json` are imported on first start. ### The Hermes bridge (Core MCP → EspoCRM) @@ -687,6 +688,55 @@ Not in any phase yet; picked up when the user asks. - Docs: learn.microsoft.com/linkedin/marketing/community-management-app-review and .../community-management/community-management-overview. +2. **Back up the database and restore from a backup** (asked for + 2026-11-21). Today backups are copies made by hand before risky changes + (`app.db.pre-phase1`, `app.db.pre-dedupe`, …) in the data folder. A plain + `cp` of a running database in WAL mode can miss recent writes, so + backups must use SQLite's own backup (`VACUUM INTO` or the online backup + API). This doesn't depend on any phase. + - **Where they go:** `~/.local/share/supermarket/backups/`, named + `app--