What needs backing up
A website consists of two parts, and both need backing up. The first is the files: the system, theme, plugins and all uploaded images and documents. The second is the database, which holds the page content, settings and, for an online shop, orders and customers too. A backup of only one part won’t help you when something goes wrong.
How often and where
How often depends on how often the website changes. A simple company site whose content is edited a few times a month is fine with a weekly backup. An online shop taking orders every hour needs a database backup at least daily.
Where the backup is stored matters too. A backup on the same server as the website fails exactly when you need it most: when the server breaks down, the host has a fault or the site is hacked. A simple rule pays off: at least one copy off the server, for example in cloud storage, plus several older versions going back.
Why it matters
A website can break even without an attack. A plugin update that clashes with another one, a page deleted by mistake, an error while editing code. Without a backup, that means hours or days of repairs and, for an online shop, lost orders. With a backup, the website is back within minutes.
Example
Someone got into a travel agency’s website admin using an old password and inserted hidden code that redirected visitors to scam sites. The hack was only discovered after several days. Thanks to daily backups kept for a month, the website could be restored to its state before the attack, the passwords changed and the vulnerable plugin removed.
The most common mistakes
- Relying on your host. Some hosts make backups, but only for a few days back, or they charge for restoring. Find out how yours works.
- A backup nobody has tried to restore. It is often only during a restore that it turns out to be incomplete or corrupted.
- Only one, most recent copy. If you notice a hack late, you overwrite your clean backup with an infected one.
- No backup before an update or a bigger change to the website.
How I handle it at 5pixel
For websites I maintain, I set up automatic backups of both files and database, stored off the server with several versions going back. Before every bigger update I make an extra backup. This is a basic part of website maintenance, along with WordPress updates and SSL certificate checks. A backup is also a safety net during malware removal, because it allows the website to be restored to a clean state.