How should you back up a website or app?

Copy both the data and the files on a regular schedule, keep copies in a different place from the live site, protect them like the original and, above all, practise restoring one. A backup that has never been restored is not yet known to work.

Mistakes, failed updates, hacks and hardware problems all happen. Backups are what make them survivable.

What to back up

  • The database or data files: orders, bookings, accounts, content.
  • Uploaded files such as images and documents.
  • The code, in a repository.
  • Configuration, kept securely, since it often holds secrets.

Principles

  1. Frequency matches how much you can afford to lose. If you can lose a day of orders, daily is enough; if not, more often.
  2. Keep copies elsewhere, not only on the same server. A failure there takes both.
  3. Keep several generations, so you can go back before a problem began.
  4. Protect them. A backup contains the same personal data as the live system, so encrypt it and limit access.
  5. Automate and monitor. A manual routine is forgotten.
  6. Test the restore. Periodically recover into a separate place and check that the site works.

Do not rely only on your host

Many hosts offer backups, but their scope, retention and restore options differ, and they may not cover what you need. Know what exactly you are getting.

Also write down the restore steps, so that it is not knowledge held by one person during an emergency.

All questions