Skip to content

feat(export): whole-instance export with version header, CLI and restore drill - #105

Merged
ssalentin merged 6 commits into
mainfrom
feat/is-82-instance-export
Nov 15, 2026
Merged

ssalentin merged 6 commits into
mainfrom
feat/is-82-instance-export

Conversation

@ssalentin

Copy link
Copy Markdown
Owner

Implements #82: one export covers the whole instance, with a stable version header.

  • GET /api/v1/export: JSON bundle of every page and every collection (format: stichpunkt-export, version: 1, exported_at, app_version), served as a dated attachment with no-store, behind the same bearer auth as the other collection routes.
  • npm run export -- [dir]: the same bundle as a directory tree (export.json header, pages/ byte-identical to the space, collections/<name>.json plus .csv per collection). Needs no running server; resolves SPACE_DIR and COLLECTIONS_DB exactly like the service.
  • docs/export.md: endpoint, CLI tree, restore procedure into a fresh instance, the restore drill, and limitations (attachments and page history are not included).
  • scripts/restore-drill.sh: rerunnable drill. Copies space and database into a temp dir, adds a marker page, exports the copy, restores it into a fresh instance through the public API, re-exports and compares page set, page bytes and row values; parses every CSV with an RFC 4180 reader; proves isolation via the marker page and an unchanged source collection list.
  • Tests: builder header and content, route auth and shape, CLI materialization. 459 tests pass (baseline 455 plus 4 new), svelte-check clean, build green.

Evidence, measured 2026-11-15 against a copy of the live instance (90 pages, 8 collections, 236 rows):

restore drill evidence

The drill ends DRILL PASS: the fresh instance matches the source export on page set, page bytes and row values, every CSV parses with the property names as header, and the source instance stays untouched.

Two notes from the live run. One legacy Wunschliste row carries multi_select values that are no longer in the property options; the write API refuses them by design, so the restore widens the options with the values the exported rows carry, and docs/export.md names that step. Attachments stay out of scope per the issue and are documented as a limitation.

The drill copies space and database into a temp dir, exports the copy with
npm run export, restores it into a fresh instance through the public API,
re-exports and compares page set, page bytes and row values. Select options
are widened with legacy row values so old rows restore intact; the docs name
that step. Isolation is proven by a marker page and an unchanged source
collection list.
Terminal capture of a DRILL PASS run on 2026-11-15: 90 pages, 8 collections,
236 rows restored into a fresh instance and compared byte for byte.
@openbotgit
openbotgit Bot force-pushed the feat/is-82-instance-export branch from 319ac35 to 428506a Compare November 15, 2026 14:33
@ssalentin
ssalentin merged commit 6c84dea into main Nov 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant