fix: update dump file handling in install.ps1 to use resolved path for PostgreSQL restoration

This commit is contained in:
DESKTOP-RTLN3BA\$punk 2026-03-03 13:32:43 -08:00
parent 0cffa206ad
commit 1541cb3c7b

View file

@ -208,11 +208,12 @@ if ($MigrationMode) {
if (-not (Test-Path $DumpFile)) {
Write-Err "Dump file '$DumpFile' not found. The migration script may have failed."
}
$DumpFilePath = (Resolve-Path $DumpFile).Path
Write-Info "Restoring dump into PostgreSQL 17 - this may take a while for large databases..."
$restoreErrFile = Join-Path $env:TEMP "surfsense_restore_err.log"
Push-Location $InstallDir
Invoke-NativeSafe { Get-Content $DumpFile | docker compose exec -T -e "PGPASSWORD=$DbPass" db psql -U $DbUser -d $DbName 2>$restoreErrFile | Out-Null } | Out-Null
Invoke-NativeSafe { docker compose exec -T -e "PGPASSWORD=$DbPass" db psql -U $DbUser -d $DbName < $DumpFilePath 2>$restoreErrFile } | Out-Null
Pop-Location
$fatalErrors = @()