Guides
Back up PostgreSQL on Windows, properly
Every guide here shows the complete do-it-yourself route with pg_dump, a script and Task Scheduler. Each one also says where PostgresBackup can take the work off your hands, if you'd rather not maintain that. Want the script without the typing? Use the backup script generator.
Start here
By provider
How to back up a Supabase database to your PC every nightFree-plan projects get no backups at all. Here's how to take your own every night over the session pooler, and how to restore them.How to back up a Neon database to WindowsNeon's history window is short on smaller plans. Keep your own nightly copy, using the direct endpoint rather than the pooled one.How to back up Amazon RDS for PostgreSQL to a Windows PCRDS snapshots can't leave AWS as a file you can restore anywhere. Here's how to keep your own pg_dump copies on Windows.How to back up Azure Database for PostgreSQL to WindowsAzure's built-in backups restore only to a new Azure server. Here's how to keep portable pg_dump copies on your own Windows machine.How to back up Google Cloud SQL for PostgreSQL to WindowsCloud SQL backups stay in Google Cloud. Here's how to get your own pg_dump copies onto Windows, through the Auth Proxy or authorized networks.How to back up PostgreSQL running in Docker on WindowsA Docker volume isn't a backup. Two ways to dump a Postgres container on Docker Desktop, and the PowerShell redirect that silently corrupts dumps.How to back up DigitalOcean Managed PostgreSQL to WindowsDigitalOcean keeps a week of backups inside DigitalOcean. Here's how to keep your own copies on a Windows machine.How to back up a Railway Postgres database to WindowsA logical dump is the one backup that survives deleting the Railway project. Here's how to take one from Windows, through the TCP proxy or the CLI tunnel.How to back up a Render PostgreSQL database to WindowsFree Render databases expire after 30 days and are never backed up. Here's how to keep your own copies, on any plan, from Windows.How to back up Heroku Postgres to WindowsTwo ways to get Heroku Postgres onto your own disk, and the credential rotation that silently breaks external backup jobs.
Errors and how-tos
Fix "pg_dump: aborting because of server version mismatch" on Windowspg_dump must be at least as new as the server. Here's how to find which pg_dump you're actually running and fix it.How to give pg_dump a password on Windows (pgpass.conf, PGPASSWORD)Where pgpass.conf lives on Windows, the encoding trap that makes it silently fail, and which method suits a scheduled backup.How to install only the PostgreSQL command-line tools on WindowsYou don't need a PostgreSQL server on your PC to back one up. Two ways to get just pg_dump, pg_restore and psql.How to copy a PostgreSQL database to another serverRefresh staging from production, move to a new host, or pull a local copy, with pg_dump and pg_restore in two commands.How to restore a PostgreSQL .dump or .sql file on WindowsRestore a custom-format .dump with pg_restore or a plain .sql with psql, into a new or an existing database, and get past the usual errors.pg_dump custom vs. plain format: which should you use?Custom format for backups, plain SQL for reading and hand-editing, directory format for big databases. Here's why.PostgreSQL backup retention: how many backups to keep (GFS explained)"Keep the last 7" fails the day you notice a problem three weeks late. Grandfather-father-son retention covers a year in about 23 files.Off-site PostgreSQL backups for free with OneDrive, Dropbox or Google DriveThe cheapest off-site copy is a folder you already sync. What to watch for with half-written files, Files On-Demand and readable data.
Weighing up tools? See the honest comparisons with pgAdmin, SQLBackupAndFTP, Databasus and a plain Task Scheduler script.
The shortcut
Rather not maintain a backup script?
PostgresBackup is a Windows app that does all of this for you, with nothing to script and nothing to remember.
- Scheduled pg_dump backups from a background service that starts with Windows
- Keep the last N files plus hourly, daily, weekly, monthly and yearly copies
- Restore any backup, or clone a database to another server, in a few clicks
- PostgreSQL client tools included; standard .dump files, no lock-in
- No account, no subscription, nothing leaves your machine
Clones, restores and manual backups are free. Scheduled backups are free for 14 days, then $9.99 once (launch price; $24 from January 1).