Database Import/Export Functionality #10

Closed
opened 2026-01-15 04:37:49 +00:00 by tonym · 0 comments
Owner

Summary

Add ability to export and import all Spoolman data for backup and database migration purposes.

Use Case

  • Migrate from PostgreSQL to SQLite (or vice versa)
  • Backup/restore data
  • Move between servers

Proposed Implementation

Export

  • API endpoint: GET /api/v1/backup/export
  • Returns JSON with all: vendors, filaments, spools, locations, settings, adjustments
  • Include all relationships and custom fields
  • Option to download as .json file from UI

Import

  • API endpoint: POST /api/v1/backup/import
  • Accepts JSON in same format as export
  • Options: merge vs replace
  • UI button in Settings page

Data Format

{
  "version": "1.0",
  "exported_at": "2026-01-14T...",
  "vendors": [...],
  "filaments": [...],
  "spools": [...],
  "locations": [...],
  "spool_adjustments": [...],
  "settings": [...]
}

Notes

  • Maintain referential integrity on import
  • Handle ID conflicts (remap or skip)
  • Progress indicator for large imports

Upstream References

## Summary Add ability to export and import all Spoolman data for backup and database migration purposes. ## Use Case - Migrate from PostgreSQL to SQLite (or vice versa) - Backup/restore data - Move between servers ## Proposed Implementation ### Export - API endpoint: `GET /api/v1/backup/export` - Returns JSON with all: vendors, filaments, spools, locations, settings, adjustments - Include all relationships and custom fields - Option to download as .json file from UI ### Import - API endpoint: `POST /api/v1/backup/import` - Accepts JSON in same format as export - Options: merge vs replace - UI button in Settings page ### Data Format ```json { "version": "1.0", "exported_at": "2026-01-14T...", "vendors": [...], "filaments": [...], "spools": [...], "locations": [...], "spool_adjustments": [...], "settings": [...] } ``` ## Notes - Maintain referential integrity on import - Handle ID conflicts (remap or skip) - Progress indicator for large imports ## Upstream References - https://github.com/Donkie/Spoolman/issues/303 (migration documentation)
tonym closed this issue 2026-01-15 04:47:22 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: tonym/spoolman2#10
No description provided.