What Is the 3-2-1 Backup Rule? How to Protect Your Data
A disk failure, an accidentally deleted folder or a ransomware attack can wipe out years of data in minutes. The most widely recommended and easiest method to guard against these situations is the 3-2-1 backup rule.
In this guide, we explain what the 3-2-1 rule means, why it works, how to apply it to servers and websites, the increasingly popular 3-2-1-1-0 approach, and the most common backup mistakes.
The 3-2-1 backup rule says you should keep at least 3 copies of your data, store them on 2 different types of storage, and keep 1 of them in a different physical location (another data center, cloud storage, etc.). That way, a single disk failure, a single server problem or a disaster at a single location can't cost you all of your data.
- 01 What Is the 3-2-1 Backup Rule?
- 02 Why Does It Work?
- 03 Example Scenario for a Server and Website
- 04 3-2-1-1-0: The Modern Approach in the Age of Ransomware
- 05 Full, Incremental and Differential Backups
- 06 Remote Backup Example on a Linux Server
- 07 Common Backup Mistakes
- 08 Frequently Asked Questions
- 09 Conclusion
What Is the 3-2-1 Backup Rule?
The rule was popularized by photographer Peter Krogh as a method for digital archives, and today it has become a basic standard for server, website and business data backup. The three numbers address three separate risks:
At least three copies of your data
Your working (live) data plus at least two backups. Relying on a single backup leaves you unprotected if that backup turns out to be corrupt or incomplete.
Two different types of storage
Don't keep copies of the same type on the same device. For example, use different media such as the server's own disk plus a separate backup server, a NAS device, an external drive or object storage.
One copy in a different location
At least one backup should be physically away from the building or data center where the live data is kept. This is the only way to survive location-based disasters such as fire, flooding, power problems or theft.
Why Does It Work?
The strength of the 3-2-1 rule comes from minimizing the chance that copies are lost at the same time for the same reason. The table below shows which copy saves you in different scenarios:
| Scenario | Affected | The copy that saves you |
|---|---|---|
| Disk failure | Live data | A different disk on the same server or a local backup |
| Accidental deletion / faulty update | Live data | An older local backup |
| Complete server failure | Live data and backups on the same server | A backup on a separate device or at a remote location |
| Ransomware | All accessible copies | An offline or immutable remote backup |
| Data center disaster | Everything at the same location | A backup at a different location |
Setups such as RAID 1 or RAID 10 keep the service running when a disk fails; however, a deleted file or encrypted data is mirrored to all disks at once. Use RAID for availability and backups for recovery.
Example Scenario for a Server and Website
Let's say you run an e-commerce site on a VDS server. You could apply the 3-2-1 rule like this:
- Copy 1 β Live data: The web files and database on the server.
- Copy 2 β Local backup: A nightly database dump and file archive, kept for 7 days in a separate directory or on an additional disk on the server. Ideal for quick recovery.
- Copy 3 β Remote backup: The same backups are encrypted and sent to a backup server in a different data center or to S3-compatible object storage, and kept for 30 days.
In this setup, the live data and the local backup are on the same server, so if the server is lost completely, the remote backup comes into play. If you keep business data on a physical server in your office, we covered the advantages of moving a copy of that server to a data center in our article physical servers: in the office or in a data center.
Automatic backups taken by your hosting provider are a valuable layer of protection, but on their own they don't satisfy 3-2-1, because they are usually stored on the same provider's infrastructure. If you use cPanel, regularly taking a full backup from the Backup section and downloading it to your own computer or cloud storage is a good start. For help using the panel, see our cPanel beginner's guide.
3-2-1-1-0: The Modern Approach in the Age of Ransomware
Ransomware no longer encrypts only live data; it also encrypts or deletes any backups it can reach over the network. That's why the 3-2-1 rule has been extended with two additional items:
- +1 offline or immutable copy: At least one backup should either be physically disconnected from the network (air-gapped) or stored so that it cannot be deleted or modified for a set period (immutable, object lock).
- 0 errors: Backups should be regularly put through restore tests to make sure there are no verification errors. A backup that can't be restored is the same as a backup that was never taken.
Connect from the live server to the server that receives the backups using a separate user that only has write (append-only) permissions. That way, even if the live server is compromised, the attacker can't delete older backups. Also, don't store backup credentials in plain text on the live server.
Full, Incremental and Differential Backups
The 3-2-1 rule answers the questions of where and how many copies; how the backup is taken depends on the backup type:
| Type | What is backed up? | Advantage | Disadvantage |
|---|---|---|---|
| Full | All data | The simplest and fastest method to restore | Requires the most space and time |
| Incremental | Changes since the last backup | Fast and takes up little space | Restoring requires the entire chain |
| Differential | Changes since the last full backup | Restoring only needs the full backup + the latest differential | Grows in size over time |
A common strategy is to take a full backup once a week and incremental backups on the other days. Modern tools such as restic and BorgBackup deduplicate data, sending only the changed blocks while keeping every backup restorable like a full backup.
Remote Backup Example on a Linux Server
The example below shows a simple setup that backs up a MySQL / MariaDB database and the web directory every night and sends them to a remote backup server over SSH. The commands work on Ubuntu and Debian-based systems; for the server's initial security settings, see our article the first 10 things to configure on a new Ubuntu VDS.
#!/bin/bash
set -e
TARIH=$(date +%F)
HEDEF=/yedek/$TARIH
mkdir -p "$HEDEF"
# 1) Database dump
mysqldump --single-transaction --all-databases | gzip > "$HEDEF/db.sql.gz"
# 2) Web files
tar -czf "$HEDEF/www.tar.gz" /var/www
# 3) Send to the remote server (different location)
rsync -az "$HEDEF" [email protected]:/arsiv/
# 4) Delete local backups older than 7 days
find /yedek -mindepth 1 -maxdepth 1 -type d -mtime +7 -exec rm -rf {} +
0 3 * * * /root/yedek.sh >> /var/log/yedek.log 2>&1
In this setup, local backups are kept for 7 days for quick recovery, while the retention period on the remote server is set separately. For sensitive data, encrypt the backups before sending them, or use a tool such as restic that handles encryption on its own.
Common Backup Mistakes
- β Keeping the backup on the same server: When the server is lost, the backup is lost with it.
- β Not running restore tests: At least once a month, restore a backup to a separate environment and confirm the site loads.
- β Forgetting the database: Backing up only the files means losing content and orders on dynamic sites.
- β Copying the files of a running database: For a consistent backup, use
mysqldump --single-transactionor the database's own backup tool. - β Not noticing failed backups: Report the result of your backup script by email or through a monitoring tool; a cron job that silently stops can go unnoticed for months.
- β Keeping the retention period too short: If a problem is only noticed days later, all of your backups may already contain the corrupted data.
Frequently Asked Questions
Do small businesses need the 3-2-1 rule too?
Yes. For small businesses, data loss is often even more devastating. The rule doesn't require expensive infrastructure; a local backup on the server, an external drive and a cloud storage account are enough to satisfy 3-2-1.
Is cloud storage enough on its own?
No. Cloud storage is a good remote copy, but when used as the only copy it is exposed to risks such as losing account access, incorrect synchronization or deletions. Sync services can delete a removed file from the backups too.
How often should I back up?
Decide based on how much data you can afford to lose. An e-commerce site that takes many orders a day may need hourly database backups, while a daily backup is enough for a corporate site that is rarely updated.
How long should I keep backups?
A common starting point is 7 daily, 4 weekly and a few monthly backups. For data subject to legal retention requirements, check the relevant regulations separately.
Is a snapshot the same as a backup?
Not exactly. A snapshot is a copy of the server's disk at a specific moment and is very handy for quick recovery; however, it is usually stored on the same infrastructure. For 3-2-1, use snapshots together with independent backups in a different location.
Conclusion
The 3-2-1 backup rule β three copies, two different types of storage and one remote copy β frees your data from depending on a single point of failure. Add an offline or immutable copy and regular restore tests, and you get strong protection against the most common data loss scenarios, including ransomware. The best backup plan is the one you start today and test regularly.
Netiyo VDS and dedicated servers run on Turkey-based infrastructure with full root / administrator access. You can set up your own backup routine with restic, BorgBackup or rsync and use a separate server as the backup target. For your physical hardware, you can also explore our server colocation options.
Explore VDS Server Plans