Report this

What is the reason for this report?

How should I backup a managed database on Digitalocean?

Posted on February 3, 2023
amir

By amir

I need to create a backup from my managed DB , is there any way to do this? actually I wanted to add a secondary to this managed DB but I couldn’t find anything in Documentations. Now I want to create a Full or differential backup from it to other location.



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!

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.

Hey @amirdolphin,

I would recommend you to check the following article:

https://www.digitalocean.com/blog/just-how-managed-are-digitaloceans-managed-databases

and most importantly this section here:

Managed Databases: As the name implies, DigitalOcean manages these databases for you. We handle common database administration tasks such as setup, backups, and updates so you can focus more on your app and less on the database. We currently support three engines: [MySQL](https://www.digitalocean.com/products/managed-databases-mysql/), [PostgreSQL,](https://www.digitalocean.com/products/managed-databases-postgresql/) and [Redis](https://www.digitalocean.com/products/managed-databases-redis).

This means backups are being done automatically by DigitalOcean for your Managed Database product.

If you want to create a backup on your own though, you only need to create a database dump once in a while and store that backup somewhere. You can check the following article on the topic:

https://www.digitalocean.com/community/questions/how-to-download-a-database-from-managed-database-cluster

Hello @amirdolphin

You can use tools like mysqldump to backup the database manually as well. You can check the answer from Bobby here:

https://www.digitalocean.com/community/questions/how-to-get-long-term-backups-for-digitalocean-s-managed-databases-mysql

What I usually do is use a MySQL backup tool like mysqldump for example. It allows you to export your databases without SSH access.

To export a backup you could run the following command:

mysqldump -h your_database_hostname -u your_username -p your_database_name > your_database_name-$(date +%F).sql

You could also take a look at this tutorial here for more information.

Hope that this helps.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.