Data loss and how to avoid it
A typical situation: You have been on vacation and have made a lot of great photos which you want to upload to your server in order to share them with your friends and your family. Especially the photo where you were diving with the great white shark. So you uploaded them to your server and after that the photos were deleted from the SD card because you need free space for the next travel. Just working on an update to your website in a hurry, a quick "rm -rf" in the wrong directory and the photo gallery is gone. Annoying!
This is a situation that can occur but the data does not have to be lost. In general, the customer is responsible for a backup and we want to show you how to approach the perfect backup system.
But what is a backup?
With a backup you are creating a copy of your data to be stored on an external storage device. This storage device should be independent of your server, so it could be a hard disk on your local computer, a USB stick or our FTP backup storage.
Different backup types
- Full Backup: As the name already indicates the full backup is a complete copy of your data. The advantage here is that all data is complete, but you need a lot of disk space to store your data. If you only perform full backups the available space at your data storage medium will shrink very fast.
- Differential Backup: Before performing a differential backup you need a full backup as a differential backup contains only data which has changed or is newly created in comparison to the full backup. Therefore, it is faster but you are also saving data which is already saved in previous differential backups because you save all data that differs from the last full backup.
- Incremental Backup: Similar to the differential backup you have to perform a full backup. But instead of always saving all changes that differ from the latest full backup, only the data being changed after the previous incremental backup gets backed up. The only disadvantage is, that if you want to restore that data you need the last full backup and all incremental backups in order to restore to the latest data.
Where to save the backup files
We offer an FTP backup storage, available with various storage space options. If you are interested in this offer, please contact us: [email protected]
You can access the backup storage via FTP and FTPS. With support for these protocols it is perfect for file storage. The way to access our backup space is already described here: https://contabo.com/?show=tutorials&tutorial=backup-space.
"I do not need a backup, my server is secured by a RAID system."
CAUTION! A RAID does not replace the creation of backups! A RAID should indeed provide redundancy. If more than one drive fails at the same time or your data is deleted because of an attack from outside or a similar event, a RAID will not help saving the situation. We have read this sentence above numerous times and with our experience we can say, that customers who think that their data is secure because they have a RAID system are very disappointed, if a situation as described occurs. A RAID is very effective to avoid downtime because of a defective HDD and to prevent the need for laborious data restoration.
Nevertheless the mentioned redundancy is not the same as a backup.
"I have an SSD VPS. Because of the snapshot feature I do not have to worry about backups."
Since we have been offering our VPS SSD products with the snapshot feature we have heard this sentence very often. But it is the same as with a RAID. Snapshots are not backups!
What are snapshots good for?
A snapshot freezes the current state of the file system which still points to the same "physical" storage. Snapshots are perfect for "Let's do it and see what happens..." type of situations. If the change does not work you can go back to the state before you have started your work.
So is it a backup? No! Snapshots depend on the VPS and on the host server system the VPS is located on. As already described before, the backup has to be saved to an external location, e.g. our FTP backup storage.
How to create a backup?
All important data has to be saved. Normally you know where this data is located. To store all necessary data an automatic backup routine is the perfect choice.
Using a Linux based OS we recommend to create script which creates a tar.gz file of the data that should be saved and after that, automatically transfers it to the backup storage and also deletes older backups. As this should be done periodically you can use a cron job. If you use a Windows OS you can create a powershell script to do the same steps likewise.
Please note that it does not matter if you use Linux or Windows. You have to know what you are doing as the backup is the only way to restore your data if you are facing an issue with your server.
Of course we always try to support you if you have any questions regarding your backup solution: [email protected]
The last step: Securing your backup
Security of private data gets more and more important. Encryption of the backup files is therefore recommended.
Using a Linux OS you can use tools like gpg to do so. Please find a very good tutorial below:
If you are a windows user we recommend using Veracrypt: