Neon keeps a history of your database that you can restore to a point in time, but only within a window that depends on your plan, and on smaller plans that window is short. Anything older is gone. Neon's history also lives inside Neon: a deleted project, or a mistake you notice a week later, isn't covered. A nightly pg_dump to your own disk fills both gaps and gives you a portable file you can restore into any PostgreSQL.
Step 1: Get the direct (unpooled) connection string
In the Neon Console, open your project and click Connect. Turn Connection pooling off. The host name loses its -pooler suffix:
| Endpoint | Host looks like | Use for backups? |
|---|---|---|
| Pooled | ep-cool-river-123456-pooler.us-east-2.aws.neon.tech | No. It goes through PgBouncer, which pg_dump doesn't work well with |
| Direct | ep-cool-river-123456.us-east-2.aws.neon.tech | Yes |
Neon's own documentation says to run pg_dump over an unpooled connection. Note the role (often neondb_owner), the database (often neondb) and the password.
Step 2: Back it up
Neon requires SSL. In PowerShell:
$env:PGSSLMODE = 'require'
& 'C:\Program Files\PostgreSQL\18\bin\pg_dump.exe' `
-h ep-cool-river-123456.us-east-2.aws.neon.tech -U neondb_owner `
-F c -f "D:\Backups\neondb-$(Get-Date -Format yyyyMMdd-HHmm).dump" neondbA few Neon specifics:
- Compute auto-suspend is fine. If your compute has scaled to zero, the first connection wakes it. That adds a moment to the backup and nothing else.
- One database per run.
pg_dumpbacks up one database. Run it once per database if a branch has several. Neon doesn't supportpg_dumpall. - Branches are separate. Each branch has its own endpoint; back up the branches you care about (usually just
main). - Version: use client tools at least as new as your Neon Postgres version (shown in the project settings). PostgreSQL 18's tools cover every version Neon runs today.
Step 3: Schedule it
Use the script from the main Windows guide with these settings:
$Database = 'neondb'
$PgHost = 'ep-cool-river-123456.us-east-2.aws.neon.tech'
$Port = 5432
$User = 'neondb_owner'
$env:PGSSLMODE = 'require'and this line in pgpass.conf:
ep-cool-river-123456.us-east-2.aws.neon.tech:5432:neondb:neondb_owner:YOUR_PASSWORDOr let the script generator build all of it for you.
Restoring
Into a local or self-hosted PostgreSQL:
& "$bin\createdb.exe" -h localhost -U postgres neon_copy
& "$bin\pg_restore.exe" -h localhost -U postgres -d neon_copy --no-owner --no-privileges D:\Backups\neondb-20261014-0200.dump--no-owner --no-privileges skip Neon's role names, which don't exist elsewhere. To restore back into Neon, create a fresh database or branch, then run the same pg_restore against its direct endpoint with PGSSLMODE=require. Neon doesn't support pg_restore --create, so create the database first. More options are in restoring a .dump file on Windows.
How PostgresBackup handles Neon
Add the server in PostgresBackup and it warns you if you've pasted the -pooler endpoint. It includes current client tools and handles SSL from the connection string. It also runs the nightly job from a background service, so your PC doesn't need anyone signed in. Restores and clones (say, Neon main into a local database for testing) are a couple of clicks, and they're free.