Skip to content

Neon PostgreSQL

How to backup Managed Neon Postgres databases via SimpleBackups

Create a Neon Database backup (Manual)

To create backups for a Neon-managed PostgreSQL database using SimpleBackups, follow these steps. The process is designed to be straightforward, ensuring that your Neon database is securely backed up.

Prerequisites

  • A SimpleBackups account.
  • Access to your Neon database and permission to create new users/roles.
  • Network access from SimpleBackups to your Neon database.

Step 1: Create a Backup User in Neon

  1. Log in to your Neon dashboard.
  2. Navigate to the database you wish to back up.
  3. Click on “Overview” then “Connect” or just on the Dashboard, refer to “Connection Details”
  4. Create a new user (or role) with RW or read-only access to the necessary database. This user will be used by SimpleBackups to connect to your database securely.
  5. Copy the connection string (make sure you replace the **** by the actual password)

Neon PostgreSQL screenshot 1

Step 2: Whitelist SimpleBackups IP Addresses

  1. In the Neon dashboard, go to the "Project settings" then "IP Allow"
  2. Add the IP addresses provided by SimpleBackups to the whitelist. This allows SimpleBackups to connect to your database.

Neon PostgreSQL screenshot 2

Step 3: Create a New Database Backup on SimpleBackups

  1. Navigate to the "Backups" section and click on "Create Backup."
  2. Select "Database Backup."
  3. You may use your own server to dump the backups, but we recommend the “serverless” option.

Step 4: Configure Database Backup Settings

  1. Manual form fill:
  • Choose PostgreSQL as the database type.
  • Click “Paste connection string instead”
  • Fill in the complete connection string for your Neon database (make sure the password is added as well and not the asterisks *****)
  • Click “Validate Connection”

Neon PostgreSQL screenshot 3

Step 5: Schedule and Customize Your Backup

  1. Set a schedule for your backups according to your needs (e.g., daily, weekly).
  2. Customize your backup settings, such as retention policies and storage.

Step 6: Save and Activate the Backup

  1. Review your backup configuration to ensure all details are correct.
  2. Save your backup configuration. SimpleBackups will automatically start the backup process according to your schedule.

By following these steps, you can ensure that your Neon-managed PostgreSQL database is securely backed up, protecting your data against accidental loss or corruption.

Create a Neon database backup (Automatic)

In this step, we will generate a unique API Token on Neon that will allow us to automate Neon database backups from SimpleBackups dashboard.

Step 1: Obtain Neon API credentials

  1. Go to https://console.neon.tech/app/settings/api-keys.
  2. Click “Create new API key”.
  3. Copy the generated Key to somewhere safe.

Neon PostgreSQL screenshot 4

Step 2: Get the Project ID & Whitelist SimpleBackups IPs

  1. From the menu click on “Projects”.
  2. Choose the project where the database exists.
  3. From the menu click on “Settings”.

Neon PostgreSQL screenshot 5

Neon PostgreSQL screenshot 6

Neon PostgreSQL screenshot 7

Step 3: Create Neon Provider on SimpleBackups

  • Afterwards, create a new provider on SimpleBackups with your Neon API Key by going to the database backup page and click add on the “Connect your DBaaS Provider” section as shown.
  • Select Neon from the Provider dropdown list, enter a name for your Neon account, then paste the Token and the Project ID we obtained in the previous step and click save provider.

Neon PostgreSQL screenshot 8

Neon PostgreSQL screenshot 9

  • Select your provider, then the database you want to back up
  • Click on “Validate”.

Neon PostgreSQL screenshot 10

Step 4: Schedule and Customize Your Backup

  • Set a schedule for your backups according to your needs (e.g., daily, weekly).
  • Customize your backup settings, such as retention policies and storage.

Step 5: Save and Activate the Backup

  • Review your backup configuration to ensure all details are correct.
  • Save your backup configuration. SimpleBackups will automatically start the backup process according to your schedule.

Restoring backups

In order to restore your backup, Go to your backup page, then navigate into logs.

Neon PostgreSQL screenshot 11

Click on the “i” button on the backup that’s on the point of time you’d like to restore to.

Neon PostgreSQL screenshot 12

Click on the Restore tab, then generate a new download link, and copy it.

Neon PostgreSQL screenshot 13

Run these commands (for PostgreSQL):

bash
wget -O - "PasteTheSignedDownloadLinkHereBetweenTheQuotes" | gunzip -c > decrypted-backup.pgsql

Then, run the pg_restore command to restore your database like so:

bash
pg_restore -d "your_db_uri" ./decrypted-backup.pgsql

Neon PostgreSQL Database backup

SimpleBackups supports Neon PostgreSQL Database backup.