Hosting, Email & Infrastructure

The 3-2-1 Backup Strategy for Websites and Databases

Most businesses believe they have backups until they need one. The 3-2-1 rule gives you a simple, proven structure for protecting websites, databases and uploaded files.

Illustration of three copies of a website stored on two different media with one copy in a distant off-site location

Every business owner has heard "make sure you have backups". Fewer can answer the questions that matter during an incident: where exactly is the latest copy, how old is it, who can restore it and how long will it take? A sound website backup strategy answers all of these before anything goes wrong. The 3-2-1 rule is the simplest proven structure for doing that. This guide explains the rule, how it applies to websites and databases specifically, and how to test that your backups really work.

What the 3-2-1 rule means

The rule is short:

  • 3 copies of your data — the live production data plus two backups.
  • 2 different storage types or systems — so one failure mode cannot destroy both backups.
  • 1 copy off-site — in a different physical location, ideally with a different provider.

Many teams now add two further requirements, sometimes written as 3-2-1-1-0:

  • 1 copy offline or immutable — it cannot be altered or deleted for a set period.
  • 0 errors — restores are tested and verified.

The point is not the exact numbers. It is removing single points of failure: one server, one provider, one administrator account, one region.

What a website backup must include

A website is more than its files. Missing any of these components can make a restore incomplete.

Component Examples Notes
Application code Theme, plugins, Laravel app, custom modules Ideally also stored in version control
Database Products, orders, users, content, settings Usually the most valuable and fastest-changing part
Uploaded files Images, PDFs, user documents, invoices Often large; can be stored in object storage
Configuration Environment files, server config, cron jobs Secrets must be stored securely, not in plain text
DNS and SSL details Zone records, certificate setup Needed to rebuild on a new server quickly
Email (if hosted) Mailboxes, filters, aliases Usually backed up separately from the website

Key takeaway: A backup you have never restored is a hope, not a strategy. Define what you back up, where it goes, how long you keep it — and prove regularly that you can bring it back.

Choosing frequency: RPO and RTO

Two simple concepts help you decide how often to back up and how fast restores must be.

  • Recovery Point Objective (RPO): how much data you can afford to lose, measured in time. If your RPO is one hour, you need at least hourly database backups.
  • Recovery Time Objective (RTO): how long the site can be down while you restore. If your RTO is two hours, a restore process that takes a full day is not acceptable.

Typical patterns:

  • Brochure or corporate site: daily backups, a few hours to restore is acceptable.
  • Online store or booking platform: frequent database backups during trading hours, faster restore expectations.
  • Member portals or health platforms: frequent backups, encryption, strict access controls and documented restore procedures, often with a standby environment.

Building a practical 3-2-1 setup

Here is a setup that works well for most business websites and web applications:

  1. Copy 1 — production: the live server and database.
  2. Copy 2 — local snapshot: frequent snapshots or database dumps on separate storage within the hosting environment, for quick restores of recent mistakes.
  3. Copy 3 — off-site: encrypted backups sent to object storage with a different provider or region, with versioning and an immutability or retention lock enabled.
  4. Code in version control: application code in a Git repository, so the server can be rebuilt from source.
  5. Separate credentials: the account that writes backups should not be able to delete them, and the production server should not hold the keys to destroy the off-site copy.

Databases need special care

Copying database files while the database is running can produce corrupt backups. Use proper dump tools or snapshot methods designed for the database engine, and for busy platforms consider point-in-time recovery using binary logs so you can restore to a specific moment — for example, just before an accidental bulk deletion.

Large upload directories

Uploads can grow to many gigabytes. Incremental backup tools that only copy changed files keep this manageable. Moving uploads to object storage with versioning can simplify both performance and backups.

Testing restores

Test restores are where most backup strategies quietly fail. A simple testing routine:

  1. Monthly: restore one site or application to a staging server from the off-site copy.
  2. Check the result: can you log in, are recent orders or records present, do images and documents load?
  3. Time it: record how long the restore took and compare it with your RTO.
  4. Document the steps so another person could perform the restore during a holiday or emergency.
  5. Fix the gaps — missing configuration, undocumented cron jobs, expired credentials — and update the runbook.

Writing a simple restore runbook

When something goes wrong, people are under pressure and often not the person who set up the backups. A one- or two-page runbook for each site removes guesswork. It should cover:

  1. Where the backups are — storage locations, bucket or folder names, and which copy to use for which scenario.
  2. Who has access — named people and how to reach the credentials, stored in a password manager rather than in an email thread.
  3. How to restore the database — exact commands or tool steps, including how to restore to a specific point in time if supported.
  4. How to restore files and uploads — and how to verify that permissions and ownership are correct afterwards.
  5. How to rebuild the server if needed — operating system, software versions, configuration and DNS records.
  6. How to verify the restore — a short checklist of pages, forms, logins and integrations to test.
  7. Who to notify — internal stakeholders, customers if relevant, and any partners whose systems depend on yours.

Matching restores to real scenarios

Not every incident requires a full restore. Plan for the most common cases separately:

  • Someone deleted a page or product by mistake — restore a single record or file from a recent snapshot.
  • A plugin or code update broke the site — roll back the code from version control and restore the database from just before the update.
  • The server failed — rebuild on a new server from off-site backups and configuration notes.
  • The site was compromised — restore from a copy known to predate the compromise, then fix the vulnerability before going live again. Our server hardening checklist helps with that last step.

Common backup mistakes

  • Storing backups on the same server as the website.
  • Relying only on the hosting provider's backup with no independent copy.
  • Backing up files but not the database, or the reverse.
  • No monitoring of backup jobs, so failures go unnoticed for weeks.
  • Unencrypted backups containing customer personal data.
  • Short retention, so by the time an issue is discovered, every backup already contains the problem — common with slow-moving malware.
  • Keeping backups forever without considering privacy obligations to delete data you no longer need.

Backups and privacy obligations

Backups contain the same personal information as your live systems, so the same rules apply. Encrypt backups in transit and at rest, restrict who can access them, know where they are physically stored, and include them in your retention and deletion policies. Canadian businesses should consider PIPEDA and, in BC, PIPA; if you also serve customers in the UAE or EU, other laws may apply. Our article on data residency in Canada covers location questions, and a legal professional can confirm your specific obligations.

Next steps

Start by writing down, for each website or platform, what is backed up, where it is stored, how long it is kept and when a restore was last tested. Gaps become obvious quickly. DigiVort builds backups, off-site copies and restore testing into our managed hosting services and maintenance plans. If you would like an independent review of your current setup, start a conversation with our team.

Frequently asked questions

Are my hosting provider's backups enough?

They are a useful layer but rarely sufficient on their own. They usually live in the same provider's infrastructure, may have short retention, and are sometimes excluded from service guarantees. Keep at least one independent copy that you control.

How often should a website be backed up?

Match frequency to how much data you could afford to lose. A brochure site that changes monthly may be fine with daily backups, while an online store or portal taking orders all day may need hourly database backups or continuous replication.

What is an immutable backup?

An immutable backup cannot be changed or deleted for a set period, even by an administrator account. It protects against ransomware and attackers who gain access to your systems and try to destroy backups before encrypting or wiping data.

How long should backups be kept?

A common pattern is daily copies for a few weeks, weekly copies for a few months and monthly copies for a year or more. Contracts, regulations or industry rules may require specific retention, so confirm your obligations with a professional adviser.