Question

How to download database backup

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?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

This is a question we see time and time again with Managed databases and Droplet backups.

At the moment you can only restore to existing backups if you rely on DigitalOcean backups, If you want a downloadable backup you need to back up the database using mysqldump or PostgreSQL pdumps

With this you’re going to need a server or device that can connect to the managed database, if you’re using the app platform you will need to start a droplet or open connections to your local machine to backup, or make use of a 3rd party serverless backup system.

Simon Founder - SnapShooter Backups

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:

  1. 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:

  1. 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