surfup

Test a PostgreSQL restore before migration

A backup is useful only when it restores into an isolated environment and passes checks.

This is a rehearsal, not a production restore runbook. Confirm the database engine/version, data owner, retention, encryption, and available disk before taking a copy. Never test by overwriting production.

Create and identify the backup

  • Use the project’s documented backup method and a consistent snapshot. Record source database, version, timestamp/timezone, size, encryption key owner, and checksum.
  • Store the encrypted copy separately from the production host. Keep secrets out of shell history, tickets, and screenshots; verify that authorized staff can retrieve the key.

Restore into an isolated target

  • Create a new empty database with the intended major version and compatible roles/extensions. Restore there using the matching PostgreSQL restore tool; never point the command at production.
  • Check expected tables, row counts for critical records, constraints, application startup, and a read-only sample workflow. Record restore duration and mismatches before approving a migration.

Example and expected result

  • Choose the restore tool by format: plain SQL uses psql; custom/tar archives use pg_restore (inspect with pg_restore --list backup.dump). Restore into a disposable isolated database, with workers and outbound integrations off and test secrets only. Never use production for this drill.
  • Record exit code, elapsed time, expected table counts and known aggregate checks. If restore fails or counts differ, stop and inspect the error, extensions and roles on the test host before migration. pg_dump covers one database; global roles require a separate backup.

Primary sources

Latest materials

All materials

Practical articles and guides by SurfUp.

Guide · 10 min

“What is…” pages and AI answers: lost clicks or falling demand

A bank’s reference section lost 24% of visits as demand fell 13%. How to tell clicks lost to an AI block from falling demand and how to measure it.

Read
Guide · 8 min

Traffic dropped after a Google update

How to tell whether a traffic drop comes from a Google update, seasonality or a site fault. 2026 update timeline, a six-question check and a plan for the first 14 days.

Read
Guide · 9 min

Demand fell or the site lost: reconciling traffic with Wordstat

Demand for deposits fell 75%, traffic 37%; for cards demand −35%, traffic −63%. How to reconcile traffic with demand and not blame the site for the market.

Read