Report this

What is the reason for this report?

Backup my applications MySQL databases and copy to DropBox or similar

Posted on August 8, 2019

Hi All,

I have an online mysql based application hosted in a droplet. I use a script to automatically backup my dB’s to my DO server every 6 hours. Is there a better/safer way to do these backups and how can I copy my backups to my DropBox account, or similar?

Regards

Gary



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.

Hi Kalin,

Genius!!

My problem solved. I’m going to try it now.

Many Thanks

Gary

Hi garywilliams,

It’s generally not a great idea to store your backups the same place your files are. If there is data loss, you’ll lose both the backups and the files. Backups should be stored remotely so in that regards, using Dropbox is a good solution.

Using Dropbox to backup your date

Download Dropbox to the server

64-bit: cd ~ && wget -O – “https://www.dropbox.com/download?plat=lnx.x86_64” | tar xzf –

Run the dropbox daemon

~/.dropbox-dist/dropboxd

Running it for the first time, running the daemon will say something like

This computer isn't linked to any Dropbox account...
Please visit https://www.dropbox.com/cli_link_nonce?nonce=6bc8fb27643bc6c1d91264afe135f2ba to link this device.

Visit the link from your browser and link your server with your dropbox account. Once you do, your Dropbox folder will be created in your home directory.

~/Dropbox

Now you have Dropbox configured on the server. To actually backup your databases to Dropbox, change your script to dump the .sql file in your ~/Dropbox folder. From there, your files will be automatically synced with your account.

You can set a cron job to do that for you as well.

That’s it!

Kind regards, Kalin D.

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.