From 9e4160d61997763f781e0a4decad9c22b09673a9 Mon Sep 17 00:00:00 2001 From: Adeel Ahmad Date: Thu, 15 Oct 2026 07:45:50 +0000 Subject: [PATCH] fix(backups): keep and restore Lens's files with each backup, not only the database Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_012qkVq3xnW9YJboxRYV4qSv --- CHANGELOG.md | 6 + docs/database.md | 20 +- docs/deployment.md | 5 +- fastapi_backend/app/api/v1/routes/backups.py | 32 ++-- fastapi_backend/app/domain/backups.py | 81 ++++++-- fastapi_backend/app/domain/datafiles.py | 180 ++++++++++++++++++ fastapi_backend/app/domain/migrations.py | 7 + fastapi_backend/app/schemas/updates.py | 3 +- fastapi_backend/tests/api/test_backups.py | 79 +++++++- .../app/openapi-client/types.gen.ts | 10 +- .../components/settings/backups-panel.tsx | 9 +- nextjs-frontend/openapi.json | 11 +- 12 files changed, 392 insertions(+), 51 deletions(-) create mode 100644 fastapi_backend/app/domain/datafiles.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 480efd55e..e9cc8121d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ The backend (`fastapi_backend`) and the frontend (`nextjs-frontend`) are version ## Unreleased +- **Backups hold Lens's files too.** Each backup now also keeps the files under `data_dir` (uploads, objects, media, + frames, renditions, web pages, reports, exports, podcasts, certificates), and restoring one puts them back. Files + that haven't changed since the previous backup are hard links, so a backup takes only the room of what changed; the + first one takes as much room as the files. Downloads and copies on a storage connection carry them as well. Older + backups show *database only* ([Backups](docs/database.md#backups)). + ## 0.9.0 October 15, 2026 {id="0.9.0"} - **Evidence PDFs hold everything Lens found.** After each resource's own file come pages of what Lens knows about diff --git a/docs/database.md b/docs/database.md index b05032e18..8a62d9f6a 100644 --- a/docs/database.md +++ b/docs/database.md @@ -144,10 +144,17 @@ first ([Updates and backups](updates.md)). Each is one entry in `/back | `before-restore` | what the database held just before a restore replaced it | the newest three | * With a server, `-