WordPress

How to Back Up a WooCommerce Store: Database, Files and Settings

Back up a WooCommerce store step by step: database and files, host, plugin and manual methods, settings export, and a restore that keeps your orders.

How to Back Up a WooCommerce Store: Database, Files and Settings
On this page 10 sections
  1. What a WooCommerce backup must include
  2. How often to back up
  3. Method 1: backups from your host
  4. Method 2: a backup plugin
  5. Method 3: a manual backup
  6. How to back up WooCommerce settings only
  7. How to restore without losing orders
  8. Test the backup
  9. Keep backups safe
  10. FAQ

To back up a WooCommerce store, save two things: the database, which holds orders, customers, products and settings, and the files, which hold images, the theme and plugins. Back up the database at least once a day and before every update, keep a copy outside your hosting account, and test that you can restore it. A store changes with every order, so a weekly backup that is fine for a blog can cost a shop days of sales.

This guide shows what to save, three ways to do it, how to export WooCommerce settings on their own, and how to restore without losing recent orders.

What a WooCommerce backup must include

Part What is in it Where it lives
Orders and customers Every order, address, note and customer account Database
Products Titles, prices, stock, attributes and variations Database
Settings Payment, shipping, tax and email settings, theme options Database
Product images and downloads Photos and the files of downloadable products Files: wp-content/uploads
Theme and child theme Templates and your custom code Files: wp-content/themes
Plugins WooCommerce and every extension Files: wp-content/plugins
Site configuration Database login and security keys Files: wp-config.php

The database matters most. Plugins and themes can be downloaded again; orders cannot.

The WooCommerce database tables

A database backup should always be complete. It still helps to know where WooCommerce keeps its data:

  • Orders. Stores created since WooCommerce 8.2 use High-Performance Order Storage: the tables wp_wc_orders, wp_wc_order_addresses, wp_wc_order_operational_data and wp_wc_orders_meta. Older stores keep orders in wp_posts and wp_postmeta. Order lines are in wp_woocommerce_order_items and wp_woocommerce_order_itemmeta.
  • Products. wp_posts and wp_postmeta, plus lookup tables such as wp_wc_product_meta_lookup.
  • Settings. The wp_options table, in rows whose names start with woocommerce_. There is no separate settings table.
  • Shipping zones and tax rates. wp_woocommerce_shipping_zones, the related zone tables, and wp_woocommerce_tax_rates.

Your table prefix may differ from wp_.

How often to back up

Store Database Files
Up to a few orders a day Daily Weekly
Dozens of orders a day Every few hours Daily
Busy store Real-time or hourly Daily

Also make a backup right before you update WooCommerce, the theme or any plugin, and before you edit code. Keep at least 30 days of copies, and keep one copy away from the server: cloud storage or another provider. If the hosting account is hacked or closed, backups stored inside it go with it.

Method 1: backups from your host

Most managed WordPress hosts take a daily snapshot and restore it in one click. Use them, but check three things: how many days are kept, whether you can download a copy, and whether a restore brings back the database and the files or only one of them.

Do not make host backups your only copy. They live with the same company as the site.

Method 2: a backup plugin

A plugin gives you a schedule, off-site storage and a restore button inside WordPress.

  • UpdraftPlus. The free version runs scheduled backups of the database and files and sends them to remote storage such as Google Drive or Dropbox. Incremental backups are part of the paid version.
  • Jetpack VaultPress Backup. A paid service that saves changes as they happen, which suits stores with many orders.
  • BackWPup and All-in-One WP Migration. Two more options named in the XStore documentation for backups before a theme update.

A basic setup with UpdraftPlus:

  1. Install and activate the plugin, then open its settings page.
  2. On the Settings tab, set the database schedule to daily or more often and the files schedule to weekly.
  3. Choose a remote storage service and connect it.
  4. Save, then press Backup Now to create the first copy.
  5. Check that the files appeared in your remote storage.

On a large store, schedule backups outside peak hours. Creating a full archive puts load on the server.

Method 3: a manual backup

A manual copy needs no plugin and works even when the dashboard is down.

The database. In your hosting panel, open phpMyAdmin, select the site’s database, choose Export, keep the SQL format and download the file. With WP-CLI it is one command:

wp db export store-backup.sql

The files. Connect over SFTP or use the host’s file manager and download the wp-content folder and wp-config.php. The uploads folder can be large, so compress it on the server first if you can.

Store the database file and the files together, with the date in the name.

How to back up WooCommerce settings only

WooCommerce has no button that exports all settings. If you rebuild test sites often, or want to copy a configuration to a new store, use these:

  • All settings. They are rows in wp_options. WP-CLI saves them to one file:

wp option list --search="woocommerce_*" --format=json > woocommerce-settings.json

  • Products. Products → All Products → Export creates a CSV file, and Import on the same screen reads it back.
  • Tax rates. WooCommerce → Settings → Tax → Standard rates has Export CSV and Import CSV buttons.
  • Shipping zones. They sit in their own tables, so copy them with a database export of the wp_woocommerce_shipping_* tables.
  • System status. WooCommerce → Status → Get system report. Save it with the backup: it lists the versions of WordPress, WooCommerce, the theme and every plugin, which you need to rebuild the same setup.

Theme options are also in the database, so a database backup includes them. Theme updates replace theme files and leave the database alone, which is why custom code belongs in a child theme. Our guide on updating a WordPress theme without losing customizations explains what an update overwrites.

How to restore without losing orders

Restoring last night’s backup puts the whole database back to last night. Every order, customer and stock change made since then disappears. Plan for that before you need it.

  1. Restore to a staging copy first whenever you can, and check that it works.
  2. Put the live store in maintenance mode, so no new orders arrive during the restore.
  3. Save what happened since the backup. Export recent orders, or at least keep the order emails, so you can enter them again.
  4. Restore only what broke. If an update damaged the theme or a plugin, restore the files and leave the database alone. Orders stay untouched.
  5. After a database restore, re-enter the orders from step 3 and correct the stock.
  6. Check the store. Open Settings → Permalinks and press Save, place a test order, and look at WooCommerce → Status for warnings.

This is where real-time backup services earn their price: they can roll the site back while keeping orders made after the restore point.

Test the backup

A backup you have never restored is a hope, not a backup. Twice a year, and after any change of host or backup tool:

  1. Restore the latest copy to a staging site.
  2. Log in and compare the newest order with the live store.
  3. Open a product, add it to the cart and reach the checkout.
  4. Note how long the restore took. That is your real downtime if the worst happens.

Keep backups safe

Backups contain names, addresses, emails and order histories. Treat them like the live database:

  • Never leave backup files in a public folder of the site.
  • Protect the storage account with a strong password and two-factor authentication.
  • Encrypt backups if your tool allows it.
  • Delete copies you no longer need. Privacy laws such as the GDPR apply to backups too.

FAQ

Does WooCommerce have a built-in backup?

No. WooCommerce can export products and tax rates to CSV, but it has no tool that backs up orders, customers and settings. Use your host, a backup plugin or a manual database export.

How do I back up only the WooCommerce database?

WooCommerce shares one database with WordPress. Export the whole database with phpMyAdmin or with the command wp db export. A partial export of selected tables is possible but easy to get wrong, because products and older orders sit in the general WordPress tables.

How often should I back up a WooCommerce store?

Back up the database daily at a minimum, and every few hours or in real time on a busy store. Files change less often, so daily or weekly is enough. Always back up before updates.

Where should I keep the backups?

In at least two places, one of them outside your hosting account: cloud storage such as Google Drive, Dropbox or Amazon S3. Keep about 30 days of copies.

Will a theme update delete my store data?

No. A theme update replaces the theme’s files and does not touch the database, so orders, products and settings stay. Changes made directly in the theme’s files are lost, which is why they should be in a child theme. Back up before the update anyway.

Share

Written by

Rose Tyler

Rose writes practical WordPress and WooCommerce guides for the 8theme blog.

All 35 articles by Rose Tyler