My account Get a quote
Security

3-2-1 Backup Strategy: How to Never Lose Your Data

Learn what the 3-2-1 backup strategy is, how to apply it to your website, and how to confirm your backups actually work with a restore test.

· 6 min read
3-2-1 Backup Strategy: How to Never Lose Your Data

The 3-2-1 backup strategy is the principle of keeping at least three copies of your data, storing those copies on two different media, and keeping one copy physically in another location (offsite). It sounds simple, but it saves your work after a server failure, ransomware, accidental deletion or a fire. This guide explains each number in the rule, how to apply it to your website and business data, and the step that is most often skipped: the restore test.

What the 3-2-1 rule says

The rule consists of three numbers:

  • 3 copies: The live data and at least two backups of it. In total, three copies.
  • 2 different media: Do not keep the copies on the same type of storage. For example, one may be on the server disk and another on cloud storage or an external disk. The same type of media is affected by the same kind of failure.
  • 1 offsite location: At least one copy should be in a physical or logical location separate from your primary data, so that a fire, theft, a data center problem or an account takeover does not destroy all copies at once.

Many experts also recommend adding an “immutable” or access-restricted copy. Because ransomware may try to encrypt every backup it can reach, a backup that cannot be overwritten or that only allows appending is an important safeguard.

Why the backup should not stay on the same server

In many hosting panels, the backup is stored on the same server's disk. If the server disk fails, the account is closed, or an attacker takes over the account, the backups go away together with the live data. A backup on the server is only useful for small incidents such as “I deleted it by mistake.” For real protection, a copy outside is essential. You can find the difference between hosting options in terms of backups in our web hosting types guide.

What you should back up

For a website, the things to back up are usually these:

  • Files: Site code, theme, plugins, uploaded images and documents.
  • Database: Orders, users, content and settings are mostly stored here. In most sites, this is the most valuable part.
  • Configuration files: Environment settings, server configuration, scheduled tasks.
  • DNS and domain information: Keeping a record of your DNS entries saves time during a move or recovery.
  • Email: Business mailboxes are data too; learn your provider's backup policy.
  • Access information: Exports from your password manager and recovery codes should be kept in a secure, offline place.

Comparing backup methods

MethodAdvantagePoint to watch
Hosting panel backupEasy, often automaticUsually on the same server; not an offsite copy by itself
Cloud storageProvides an offsite copy, can be automatedProtect your access keys and calculate the additional cost
External disk / NASFast restore, full controlMust be connected and updated regularly; there is physical risk
Server snapshotBrings the whole server backUsually stays with the same provider; check database consistency
Immutable / versioned storageStrong against ransomwareSetup and retention settings require some technical knowledge

Backup frequency and retention period

The question that determines backup frequency is: how much data are you willing to lose in the worst case? For a corporate brochure site that changes a few times a month, a daily backup may be enough. For an e-commerce site that receives orders every day, the database may need to be backed up much more often, even several times a day. It is also possible to schedule files and the database at different frequencies: a database that changes often can be backed up often, while images that rarely change can be backed up less frequently.

Think in tiers for retention too: keep backups from recent days frequently and backups from older periods less often. A problem is often noticed only days later; if you only have yesterday's backup, that backup may already contain the problem. Keeping several restore points reduces this risk.

Step-by-step: building a backup plan

  1. Make an inventory of the data to back up: files, databases, email, configurations.
  2. Decide how much data loss is acceptable and how quickly you want to be back up and running.
  3. Choose three copies and two media: for example, a local backup on the server, a copy in the cloud, and an external disk kept in the office.
  4. Automate the backup; manual backups are forgotten.
  5. Make sure backups are encrypted and keep the access keys separate from the system being backed up.
  6. Set up an email or message alert for failed backups.
  7. Configure the retention period and the automatic deletion of old backups.
  8. Write the plan down: who backs up what, from where, and who restores it and how.

Restore test: the step most often skipped

An untested backup is nothing more than a hope. Having a backup taken does not mean it can be restored: the file may be corrupted, the database may turn out incomplete, or the password may not be found. For this reason, run a restore test regularly:

  • Restore the backup to a test environment separate from the live site.
  • Check that the site opens, that you can log in, and that product and order data is complete.
  • Measure how long the restore takes and compare it with the target in your plan.
  • Record the test result and any problems you encountered, and update the plan.

If you have never run a test, do one this week, then repeat it at regular intervals. For the rest of the security measures, see our website security essentials article.

Example for a small business

Let us make the rule concrete with a small business that uses a corporate website and business email:

  • Copy 1 (live data): The site files and database on the hosting server.
  • Copy 2 (second medium): A backup taken automatically every night and transferred in encrypted form to cloud storage outside the server.
  • Copy 3 (offsite, different medium): A backup downloaded weekly and stored on an external disk in the office or in a separate account.

This arrangement lets you recover from the cloud copy if the server fails, and from the external disk if the cloud account runs into trouble. Set the retention period in tiers as well: daily backups for the last few days, weekly backups for the last few weeks, and monthly backups for the last few months can be kept. Determine the figures according to your own data change rate and storage budget.

Extra care for e-commerce sites

On a site that takes orders, the database changes constantly. An order placed in the middle of the day will not be in a backup until the night backup is taken. On such a site, shortening the backup interval or using continuous (incremental) database backup reduces the possible data loss. After a restore, orders and payments made between the backup and the time of the failure may also need to be compared with the payment provider's records and any missing ones processed by hand; include a checking step for this in your recovery plan. For e-commerce setup details, you can review our own guides.

Backing up against ransomware

Ransomware encrypts the files in the storage it is connected to, making them unreachable. If your backups are constantly connected and writable, they can be encrypted too. To reduce this risk, pay attention to the following:

  • Make the backup account's password different from your other accounts and turn on two-step verification.
  • Access the backup system only through an account that performs backup work and has limited delete permissions.
  • Where possible, turn on version history or the immutability feature; this way you can return to an earlier version of a changed file.
  • Connect an external disk only during backup and disconnect it when the job is finished.
  • Treat unusual size changes in backups, such as a backup suddenly shrinking or growing, as a warning sign.

Backup security and documentation

Backups are a copy of live data, so they must be protected with the same care. Do not leave the encryption key and access details with only one person, but do not keep them where everyone can reach them either. A shared vault in a password manager, or a recovery code kept in a sealed envelope, is a reasonable balance. The restore document you prepare includes the steps that keep you calm in a crisis: where each backup is stored, the order in which to restore, who should be informed, and how to verify the backup and the live environment.

Common mistakes

  • Keeping all backups only on the same server.
  • Backing up only the files and forgetting the database.
  • Not noticing that a backup job has failed.
  • A weak password on the account that accesses the backup, or leaving the backup publicly accessible.
  • Only one person knowing the restore steps.
  • Storing backups containing personal data without encryption; for your obligations in this area, get legal support, as this article is general information.

Conclusion

The 3-2-1 rule consists of three copies, two media and one offsite location. Its real value, however, lies in taking these backups regularly and testing that they can be restored. If you need support in setting up your regular backups and recovery plan, you can contact us.

Frequently asked questions

What does the 3-2-1 backup rule mean?

It means at least 3 copies of your data, stored on 2 different storage media, with 1 copy kept in an offsite location.

Is the backup in my hosting panel enough?

Usually not. A backup on the same server can be lost together in a server failure or an account takeover. You should also keep a copy in an offsite location.

How often should I take backups?

It depends on how often your data changes and how much you are willing to lose. Sites that take orders frequently may back up the database several times a day.

Why is a restore test necessary?

A backup may be corrupted or incomplete, and you only find out when you try to restore it. Testing prevents surprises in a disaster.

Do I need to encrypt backups?

Yes, especially if they contain customer or user data. Keep the encryption key in a place separate from the system being backed up.

Need help with this?

Hosting, security, backups, SSL certificates and version upgrades.

See the serviceGet a quote

Related posts

All →