Website backups and ransomware: the 3-2-1 rule, explained
Back up files, database, DNS records and email as 3 copies on 2 kinds of storage with 1 offsite, make one offline or locked, and test a restore.
UB Web Developers team
A backup saves you from ransomware only if the attacker can't reach it and you have checked that it restores. Keep three copies on two kinds of storage with one offsite (CISA (opens in new tab)), make that copy offline or locked against deletion, and test a restore before you need it (CISA (opens in new tab)).
For a website, a full backup covers four things: the files, the database, your domain's DNS records and your email.
Why does ransomware go after backups?#
A working backup lets a victim recover without paying, so attackers look for it. The #StopRansomware Guide (opens in new tab) from CISA, the FBI, the NSA and MS-ISAC warns that "many ransomware variants attempt to find and subsequently delete or encrypt accessible backups".
The surveys show how often that happens and what it costs:
- In a Sophos survey of 2,974 IT staff in early 2024, 94% of organisations hit by ransomware said the attackers had tried to compromise their backups, and 57% of those attempts worked (Sophos (opens in new tab)). Organisations whose backups were hit paid the ransom 67% of the time, against 36% for the rest. Their median recovery cost was $3 million, against $375,000.
- Sophos's State of Ransomware 2026 (opens in new tab) surveyed 2,158 organisations in 17 countries from January to March 2026. Attackers encrypted data in 56% of the attacks. Of the organisations whose data was encrypted, 66% got it back from backups, up from 54% a year earlier, and 48% paid the ransom.
- Verizon's 2026 Data Breach Investigations Report (opens in new tab) found ransomware in 48% of breaches. In its 2025 report, ransomware was part of 88% of breaches at small and medium-sized businesses, against 39% at large ones (The Record (opens in new tab)).
Sophos only surveyed organisations with 100 to 5,000 employees, so its figures don't describe the smallest businesses. They still point one way: organisations whose backups survived paid less often and recovered for less.
A backup has one limit. It brings your site back, but it can't stop attackers publishing data they copied first. In Sophos's 2026 survey, 16% of attacks both encrypted and stole data.
What is the 3-2-1 rule?#
Data Backup Options (opens in new tab), a 2012 paper published by US-CERT, now part of CISA, sets it out like this:
- 3 copies of any important file: the original and 2 backups.
- 2 different kinds of storage, so one hazard can't destroy every copy.
- 1 copy offsite, outside your home or office.
For a website, that could be the live site on your host, a scheduled backup to cloud storage in an account you own, and a third copy that nobody can change from the site. The #StopRansomware Guide asks for "offline, encrypted backups" and suggests turning on "delete protection or object lock" for cloud storage. Object lock stops anyone deleting or overwriting a file for a set time.
Two habits keep that third copy out of reach. Give the backup storage its own login with two-factor authentication, so someone who takes over the site can't log in there too. If the offline copy is on a USB drive, unplug it after each backup.
Keep older backups as well as the newest. In October 2026, attackers used connection keys stolen from TeamUpdraft, the company behind the UpdraftPlus backup plugin, to plant backdoors in WordPress sites, and our explainer tells sites that were hit to restore from a backup taken before 17 October. That only works if a backup from before the attack still exists. The WordPress handbook (opens in new tab) suggests keeping at least 3 to 5 recent backups, in different places.
What should a website backup include?#
| What | Where it usually lives | How to copy it |
|---|---|---|
| Files: code, themes, plugins, images and uploads | Your hosting account | A backup plugin, your host's backup tool or SFTP |
| Database: pages, posts, orders and users | A MySQL or MariaDB database at your host | A backup plugin or a database export |
| Domain and DNS records | Your registrar or DNS provider | An export from your DNS provider, or every record copied into a file |
| Google Workspace, Microsoft 365 or your host | The provider's export tool, or ask your host |
Files and database. The WordPress handbook (opens in new tab) splits a site into its files (WordPress itself, plugins, themes, images and other code) and a database kept in a separate system. It says: "You need both to be able to fully restore a typical WordPress site." Other systems can split differently, so check what yours stores and how to export it. The handbook suggests a weekly backup for a small site, a daily one for a busy site, and a database backup before every upgrade.
DNS records. If your records are deleted or changed, or you have to move to another DNS provider, your site and email can stop working until every record is set up again, including the mail records explained in our SPF, DKIM and DMARC guide. Most DNS providers let you export your records. Cloudflare (opens in new tab), for example, has an Export option on its DNS Records page and says exporting makes moving a domain easier. Also write down which company your domain is registered with, which account holds it, and when it renews.
Email. In Google Workspace, a super administrator can export the organisation's data, with some exclusions, using Google's data export tool (opens in new tab). Google's conditions include a super admin account at least 30 days old (unless the organisation is newer), 2-Step Verification on that account, and an active subscription for Gmail to be included. An export typically takes 72 hours and can take up to 14 days, so check the conditions before you rely on it. A personal Gmail account has its own export (opens in new tab). If your mailboxes sit in the same hosting account as your website, ask your host whether its backups include them.
How do I know my backup will restore?#
Restore it. CISA says to "regularly test the availability and integrity of backups in a disaster recovery scenario". For a website, that means restoring the latest backup onto a test address or a spare hosting account, then checking that pages load, images show, forms send and you can log in. Note how long it took, because that is roughly how long your site would be down.
Check what you restore, too. CISA warns that attackers can leave malware behind, and that "care must be taken to identify such dropper malware before rebuilding from backups". A backup made after a break-in can bring the attacker back with it. Our guide to the signs that a website has been hacked covers what to look for.
Sources#
- CISA, MS-ISAC, NSA and FBI, #StopRansomware Guide (opens in new tab), September 2023
- Paul Ruggiero and Matthew A. Heckathorn, US-CERT, Data Backup Options (opens in new tab), 2012
- Sophos, The State of Ransomware 2026 (opens in new tab), 2026, and the full report (opens in new tab)
- Sophos, The impact of compromised backups on ransomware outcomes (opens in new tab), March 2024
- Verizon, 2026 Data Breach Investigations Report (opens in new tab), checked 23 October 2026
- The Record, Ransomware now plays a role in nearly half of all breaches, new research finds (opens in new tab), 24 April 2025
- WordPress.org, Backups (opens in new tab), Advanced Administration Handbook, last updated 14 October 2026
- Cloudflare, Import and export records (opens in new tab), last updated 16 April 2026
- Google, Export all your organization's data (opens in new tab), Google Workspace Help
- Google, Export your data from Gmail (opens in new tab), Gmail Help
Frequently asked questions#
What is the 3-2-1 backup rule?#
Keep 3 copies of important data (the original and 2 backups) on 2 different kinds of storage, with 1 copy kept offsite. It comes from Data Backup Options (opens in new tab), a paper published by US-CERT, now part of CISA. Against ransomware, also keep one copy offline or locked against deletion (CISA (opens in new tab)).
How often should I back up my website?#
The WordPress handbook (opens in new tab) suggests once a week for a small site with few posts, daily for a busy one, and a database backup before every upgrade. If your site takes orders or bookings, those live in the database, so back it up at least daily.
Aren't my web host's backups enough?#
They are one copy, not three. The WordPress handbook (opens in new tab) notes that most hosts back up the whole server, but that getting a copy from them takes time. If the hosting account itself is hacked or suspended, its backups can be out of reach too, so keep at least one copy in an account you control.
Does a backup protect me if attackers also stole my data?#
No. A backup gets your site running again, but it can't stop attackers publishing or selling what they copied. In Sophos's 2026 survey (opens in new tab), 16% of ransomware attacks both encrypted and stole data.
Where should I keep the offline copy?#
Offline means storage that isn't connected to the site, such as a drive you unplug after each backup. Cloud storage with delete protection or object lock turned on is still online, but it stops the copy being deleted, which CISA also recommends (opens in new tab). CISA warns (opens in new tab) that many ransomware variants look for backups they can reach, to delete or encrypt them.