diff --git a/CLAUDE.md b/CLAUDE.md index f9a9aa0..2e3da68 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -135,6 +135,7 @@ This is a fork with UX improvements. Issues are tracked on the Gitea instance ab | 7 | 3dfilamentprofiles Integration | ✅ DONE | | 8 | (see Gitea #8) | ✅ DONE | | 9 | Hierarchical Locations (Room/Bin) | Open | +| 10 | Database Import/Export | ✅ DONE | ### Issue #1 Complete - Inline Creation Modals @@ -241,6 +242,28 @@ Data mapping (3dfp → Spoolman): - Diameter defaults to 1.75mm (3dfp doesn't provide) - Density from material lookup table +### Issue #10 Complete - Database Import/Export + +Full backup/restore functionality for migrating between databases (PostgreSQL ↔ SQLite). + +Backend (`spoolman/api/v1/backup.py`): +- `GET /api/v1/backup/export` - Downloads all data as single JSON file +- `POST /api/v1/backup/import` - Imports JSON with `replace` option +- Exports: vendors, filaments, spools, spool_adjustments, settings +- Handles ID remapping to maintain relationships +- Requires `python-multipart` package for file uploads + +Frontend (`client/src/pages/settings/generalSettings.tsx`): +- "Backup & Restore" section in Settings page +- "Download Backup" button for export +- File upload with "Import (Merge)" or "Import (Replace All)" options +- Confirmation dialog for destructive replace operation + +Migration workflow: +1. Export from PostgreSQL instance via Settings → Download Backup +2. Reconfigure container for SQLite +3. Import via Settings → Import (Replace All) + --- ## Local Development Setup @@ -292,5 +315,15 @@ The 3dfp GitHub repo only contains sample data (3 filaments). The full dataset m - Waiting for them to publish full JSON exports - Current implementation uses `sample-filaments.json` from the repo -### Next Up: Issue #9 - Hierarchical Locations +### Next Up: Docker Deployment to Unraid +Build and deploy this fork as a Docker container on Unraid with SQLite. + +Steps: +1. Build Docker image from this repo +2. Push to registry (Docker Hub or Gitea) +3. Deploy on Unraid with br0 network (own IP) +4. Use SQLite (no external DB dependency) +5. Import data via Settings → Import + +### Future: Issue #9 - Hierarchical Locations Add room/bin/shelf support for locations. See Gitea issue #9 for details.