I don’t need to download current database I need a backup from a day or two ago. Also I certainly don’t need to restore current database from a backup. So, is there a way I could download just the backup?

edited by bobbyiliev

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hello, vladch

I don’t think there is a way to download a backup from the control panel. What you can do is manually backup the database once a day via script and transfer it on a remote server.

Backups are handled automatically and included to you at no additional fee. Full backups are taken every day and write-ahead-logs are maintained to allow you to restore to any point-in-time during the retention period.

You can check our official Docs for the Managed PosfreSQL Database here:

https://www.digitalocean.com/docs/databases/postgresql/how-to/

And check the tutorial on how to restore a PostgreSQL cluster from Backups:

https://www.digitalocean.com/docs/databases/postgresql/how-to/restore-from-backups/

A command similar to the following should allow you to dump all the data from your remote PostgreSQL database to a single dump file:

  • pg_dump -h use_your_host -U use_your_username -Fc use_your_dbname > dbdump.pgsql

You can restore a dump file to the default database and user by running a command similar to this:

  • pg_restore -d 'use_your_connnectionURI' --jobs 4 use_your_dump_file

We cover both importing and exporting databases more detail in our product documentation for our managed databases (PostgreSQL):

https://www.digitalocean.com/docs/databases/how-to/postgresql/import-databases/

Regards,
Alex