I am using the Droplet Backup service for $0.14 dollars a month. I am fairly new in the development field and am not sure what to expect from this backup. The reason why I am asking this is that I want to be sure that my architecture as well as the content of that architecture can be easily restored if something goes wrong.

In the description I can read, that a system-level backup is made. This is my current architecture:

  • Ubuntu 20.04
  • LAMP stack
  • Wordpress
  • phpmyadmin
  • Neo4j

These are my hypotheses:

  1. With the DO Droplet Backup service I can restore the OS and application configuration on my VPS. This means that if the server crashes, I don’t have to go to the trouble of making all the basic configurations myself.
  2. For the content-related backup, such as the Wordpress configurations, and the MYSQL database, I need to find other ways of making backups.

Can anyone help me confirm or nuance my hypotheses? If I am correct, any advice on how I can backup Wordpress, MySQL and Neo4j databases safe, fast and reliable, is very much appreciated :).

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.

×
2 answers

Hi there @katovonkatz,

With the backups from DigitalOcean, your whole server gets backed up, meaning that you can restore your whole server including all of the server configuration and also website files and databases back to a certain point of time.

The backups are similar to the snapshots but one of the main differences is that backups happen automatically and you don’t have to power off your Droplet.

You can test the above statement by creating a new Droplet based on a specific backup. To do that go to your DigitalOcean Control panel -> Hit the ‘Create Droplet’ button and then when choosing an image click on the 'Backups’ tab:

DigitalOcean backups

Then finish the Droplet configuration as normal. After that, you can access your new server which will be an exact copy of your existing server.

And yes, you are correct that using the DigitalOcean backups all of the services running on your Droplet will be safely backed up.

Hope that this helps!
Regards,
Bobby

  • Thank you. So, as I understand correctly, I don’t have to create separate backups for Wordpress and my databases, because with this functionality, everything is done automatically.

    The biggest disadvantage of relying solely on this method, is when there is a problem with my Droplet or DigitalOcean and I have no other backup, everything will be lost?

    I read this other question here: https://www.digitalocean.com/community/questions/how-to-backup-droplet-whole-server-to-my-own-storage. Can I assume that if I rsync my Droplet occasionally, my configurations and data are rather safe?

    • Hey @katovonkatz,

      Yes indeed, that is a good point.

      I do a similar thing myself actually. I have a file server where I store my backups. Here is the script that I use to manually backup my files and database:

      #!/bin/bash
      # Your Database login details
      # Please update those accordingly
      
      dbHost="localhost"
      dbName="my_db_name"
      dbUser="my_db_user"
      dbPass="my_db_pass"
      
      #How many days the backups should be kept for before being removed
      keepBackupsFor="2"
      
      if [ ! -d ${HOME}/backups/file_backups ]; then mkdir -p ${HOME}/backups/file_backups ; fi
      if [ ! -d ${HOME}/backups/manual_backups ]; then mkdir -p ${HOME}/backups/manual_backups ; fi
      
      curTime=$(date +"%m-%d-%y_%H:%M")
      
      # Zip the website files
      tar -zcvf ${HOME}/backups/file_backups/${curTime}-my_site.tar.gz /var/www/html
      wait
      # Backup the database
      mysqldump --single-transaction --skip-lock-tables -h ${dbHost} -u ${dbUser} -p${dbPass} ${dbName} | gzip -c > ${HOME}/backups/manual_backups/${curTime}-my_site_db.sql.gz
      
      # Secure the backups
      chmod 600 ${HOME}/backups/file_backups/*
      chmod 600 ${HOME}/backups/manual_backups/*
      
      # Sync the file backups
      rsync -avz -e 'ssh' --ignore-existing ${HOME}/backups/file_backups/* sammy@my_backup_server_ip:~/file_backups/
      # Sync the SQL backups
      rsync -avz -e 'ssh' --ignore-existing ${HOME}/backups/manual_backups/* sammy@my_backup_server_ip:~/mysql_backups/
      
      # Clear old backups
      find ${HOME}/backups/file_backups/ -type f -mtime +${keepBackupsFor} -exec rm -f {} \;
      wait
      find ${HOME}/backups/manual_backups/ -type f -mtime +${keepBackupsFor} -exec rm -f {} \;
      
      #END
      

      I set this to run as a cron job every day at midnight. It backs archives my files and database. Then using rsync the files are copied to my file server.

      On my file server, I have another cron job which deletes the files older than x number of days:

      #!/bin/bash
      
      keepBackupsFor=10
      
      find ${HOME}/mysql_backups -type f -ctime +${keepBackupsFor} -exec rm -f {} \;
      find {HOME}/file_backups -type f -ctime +${keepBackupsFor} -exec rm -f {} \;
      
      echo 'Done'
      

      Another thing that you could do is add block storage to your existing server and copy your manual backups there instead.

      Hope that this helps!
      Regards,
      Bobby

Hello,

Backups are always associated with the Droplet, the moment you destroy the Droplet, backups will also be removed and purged. Snapshots work opposite, they will still be on your account even after the Droplet is removed.

As long as you have the Droplet active, you can always restore or create a new Droplet using that Backup image.

Enabling backups for a Droplet adds 20% to the cost of the Droplet.

In more detail, each successful backup is charged at 5% of the Droplet’s total cost that month. This means you may be charged less than 20% in rare cases, like when you destroy a Droplet that is less than a month old, but you will never be charged more than 20%.

Refer to below links:

https://www.digitalocean.com/docs/images/backups/
https://www.digitalocean.com/docs/images/backups/how-to/

https://www.digitalocean.com/docs/images/snapshots/
https://www.digitalocean.com/docs/images/snapshots/how-to/

Hope this helps!

Regards,
Sri Charan

Submit an Answer