Repository navigation
feat(export): whole-instance export with version header, CLI and restore drill - #105
Merged
Merged
Conversation
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
Bot
force-pushed
the
feat/is-82-instance-export
branch
from
November 15, 2026 14:33
319ac35 to
428506a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 withno-store, behind the same bearer auth as the other collection routes.npm run export -- [dir]: the same bundle as a directory tree (export.jsonheader,pages/byte-identical to the space,collections/<name>.jsonplus.csvper collection). Needs no running server; resolvesSPACE_DIRandCOLLECTIONS_DBexactly 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.svelte-checkclean, build green.Evidence, measured 2026-11-15 against a copy of the live instance (90 pages, 8 collections, 236 rows):
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.