Prepared for a data lose? Get started creating your own effective backup strategy, with these tips and best practices
Many words were spoken about the importance of taking regular backups of any important data. However, as we know, few website owners actually manage to implement this process in a proper way, due to many obstacles, in a same time, technologies are evolving very fast, practice that was common few years ago now is considered outdated and not effective.
Creating a good backup strategy is investment of time and money, but the cost is far less than then task of recreating data for which no backup exists.
Chance that something might go wrong or fail in software, hardware is always need to be considered. Those errors/crashes are happening all time, because of many reasons, it can be:
- software updates
- mistakes in software code
- wrong configuration
- human error
- electrical power surge.
This list can go on and on, even including natural cataclysms, war, governments meltdown that directly affecting network providers, data centers. For web oriented businesses this will turn around in big loses, fallback to 5, 10, 30 days back to old backups (if they were made) with loosing valuable information or even to bankruptcy.
All that makes regular backups an important step in ensuring your success. A consistent backup schedule ensures that in any time, your data remains protected, safe, and ready to restore with minimum or no data loss. Creating and storing website backups is not just an element of website best practices, it is the most important step to ensure website stability.
For Drupal 8 sites same rules must be applied. Apart from avoiding losing your data, making backups can also be very useful if you are trying new features or improvements on your site.
Keeping that in mind let's see what backup strategies for Drupal 8 site we have.
What should be added to a Backup
Before, it's good practice to overview your Drupal 8 installation, file structure, get familiar with technologies in use. If you haven’t already done so, invest some time to this task, it's important. You'll need to explore areas that will be sources for a backup.
- File storage (Public files, Private files)
- Databases (Mysql, Mongo, ...)
- Imported External Libraries (Themes)
- External object storage (Amazon S3, Digital Ocean Spaces, ...)
- External database files (GeoIP database)
Once you have a list of everything you want to backup, and know where it is, ensure you have enough disk space to support needed amount of backups and some disk space for execution of a backup process.
Determine Backup schedule
Example: every 1, 3, 6 hours, daily, every 3 days, weekly, monthly, on content change.
Next, determine how often you want to have a backup for each data type, as files or databases. For example, if you have busy Drupal website with big number of content created or changed in a day then you will most likely want frequent backups. But for other cases standard frequently once or twice a month will be enough.
The frequency with which you backup your Drupal site should be aligned with a maximum allowable period between the time of data loss and the last useful backup of a known good state. Thus, the more often your data is backed up, the more likely you are mitigate an emergency state.
Obviously, this completely depends upon your own needs.
Also in some cases, it's possible to configure automatic backup on information change only, this is good practice on simple sites like landing pages.
Where to store
- Same Server
Storing backup on same server it's an easy way. But most fragile in case of bad scenario all data will be loosed you Drupal site and all backups.
(Common dangers: hack, data corruption, virus, server error, human errors)
When used remote backup storage, system automatically or manually sends your data to a remote data-center at specified intervals (Dedicated server, Object storage, Database, Magnet storage, etc. The main downside of remote backup solutions is that full reliable and fast access is required to fully restore your backed-up data.
Another potential downside is that you have to entrust critical data to a third party. So make sure you choose a provider that is reliable, stable, and secure.
Also backups can be encrypted. This will increase data security.
On-Premises, Local Storage
In an on-premises/local setup, drupal backup data can be copied to a hard drive storage, shared drive, specially dedicated server. Using this method, all the data is within your reach — and therein lies both its value and its risk. You can always access your information when necessary, but that information is vulnerable to loss, whether through theft (someone breaking in and stealing equipment) or damage.
The "3-2-1 Backup Rule" for Drupal 8
The 3-2-1 backup rule is an easy-to-remember acronym for a common approach to manage your backups. The rule is: keep at least three (3) copies of your data, store two (2) backup copies on different storage media, with one (1) of them located offsite.
Main idea of this rule is to spread your backups to a different location, devices and storage media to increase percent of availableness of your data in any case of emergency. Thus, the 3-2-1 backup rule states that you need at least three copies of your data, meaning the primary data and two backups of this data. Remember that any storage device can fail sooner or later due to hard drive fails for example.
An important step is to have at least one copy of your data in a remote location, such as offsite storage or the cloud.
Test and Monitor your backup system
When backup system is up and working, test and monitor feature is needed, for both, to check that the backup is successful and ready for restore. It can be a dedicated GUI with records of date, time when latest copy of a backup was created, state of it, with any additional records. In simple case log file will be enough to track backups.
Understanding Types of Backup
Most of backup solutions you can choose to do a full backup or just parts of your data (differential backup).
- A full backup is the method when you are copy all available date including database and files, it is usually takes decent amount of time on big sites and create CPU load.
- A differential backup is used to copy recently changed subset of your data, new files, database changes. This option is used in additional to full backup.
Backup Examples & Guides
Check, this list of backup examples for Drupal 8 website they will cover the full backup process. There are 2 main ways of creating a backup of Drupal 8 websites GUI and CLI based, one involves the use of a Command Line Interface, while the other one can be achieved through Drupal’s own GUI.
A) Full site Drupal 8 backup using command line
B) Partial manual backup via Backup and Migrate Modules (will be published soon)
C) Manual Backup (will be published soon)
D) Backup with PHP task runners (will be published soon)
Short list of best practices
All backup routines must balance expense and effort against risk. Few backup methods are 100-percent airtight — and those that are may be more trouble to implement than they're worth. That said, here are some rules of thumb to guide you in developing a solid backup strategy:
Plan your backup.
Write down answers for this list: What to back up?, How?, How often?, Who's responsible?, Who's monitoring?
- Give highest priority to crucial data.
Core information should be backed up at least once a week, more frequent is better.
Store at least one backup local.
Storing and protecting your backups.
If possible store your offline backups in secure location, such as a safe deposit box.
Be sure have will access stored backups.
Backups are useless if you have loose access to the storage
Test your backups before restore.
Make sure when restoring data from old backup that system is compatible, all required software is installed and technical requirements are met.
It's good to create new development environments from a backup - testing the backup.
Always back up the entire site before Drupal update or upgrade.
Date your backups. Name it with good description and provide readme.txt file if needed, avoid name like "Backup1.zip, Backup2.zip".
Save a copy of each backup in a different location.
Check your ISP or web host's backup policies. Most good companies has one, but you need to check if it is suits you, frequency, space, cost.
Don't rely on one backup storage.
- Restore your backups using the same method as you took the backup.
Rely on same software that was on time when the backup was taken.
It's all! Now you have a good knowledge and some ideas about strategy to create periodic backups of your Drupal site in order to be prepared for any emergency situation. Protecting your data is pivot point on building solid basement for your projects.
Don’t know how to create site’s backup? Let us handle your backups. Quick installation & start & low cost.