fix: add error handling for missing dump file in migration script and update logging for migration step

This commit is contained in:
Anish Sarkar 2026-02-27 04:06:01 +05:30
parent 3e29ae37fa
commit ccae5ffeb1
2 changed files with 3 additions and 1 deletions

View file

@ -178,6 +178,8 @@ if $MIGRATION_MODE; then
wait_for_pg "${DB_USER}"
step "Restoring database"
[[ -f "${DUMP_FILE}" ]] \
|| error "Dump file '${DUMP_FILE}' not found. The migration script may have failed.\n Check: ./surfsense-migration.log\n Or run manually: bash ${INSTALL_DIR}/scripts/migrate-database.sh --yes"
info "Restoring dump into PostgreSQL 17 — this may take a while for large databases..."
RESTORE_ERR="/tmp/surfsense_restore_err.log"

View file

@ -132,7 +132,7 @@ wait_for_pg() {
success "${label} is ready."
}
step "Migrating data from legacy database (PostgreSQL 14 → 17)"
info "Migrating data from legacy database (PostgreSQL 14 → 17)"
# ── Step 0: Pre-flight checks ─────────────────────────────────────────────────
step "0" "Pre-flight checks"