Security & Performance · E-commerce

Backups and Disaster Recovery for Online Stores

Network switch with cables plugged into its ports
In this article10 sections

An ecommerce backup strategy makes sure that, whatever goes wrong, you can restore your store's files and data to a recent, working state quickly. Disaster recovery is the plan that tells your team how to do it: who acts, in what order and how long each step should take. Most store owners have some backups; far fewer have tested restoring them, kept copies safely away from the server, or written down what to do at two in the morning when the site is down. Those gaps are what turn a bad day into a lost week of sales.

Key takeaways

  • Back up both the database and the files, on a schedule that matches how often your data changes.
  • Keep copies off the server, in a separate location an attacker or failure cannot reach.
  • Keep several versions, so you can go back to a point before a problem began.
  • Test restoring regularly; an untested backup is only a hope.
  • Write a short recovery plan with names, steps, contacts and target recovery times.

What can go wrong

It is easy to think of disasters as rare events, but the everyday causes of data loss are ordinary:

  • A failed update to the platform, theme or an extension that breaks the store.
  • Human error: a bulk edit that overwrites prices, a deleted category or an import with the wrong file.
  • Security incidents: malware, a hacked admin account or ransomware that encrypts files.
  • Hosting problems: a failed disk, a corrupted database or a provider outage.
  • Supplier problems: a hosting company or agency relationship ending abruptly.

Most stores will meet at least one of these at some point. The question is not whether something will go wrong, but how quickly you can put it right.

Each of these can stop sales. Some, such as an unnoticed bad import, may not be discovered for days. That is why the age and number of your backup versions matter as much as having a backup at all.

What to back up

An online store has two main parts, and both need protecting.

The database

The database holds products, prices, customers, orders, content and settings. It changes constantly, especially on a busy store. It is usually the most important part of any backup.

The files

Files include the platform's code, your theme, extensions, configuration and media such as product images. Code changes less often, but product images grow steadily, and configuration files hold critical settings.

Everything else you would need to rebuild

  • Server configuration and environment settings, stored securely.
  • Domain and DNS settings, so you can point the domain elsewhere if needed.
  • Access details for hosting, payment providers, carriers and other services, kept in a password manager.
  • Documentation of integrations and custom features.

If you use a hosted platform, the provider protects the infrastructure, but your own data, such as products and content, may still need separate exports. Check what your provider covers and what it does not.

How often and how long to keep backups

The right frequency depends on how much data you can afford to lose. Ask: if the store failed right now, how many hours of orders and changes could we recreate by hand? That answer, often called the recovery point objective, sets the backup schedule.

Store typeDatabase backupsFile backups
Small store, few orders a dayDailyDaily or weekly
Busy store, orders all daySeveral times a day, or continuousDaily
Before any update or bulk changeAlways, immediately beforeAlways, immediately before

Keep several versions: for example, recent daily copies, weekly copies for the past month and monthly copies for longer. Problems such as malware or bad data are sometimes noticed late, and you need a clean copy from before they started.

Where to keep backups

A backup stored only on the same server as the store is not much of a backup. If the server fails or is compromised, the backup goes with it.

  • Off the server: copy backups automatically to separate storage, ideally with a different provider or in a different region.
  • Protected from deletion: use storage that prevents backups being changed or deleted for a set period, which protects against ransomware and malicious deletion.
  • Encrypted: backups contain customer data, so encrypt them and restrict who can access them.
  • Owned by you: make sure your business, not just your agency or host, has access to the backups.

The UK's National Cyber Security Centre gives clear, practical advice on backing up your data that applies well to online stores.

Test your restores

Many businesses discover their backups are incomplete or unusable only when they need them. Testing removes that surprise.

  1. Restore to a separate environment, such as a staging server, at least every few months.
  2. Check that the store works: products appear, customers can log in, a test order completes.
  3. Time the process, from starting the restore to a working store. This tells you your realistic recovery time.
  4. Write down any problems and fix them, such as missing files or outdated instructions.

Ask your host or developer to show you a test restore. If they cannot, treat that as a warning.

Vary the tests over time. One quarter, restore the whole store; the next, practise recovering a single deleted product range or one day of orders. Smaller, realistic scenarios are often the ones you will actually face, and practising them makes the real event far calmer.

Your ecommerce backup and recovery plan

A recovery plan does not need to be long. One or two pages that anyone on the team can follow is enough. Include:

  • Who decides: the person who can declare an incident and approve a restore.
  • Who acts: developer, host and any other suppliers, with contact details and out-of-hours numbers.
  • First steps: put up a maintenance page, preserve evidence if a security incident is suspected, and stop further damage.
  • Restore steps: which backup to use, how to restore it and how to check the result.
  • Recovering lost orders: how to rebuild orders placed between the backup and the failure, using payment provider and email records.
  • Communication: what to tell customers, and when, if the store is down or data is affected.
  • Targets: how quickly you aim to be back online.

Keep a copy of the plan outside your normal systems, such as a printed copy or a shared document, so it is available even if your email or server is down.

Security incidents need extra steps

If the cause is a security breach, restoring a backup is not enough on its own. You must also close the weakness the attacker used, change passwords and keys, and check whether customer data was exposed. Our ecommerce security checklist includes an incident response sequence.

Reducing the need for recovery

The best disaster is one that never happens. A few habits make serious incidents much less likely:

  • Test updates on a staging copy before applying them to the live store.
  • Take a fresh backup immediately before any update, import or bulk edit.
  • Limit who can make bulk changes, and use roles with only the access people need.
  • Keep the platform and extensions patched; our guide to speeding up Magento also covers keeping a store current.
  • Monitor uptime and errors so problems are noticed in minutes, not hours.

When you choose a host, ask how they handle backups, how long they keep them and how quickly they can restore. Our guide to the best Magento hosting providers lists questions worth asking.

How fast do you need to be back?

Alongside how much data you can lose, decide how long the store can be offline. This target, often called the recovery time objective, shapes how much you invest in recovery.

Work it out from the cost of downtime. Look at your average sales per hour, then add the less visible costs: advertising that keeps running to a dead site, customers who go to competitors and may not return, and staff time spent handling the problem. For a busy store, even a few hours offline is expensive, which justifies faster recovery options such as a standby server or a hosting provider that can restore within minutes.

For smaller stores, restoring within a working day may be acceptable. What matters is that the target is agreed in advance and that your tested restore time actually meets it. If it does not, either invest in faster recovery or change the plan so expectations are realistic.

Hosted platforms and connected services

If your store runs on a hosted platform, the provider looks after servers and infrastructure, but that does not always cover your own data. Product data, customer records, orders, content and theme customisations may only be recoverable in limited ways. Regular exports, or a backup service designed for your platform, protect you against accidental deletion and bad imports.

Remember the services around your store, too. Email marketing lists, review data, accounting records and analytics settings live in other systems. Check how each one is backed up and how you would recover if an account were lost or closed. Exporting key data from each service every so often costs little and can save a great deal of trouble later.

Frequently asked questions

Does my host's backup service cover me?

It may cover part of your needs, but check how often backups run, how long they are kept, whether they are stored off the server and whether you can restore them yourself. Many businesses keep an independent copy as well.

How long does a restore take?

It depends on the size of your store and how practised your team is. Test a restore to find out, and use that time in your recovery plan.

What about orders placed after the last backup?

Those orders may need rebuilding from payment provider records, emails and marketplace data. More frequent database backups reduce how many you might need to recreate.

Should backups include customer data?

Yes, because you need it to restore the store, but treat backups as sensitive: encrypt them, restrict access and delete old copies in line with your data retention policy.

Not sure your store could recover from a bad day? Ask us to review your backups and recovery plan, including a test restore, so you know exactly where you stand.

Free expert advice

Want an expert to look at your store?

Tell us what you are working on. A senior e-commerce consultant will reply within one working day with honest, practical advice. No obligation and no sales script.

  • Reply within one working day
  • Advice even if we are not the right fit
  • Your details are never shared

We use your details only to reply to you. See our privacy policy.

About the author
Puja Kumari

Puja Kumari writes about e-commerce strategy, store operations and online growth for Pracoda Technologies, drawing on the team's experience building Magento 2 and custom online stores for clients around the world.

Need a consultation?

Tell us what you are building.

Share the problem, the platform and the deadline. We will come back with an approach, a team and an estimate.