How to build a backup strategy you would actually trust in an emergency
Most people have a backup. Far fewer have a backup they have ever restored. This guide is about the difference, because the moment you need a backup is the worst moment to discover it is incomplete.
The 3-2-1 rule, made concrete
3 copies of your data — the live site plus two backups.
2 different media — for example a local snapshot and an off-site copy.
1 copy off-site — so a fire, theft or provider outage cannot take them all.
Back up both the files and the database
For a dynamic site, the database is where the content lives and the files are the code. A backup of only one is nearly useless — you cannot rebuild an e-commerce site from files alone.
# files
tar czf site-files-$(date +%F).tar.gz /var/www/example.com
# database
mysqldump -u user -p example_db | gzip > site-db-$(date +%F).sql.gzHow often is often enough?
Content that changes daily → at least a daily backup.
Static brochure sites → weekly is often fine.
High-transaction sites → consider point-in-time or continuous backup.
Automate it, and test the alarm
A backup that silently stopped three weeks ago is worse than no backup, because you stopped worrying. Have the job report on failure, and check that reports arrive.
The step almost everyone skips: restore once
Actually restore into a throwaway location and check it works. This is the only way to know your backup is complete, readable and fast enough to use under pressure.
Our hosting plans include automated off-site backups, and we will help you do a practice restore so the real one is boring.