What you will learn:
About backup strategies
About built-in backups with point-in-time restore
Creating backups using pg_dump
How to automate backups with GitHub Actions
Related resources
Neon offers two primary backup strategies, which you can use separately or in combination, depending on your requirements.
Instant Point-in-Time Restore (PITR)
With Neon's instant point-in-time restore capability, you can automatically retain a "history" of changes—ranging from 1 day up to 30 days, depending on your Neon plan. This feature lets you recover your database to any specific moment without the need for traditional database backups or separate backup automation. It's ideal if your primary concern is fast recovery after an unexpected event.
By default, Neon projects retain 1 day of history. You can increase your history retention period on Neon as follows:
With this strategy, the only required action is setting your desired history retention period. Please keep in mind that increasing your history retention period also increases storage, as changes to your data are retained for a longer period.
To get started, see Point-in-time restore.
Backups withpg_dump
For scenarios that require a more traditional approach to backups—such as business continuity, disaster recovery, or compliance with regulatory requirements—you can use traditional methods, such as creating regular backups using the Postgres
pg_dump
utility.For information about using
pg_dump
with Neon, you can refer to our Migrate data from Postgres with pg_dump and pg_restore guide.Automating backups to S3 with
pg_dump
and GitHub ActionsIf you need to automate
pg_dump
backups to remote storage, this two-part guide walks you through setting up an S3 bucket and a GitHub Action to automate backups on a recurring schedule. You'll also learn how to configure retention settings to manage how longpg_dump
backups are stored before being deleted.
Backup & Restore Questions?
If you have questions about backups, please reach out to Neon Support.