DigitalOcean offers two backups option, Backups vs. Snapshots. To enable automatically backups of a Droplet, do following these steps in this article.
1. Enable Automatically Backups
If you ensure your droplet system is currently running good, you can create for it a backup for the next restore. No one can guarantee that the system is always running well. Creating a backup system at the time it is well done is always a wise choice. Enabling the automatically backup feature is very simple and easy. You can be enabled or disabled it at anytime you want on DigitalOcean Control Panel. The backups are run automatically weekly.
Step 1: Go to DigitalOcean Control Panel.
Step 2: Click on the Backups link on the sidebar of the Droplet page.
Step 3: Click the blue Enable Backups button.
Beside, you can active this feature during create a new droplet by selected onto Enable Backups at the Available Settings.
2. Using the Snapshot feature
This feature cannot automatically running, you must manually doing this whenever you needs. DigitalOcean encourages powering off your droplet before making a backup using SnapShot. You can do this by the “Power Cycle” options within the control panel, but for safely and fastly, you typing the command “sudo poweroff” into the terminal when you are connected to the droplet.
Step 1: Connecting to your droplet, enter the command “sudo poweroff“.
Step 2: Logging to DigitalOcean Control Panel, choice the droplet you want to make a SnapShot in the main “Droplets” page:
(When the snapshot process is complete, your server will be rebooted)
How To Automatically Backup MySQL Databases
There are many ways to help you backup your database on DigitalOcean. In this article I will guide you through the “automysqlbackup” program on Ubuntu to do that.
Step 1: Type “sudo apt-get install automysqlbackup” to install this program.
Step 2: Configure AutoMySQLBackup
The main configuration file for automysqlbackup is located at “/etc/default/automysqlbackup/automysqlbackup.conf“. You will need to open this file and edit as per your requirements:
Then save and close it.
Step 3: Finally, type “sudo automysqlbackup” to run this program.
Step 4: Create a daily cron job for it by enter the command: “sudo ln -s /usr/local/bin/automysqlbackup /etc/cron.daily/”
The default location for backups is “/var/lib/automysqlbackup“. There are three child-folders inside it, daily | monthly | weekly, stored all backup files at the corresponding time interval.
Hopefully this guide will help you protect your site, no one knows what will happen in the future so we always have a backup plan for ourselves. Wish you success and do not forget to visit our digitalocean promo code page to get the most attractive promotions from DigitalOcean. Nice a day 🙂