feat: drive migration & Tier 2 restic deprecation (v0.18.0)

Phase 1: Deprecate restic as Tier 2 method (rsync only), auto-migrate on startup
Phase 2: Enhanced per-app migration with backup awareness, DB dump copy, auto-cleanup
Phase 3: Full drive migration with decommissioned state, rollback support, wizard UI
Phase 4: Hub report includes decommissioned drive state

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-19 21:49:14 +01:00
parent bdbe170a54
commit 99bf3ca7a8
22 changed files with 1725 additions and 402 deletions
+44
View File
@@ -1,5 +1,49 @@
## Changelog
### What was just completed (2026-02-19 session 60)
- **v0.18.0 — Drive Migration & Tier 2 Restic Deprecation:**
Full drive replacement workflow with decommissioned state, enhanced per-app migration with backup awareness, and deprecation of restic as a Tier 2 cross-drive backup method (rsync only).
**Phase 1 — Restic Tier 2 Deprecation:**
- `settings.go`: Auto-migrate restic→rsync on startup via `migrateResticToRsync()` in `Load()`
- `crossdrive.go`: Removed `runResticBackup()`, `pruneResticRepo()`, `ensureResticRepo()`; `RunAppBackup()` calls rsync directly
- `backup.go`: Removed Tier 2 secondary restic scanning from `ListAllSnapshots()`
- `settings.go`: Removed cross-drive restic password methods (`GetOrCreateCrossDrivePassword`, etc.)
- `deploy.html`: Removed method dropdown (rsync/restic selector)
- `handlers.go`: Simplified `Tier2DriveGroup` (flat `Items` list), removed method handling from `settingsCrossBackupHandler()`
- `backups.html`: Removed method split in Tier 2 details section
- `router.go`: Always set method to "rsync" in cross-backup API
- `infra_backup.go`: Removed cross-drive password block from `CollectInfraBackup()`
- `main.go`: Removed `SetCrossDriveResticPassword` restore block
**Phase 2 — Enhanced Per-App Migration:**
- `backup.go`: Extracted `backupDrive()` from `runBackupInternal()` loop; added `TryRunDriveBackup()` with non-blocking lock
- `crossdrive.go`: Added `AnyRunning()` method
- `migrate.go`: Added `BackupTrigger` interface, `MigrateOrchestrator`, `RunEnhancedMigration()` with post-migration steps (DB dump copy, Tier 2 conflict clearing, auto-delete stale data, immediate Tier 1 backup)
- `storage_handlers.go`: Wired orchestrator into migration handler with `auto_delete_stale` support
- `migrate.html`: Added auto-delete checkbox, "cleaning" + "backing_up" progress steps
**Phase 3 — Full Drive Migration:**
- `settings.go`: Added `Decommissioned`/`DecommissionedAt`/`MigratedTo` fields to `StoragePath`; added `SetDecommissioned()`, `ClearDecommissioned()`, `IsDecommissioned()`, `GetDecommissionedPaths()`, `GetStorageLabel()`; `GetConnectedPaths()`/`GetSchedulableStoragePaths()` exclude decommissioned
- `migrate_drive.go` (NEW): `DriveMigrator` with `MigrateDrive()` 10-step flow (validate→stop→rsync→verify→configure→decommission→Tier2→start→backup→notify), `migrationTx` rollback pattern, excludes restic repos from rsync
- `settings.html`: Decommissioned card variant with "Kiváltva" badge, "Összes adat átköltöztetése" button on connected cards
- `migrate_drive.html` (NEW): Drive migration wizard (form + progress + done cards)
- `storage_handlers.go`: Added `/api/storage/migrate-drive`, `/api/storage/migrate-drive/status`, `/api/storage/decommission/remove` endpoints
- `server.go`: Added `/settings/storage/migrate-drive` route, `SetDriveMigrator()` setter
- `watchdog.go`: Skip decommissioned drives in `Check()`; block `SafeDisconnect()` for decommissioned
- `healthcheck.go`: Skip decommissioned paths in `checkStoragePaths()`
- `backup.go`: Skip decommissioned drives in `backupDrive()`/`runDBDumpsInternal()`; added `MigrationActiveCheck` callback to skip nightly backup during migration
- `crossdrive.go`: Reject decommissioned destinations in `ValidateDestination()`; skip decommissioned paths in `AutoEnableSmallApps()`
- `handlers.go`: Skip decommissioned drives in `buildStorageBars()`; made `SyncFileBrowserMounts()` public
- `main.go`: Added `driveMigrateStackAdapter`, wired `DriveMigrator` with all dependencies
**Phase 4 — Hub Changes:**
- `report/types.go`: Added `Decommissioned`/`MigratedTo` fields to `StorageReport`
- `report/builder.go`: Include decommissioned drives in report with flag
**Files modified:** 21 files modified + 2 new files (`migrate_drive.go`, `migrate_drive.html`).
### What was just completed (2026-02-19 session 59)
- **v0.16.1 + hub v0.1.8 — Hub Update Trigger + Controller URL Reporting:**