How to Backup WooCommerce Database & Website (Complete Guide)

Apr 14, 2021

How to Backup WooCommerce Database & Website (Complete Guide)

Apr 14, 2021

Taking backups of your WooCommerce website is the simplest way to keep your store secure. If something goes wrong, you can easily roll back to a stable version of your website.

But backing up your WooCommerce database is only part of the solution. To restore your website, you need both files and databases. The worst part is that securing your WooCommerce store involves much more than a simple backup.

So, while this article is about how to backup WooCommerce database, keep in mind that you’ll need both files and databases to recover your website from a backup.

TL;DR: Backup your Woocommerce database and website using a reliable backup plugin. Manual backups are too risky and you may end up losing your data instead.

Factors to consider before taking WooCommerce Store Backup

Before we get into how to take your WooCommerce store database backup, an important question to ask is how big that database is. This may seem trivial, but it’s not.

You see, the larger your WooCommerce site database, the more difficult it is to take a backup. As it is, creating even a small backup file uses a lot of server resources.

We’ll make this super-simple for you:

  • If your database is under 1 MB, feel free to take a manual backup. We don’t recommend it, but it won’t cause severe server issues at the very least.
  • If your database is under 100 MB, then using a free backup plugin is fine. There are other issues that you’ll face, but at least your WooCommerce database backup won’t be corrupted due to a server timeout error.
  • For any database that’s above 100 MB in file size, we highly recommend using a paid backup plugin like BlogVault.

So, if your website has a database that’s 5GB in size, then using a free backup plugin is completely out of the question. The sheer complexity of the task causes most free plugins to fail and deplete all your server resources in the process.

However, this doesn’t mean that you should take a manual database backup. Taking a manual WooCommerce database backup is possible and we’ll show you how to do it. But it’s never a good idea to take a manual backup. 

With a manual database backup, there’s a lot that can go wrong. You may end up accidentally changing something on your live website database that could potentially break the website. Then, there’s the matter of restoring your website from a .sql file, which is difficult at the best of times (more on this later).

In short: we do recommend that you use a backup plugin that can handle any database no matter how big.

So, this leaves you with paid WordPress backup plugins.

Now that we’ve got that out of the way, how do you know the size of your database?

In your WordPress dashboard, head over to Tools >> Site Health >> Info. Under Directories and Sizes, check the Database size.

check database size before taking Woocommerce database backup

Now, another consideration to make here is how many WooCommerce plugins are you using here? Do you use a security plugin like Wordfence that generates custom database tables to keep track of its security scans?

These all add to your database bloat.

If you’re not 100% sure, use BlogVault so that the size of the database becomes irrelevant. BlogVault is built for performance. No matter how big your database is, the plugin will never add to your server load or take incomplete backups.

Now that you know what kind of solution to use for a WooCommerce database backup, let’s get into how you can do that for each type of solution.

How to backup WooCommerce database and site?

In this section, we’ll talk about how to backup database for WooCommerce site using 3 different methods. Please keep in mind that we don’t recommend taking a manual backup under any circumstances. Under the right circumstances, you could use a free database backup plugin.

But if you need a backup solution that makes it super easy to restore your website quickly, then go for BlogVault. We’ve been in the backup industry for over a decade now and our backups continue to save businesses every day.

How to backup WooCommerce database using BlogVault?

Right off the bat, we’d like to tell you that BlogVault doesn’t only take a database backup. BlogVault backs up your entire website to an Amazon S3 server. All you have to do is install the plugin and go to your BlogVault dashboard.

The plugin automatically syncs up with your website and takes a daily backup on autopilot.

If you feel like taking an additional backup any time, all you have to do is click on the ‘Sync’ button:

selecting sync button in blogvault plugin dashboard for additional Woocommerce site backup

Once your initial backup is done, we recommend turning on incremental backups on your BlogVault dashboard.

Click on ‘Backup’:

backup woocommerce database using blogvault backup plugin

Then turn on ‘Real-Time Updates’:

Get Real-Time Updates for Incremental Backups

The best part is that you can restore your website right from the dashboard with one click.

And that’s it! It’s that simple.

How to Backup WooCommerce Site Database using phpMyAdmin?

Step #1: Log in to cPanel

Go to https://yourwebsite.com/cpanel and log in to cPanel:

Step #2: Head to phpMyAdmin

Click on the ‘phpMyAdmin’ option under ‘Databases’:

selecting PHPMyAdmin under c-panel

This will pull up a list of all the database tables:

list of Woocommerce database tables

Step #3: Export your WooCommerce Store Database

Click on your WordPress database to select it. You will be able to see the list of WordPress database tables when it is selected. Click on the ‘Export’ button on top:

exporting woocommerce site database

You will get a prompt to select the export method:

selecting default quick option for taking full Woocommerce database backup

Use the default ‘Quick’ option if you want to take a full database backup. If you want to choose which tables to export, you can click on ‘Custom’ and select the tables manually as well. But we don’t recommend this at all. To restore your website, you’ll need the full database and not just WooCommerce related tables.

Why using phpMyAdmin is a bad idea?

A database backup from cPanel exports a .sql file, and it’s incredibly difficult to use this to restore your website. To top it off, you have no way of knowing if the backup even works or if it got corrupted during a timeout without using a staging website.

So, what does this mean?

Well, to restore your website database from a .sql file, you’ll have to use phpMyAdmin again.

This time, you’ll be using the ‘Import’ option instead of the export option.

Choose the database you want to restore from the left navigation tree. Then click the ‘Check All’ check box and click the ‘With selected’ drop down menu and choose the ‘Drop’ option.

Drop MySQL tables for phpmyadmin import

After confirming, you’ll have to click the ‘Import’ tab and click the ‘Choose File’ button to upload the .sql file:

MySQL database import

Finally, hit ‘Go’ and you’re done.

If all this seems like a hassle, that’s because it is. For a large file, this process may suffer timeouts and server crashes. Not to mention, you just dropped all the existing database tables to upload the tables from your backup. If the process fails, your website is doomed for failure.

How to backup my WooCommerce database using a free plugin?

Again, this isn’t a recommended method. But if you’re 100% sure that you don’t want to invest in backups that will work and it’s more of a “good to have” for you, then we recommend using the WP Database Backup plugin.

It’s free and simple to use.

All you have to do is click on ‘Create a New Backup’: 

WP database backup plugin dashboard

It’s not the ideal option for a WooCommerce store even if you have a small database.

Free plugins won’t give you options for real-time backups. So, every time you change anything on your website, you’ll have to take a new backup. If you’re running a growing eCommerce store, then you know that this means having to take backups every 20 minutes at least.

A better way would be to use BlogVault’s real-time backups to keep taking backups on autopilot. 

What does a WooCommerce database include?

Any normal WordPress website stores a lot of data in its database including its entire content, comments, and a lot more.

Seeing as WooCommerce is a WordPress plugin, it shouldn’t surprise you to know that it uses a bunch of regular WordPress database tables. For instance, WooCommerce uses post tables for Custom Post Types to serve products, coupons, and orders.

However, there are some tables that WooCommerce creates all on its own. Some of the most common functions for these tables are to:

  • Store information on actions to be executed by Action Scheduler.
  • Create a log of actions executed by Action Scheduler.
  • Collect customer session data such as carts.
  • Store API keys for the REST API.
  • Create product taxonomies.
  • Store product access permissions for downloadable products.
  • Record customer orders.
  • Store product and order metadata.
  • List out user-defined tax rates and classes by postcodes and cities.
  • Record shipping zones, shipping methods, and store locations.
  • Store customer payment tokens and their metadata used by payment gateways.
  • Stores any webhooks that have been set up on the website.
  • Create a lookup table that indexes product metadata to process requests faster.

And a lot more. For a full list of table names and their specific functions, you can check out the Github repository by WooCommerce.

Full vs differential vs incremental backup: what should you use?

Differential and incremental backups are not the same things, and they’re definitely not the same as a full backup. There’s a whole lot of confusion between them because they seem quite similar to the uninitiated. But we are initiated and we’re going to tell you about it.

  • A full backup makes a complete copy of your entire website — files, database, and all.
  • An incremental backup makes a full backup the first time it runs and then updates the changes made on your website to the existing backup in real-time.
  • A differential backup looks for the last full backup and updates only the changes made since then.

In simple terms, differential backups are not real-time backups. If you have a daily differential backup running on your website, then it will update the changes every 24 hours. Real-time or incremental backups will update the backup automatically whenever a change is made to the website.

For a WooCommerce website, we strongly recommend using real-time backups. Every small user activity on your website might get stored if you’re running an online store. If your website is popular, then customer orders probably take place every minute.

So, taking a full backup of your website every minute is out of the question as it exerts too much load on your server. But taking an incremental backup not only safeguards your data immediately but also exerts negligible server load. Most of the changes are probably a few bytes in size at most.

If you’d like to learn more about different types of backups, you can read our article on it. But we most certainly recommend incremental backups for a WooCommerce website.

Also if you like to export your site database, you can go through our guide on how to export WordPress database.

What’s next?

Thousands of WooCommerce store owners like to take backups just as a countermeasure against getting hacked. This is not a good idea, ever. How do you know if your backup isn’t also contaminated with malware?

Our recommendation is to use a WordPress security plugin to protect your website against hackers and malware. That’s specialized software built for that specific purpose. 

Your website backup should be used for instances when your server crashes or if you’re changing web hosts. The most common use is when someone on your website inevitably makes a change to the code that ends up crashing it.

Go ahead and install BlogVault if you haven’t already and secure your data today. It’s your data. If you don’t protect it, who will?

0
Would love your thoughts, please comment.x
()
x