param( [string]$BackupSource = "/mnt/user/backups/borg", [string]$DumpSource = "/mnt/user/backups/borg/dumps/latest/immich.dump", [string]$RestoreRoot = "/mnt/user/backups/restore-lab/immich", [string]$ReportRoot = "/mnt/user/backups/restore-reports", [string]$BorgPassphraseFile = "/mnt/user/appdata/secrets/borg_repo_passphrase.txt", [switch]$WhatIf ) $Mode = if ($WhatIf) { "WhatIf" } else { "PlanOnly" } Write-Output "Immich restore test scaffold" Write-Output "BackupSource: $BackupSource" Write-Output "DumpSource: $DumpSource" Write-Output "RestoreRoot: $RestoreRoot" Write-Output "ReportRoot: $ReportRoot" Write-Output "BorgPassphraseFile: $BorgPassphraseFile" Write-Output "Expected Borg source paths inside archive:" Write-Output " - local/borg-dumps/latest/immich.dump" Write-Output "" Write-Output "Planned isolation:" Write-Output " - Test Postgres: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0 (same as production)" Write-Output " - Test Redis: redis:8.8.0-alpine (rebuildable, no restore needed)" Write-Output " - Test Server: ghcr.io/immich-app/immich-server:release (pinned digest like production)" Write-Output " - ML container: deliberately omitted" Write-Output " - Test endpoint: 127.0.0.1:12283 (no Traefik, no public domain)" Write-Output " - Productive photo paths under /mnt/user/photos/* will NOT be mounted" Write-Output "Mode: $Mode" Write-Output "" Write-Output "Planned steps:" Write-Output "1. Prepare restore-lab target under /mnt/user/backups/restore-lab/immich" Write-Output "2. Extract immich.dump from current Borg archive into test path" Write-Output ' Template: borg extract "$BORG_REPO" "::ARCHIVE_NAME" local/borg-dumps/latest/immich.dump' Write-Output ' Passphrase source: $(cat /mnt/user/appdata/secrets/borg_repo_passphrase.txt)' Write-Output "3. Start isolated test Postgres (VectorChord/pgvector) and test Redis" Write-Output "4. Import immich.dump into test Postgres with pg_restore -Fc --clean --if-exists --no-owner --no-privileges" Write-Output "5. Start restoretest-immich-server against isolated DB/Redis (ML omitted)" Write-Output "6. Run smoke checks against http://127.0.0.1:12283 and DB asset count" Write-Output "7. Write markdown report under /mnt/user/backups/restore-reports" Write-Output "8. Stop test containers and clean restore data after success" Write-Output "" Write-Output "This script is intentionally a scaffold only." Write-Output "No restore, no dump import, no container start, no file write is executed yet." Write-Output "Actual run happens on the Unraid host via ops/restore-tests/immich-restore-test.sh"