Skip to content

Add data export/import to migrate between spoolbook installs - #130

Merged
t2vi merged 1 commit into
mainfrom
feat/data-export-import
Aug 26, 2026
Merged

t2vi merged 1 commit into
mainfrom
feat/data-export-import

Conversation

@t2vi

@t2vi t2vi commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Closes #129. Grilled via /grill-with-docs, design in docs/adr/0033: a zip bundle (manifest.json + bundled .3mf files) merged into the target install rather than replacing it -- Filament/Printer/FilamentColor dedupe by natural key, everything else always inserts with every foreign key remapped from source ids to whatever the target actually assigns. Preview step reports per-table counts before anything commits, since most tables have no natural identity to dedupe a re-import against.

Implemented via one generic row<->JSON mechanism (row_to_json/ insert_json_row) reused across every table instead of hand-written structs per table -- print_profiles alone has ~140 columns. Settings page gets a new Data section (Export button, Import file-picker -> preview -> confirm).

Verified end-to-end in a real browser against the real dev DB (3231 filaments, 1391 colors, real prints/profiles/projects): preview correctly reported everything already-existing, confirming the dedupe rules hold on real data, not just synthetic tests. A first pass at this test also surfaced and fixed a real gap -- FilamentColor wasn't deduped like Filament/Printer, so a self-import added 1391 duplicate colors before the rule existed.

Closes #129. Grilled via /grill-with-docs, design in docs/adr/0033: a zip
bundle (manifest.json + bundled .3mf files) merged into the target install
rather than replacing it -- Filament/Printer/FilamentColor dedupe by
natural key, everything else always inserts with every foreign key
remapped from source ids to whatever the target actually assigns. Preview
step reports per-table counts before anything commits, since most tables
have no natural identity to dedupe a re-import against.

Implemented via one generic row<->JSON mechanism (row_to_json/
insert_json_row) reused across every table instead of hand-written structs
per table -- print_profiles alone has ~140 columns. Settings page gets a
new Data section (Export button, Import file-picker -> preview -> confirm).

Verified end-to-end in a real browser against the real dev DB (3231
filaments, 1391 colors, real prints/profiles/projects): preview correctly
reported everything already-existing, confirming the dedupe rules hold on
real data, not just synthetic tests. A first pass at this test also
surfaced and fixed a real gap -- FilamentColor wasn't deduped like
Filament/Printer, so a self-import added 1391 duplicate colors before the
rule existed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@t2vi
t2vi merged commit 984ebe2 into main Aug 26, 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.

Export/import: migrate data between spoolbook installs

1 participant