DigitalOcean
Back up a DigitalOcean managed PostgreSQL database — send independent, restore-tested backups of your DigitalOcean Postgres to storage you control. Which connection string to use, Trusted Sources network access, and SSL.
To back up a DigitalOcean managed PostgreSQL database, Backup connects to its Postgres like any other Postgres. DigitalOcean runs real community Postgres under the hood. Three DigitalOcean specifics are worth knowing before you start: which connection details to use, DigitalOcean's Trusted Sources firewall, and its non-standard port.
Which connection string
Use the direct database connection, not a connection pool.
- DigitalOcean listens on a non-standard port. The direct database is on
25060; a connection pool, if you create one, is on25061. - DigitalOcean's connection pools run PgBouncer. A transaction-mode pool
breaks
pg_dump, so point Backup at the direct database on25060, not at a pooler endpoint. - The default database is
defaultdband the default admin user isdoadmin. You can back updefaultdbdirectly, or a database you created on the cluster.
Find the connection details
- In the DigitalOcean control panel, open Databases and select your cluster.
- On the Overview tab, find the Connection details panel.
- Keep the network selector on Public network (Backup connects over the public internet). Use VPC network only if you run Backup inside the same DigitalOcean VPC, which is not the case here.
- Leave the Database/Pool selector on your database (for example
defaultdb), not on a connection pool. - Switch the format dropdown to Connection string and copy the URI. It looks like:
postgresql://doadmin:<your-password>@<cluster>-do-user-000000-0.k.db.ondigitalocean.com:25060/defaultdb?sslmode=requireSet SSL mode to require and paste the host, port 25060, database, user,
and password into Backup's
credentials step.
DigitalOcean requires SSL. Its connection details already carry sslmode=require,
which encrypts the connection in transit. You don't need to download
DigitalOcean's CA certificate for Backup: sslmode=require works without it. The
cluster is reachable over IPv4. For least privilege, create a read-only role and
use its credentials instead of doadmin (which is not a superuser but has more
than a backup needs) — see
read-only role snippets.
Network access
DigitalOcean managed databases sit behind a Trusted Sources firewall. Once you add any trusted source, the cluster accepts connections only from the sources on that list, so Backup's egress IP has to be on it.
- In the control panel, open Databases and select your cluster.
- Open the Settings tab and find Trusted Sources (some editions label this the Network access section), then choose Edit / Add trusted sources.
- Add
18.196.207.101as an IP address and save.
Trusted sources can be IP addresses or CIDR ranges, Droplets, Kubernetes clusters, tags, or App Platform apps. Backup connects from a fixed IPv4 address, so add it as a plain IP address. See network access.
Restore tests
Every backup can be restore-tested: Backup restores it
into a throwaway vanilla Postgres engine and confirms your data comes back.
DigitalOcean ships no proprietary or platform-only extensions. Everything it
offers (pg_stat_statements, pgcrypto, pgvector, and the rest) is a standard
community or contrib extension, so there's nothing DigitalOcean-managed for a
restore test to flag, and tests run clean.
One caveat that isn't DigitalOcean-specific: if your database uses a heavy extension the default managed engine doesn't bundle, like PostGIS or TimescaleDB, point restore tests at a scratch target that already has it, rather than the managed engine. That's about the extension, not about DigitalOcean — see restore testing.
From there, it's the standard flow
Backup runs a full pg_dump on your schedule and
writes the encrypted archive to
storage you control. You can
download any backup and restore it with standard Postgres tools,
independent of Norcube, which is the point of an off-site copy. To wire it all
up, follow connect a database.
Aiven for PostgreSQL
Back up an Aiven for PostgreSQL database — send independent, restore-tested backups of your Aiven Postgres to storage you control. Which connection string to use, SSL, IP filtering, and Aiven's managed extensions.
Render Postgres
Back up a Render Postgres database — send independent, restore-tested backups of your Render Postgres to storage you control, over Render's external connection string.