Neon PostgreSQL
How to backup Managed Neon Postgres databases via SimpleBackups
Creating backups
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
- Log in to your Neon dashboard.
- Navigate to the database you wish to back up.
- Click on “Overview” then “Connect” or just on the Dashboard, refer to “Connection Details”
- 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.
- Copy the connection string (make sure you replace the **** by the actual password)
Step 2: Whitelist SimpleBackups IP Addresses
Note: if your database is behind a firewall, follow the following steps.
- In the Neon dashboard, go to the "Project settings" then "IP Allow"
- Add the IP addresses provided by SimpleBackups to the whitelist. This allows SimpleBackups to connect to your database.
Step 3: Create a New Database Backup on SimpleBackups
- Navigate to the "Backups" section and click on "Create Backup."
- Select "Database Backup."
- You may use your own server to dump the backups, but we recommend the “serverless” option.
Step 4: Configure Database Backup Settings
- 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”
- Auto form fill:
- Click on “Connect your DBaaS Provider”.
- Choose a Neon provider.
- Select a managed database.
- Click on “Validate”.
Step 5: 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 6: 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.
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.
Restoring backups
In order to restore your backup, Go to your backup page, then navigate into logs.
Click on the “i” button on the backup that’s on the point of time you’d like to restore to.
Click on the Restore tab, then generate a new download link, and copy it.
Run these commands (for PostgreSQL):
wget -O - "PasteTheSignedDownloadLinkHereBetweenTheQuotes" | gunzip -c > decrypted-backup.pgsql
Then, run the pg_restore
command to restore your database like so:
pg_restore -d "your_db_uri" ./decrypted-backup.pgsql
pg_restore
updated to the latest version to avoid facing restore issues. Neon PostgreSQL Database backup
SimpleBackups supports Neon PostgreSQL Database backup.
Last updated on June 18, 2024