How to back up a Neon database to Windows

Neon's history window is short on smaller plans. Keep your own nightly copy, using the direct endpoint rather than the pooled one.

Updated October 14, 2026 · 3 min read

Short on time? PostgresBackup does everything on this page from a Windows app: scheduled pg_dump backups, retention and one-click restores. Download it free.

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:

EndpointHost looks likeUse for backups?
Pooledep-cool-river-123456-pooler.us-east-2.aws.neon.techNo. It goes through PgBouncer, which pg_dump doesn't work well with
Directep-cool-river-123456.us-east-2.aws.neon.techYes

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:

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" neondb

A 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_dump backs up one database. Run it once per database if a branch has several. Neon doesn't support pg_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:

PowerShell
$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:

Config
ep-cool-river-123456.us-east-2.aws.neon.tech:5432:neondb:neondb_owner:YOUR_PASSWORD

Or let the script generator build all of it for you.

Restoring

Into a local or self-hosted PostgreSQL:

PowerShell
& "$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.

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).