Do you want to learn how to back up your WordPress database?
In case your website has a server error or cyber attack, it’s important to back up your database. Using Duplicator, you can quickly save your current database and restore it after any data loss or unexpected changes.
In this tutorial, we’ll give you a step-by-step guide on how to back up a WordPress database!
Why You Should Back Up Your WordPress Database
Behind the scenes of your website, many components work together to show your content to visitors. WordPress websites have core files with custom themes, plugins, and uploads. Plus, there is a MySQL database.
Your database stores and organizes the data for your website. It saves your posts, pages, user data, categories, tags, and much more.
To keep your data secure, it’s important to back up your website. This way, you’ll have a saved copy on hand if an error occurs.
Here are some reasons you might need to have a backup of your WordPress database:
- Plugin or theme update errors
- Attacks from hackers
- Before migrations
- Accidental data loss
- Server errors
- Malware infections
Before any of these problems happen, you can back up your database. When you have regular backups to fall back on, you’ll always keep your website functioning correctly.
Note: Keep in mind that you should also do a full backup of your WordPress site. If your website crashes, a database backup won’t be enough to fully restore your site’s functionality. You’ll also have to have a complete backup of your site’s files.
How to Back Up a WordPress Database
Now that you know why database backups are important, let’s talk about how to perform one! We’ll show you all the backup options available for your database.
Method 1: Back Up Your Database With a Plugin
If you want to start backing up your database, you have two options. You could either use a WordPress backup plugin or do a manual backup.
To make sure your data is backed up correctly, we’d recommend installing a plugin. This will allow you to avoid making errors in your database.
Step 1: Install Duplicator
Duplicator is one of the best WordPress backup plugins. You can use it to easily save your entire website or parts of the site like your database:
Unlike other plugins, Duplicator Pro is well-equipped to handle large websites. If you need to back up the database for your WordPress Multisite network or ecommerce site, Duplicator is the right tool for you.
To get started, select a subscription for Duplicator Pro. After you check out, download the plugin and save your license key.
Then, you’ll need to install Duplicator in your WordPress admin dashboard. If you need help with this, check out this guide on installing and activating plugins.
Before you start using Duplicator, it’s important to activate your license key. First, go to Duplicator Pro » Settings » Licensing:
Paste your license key in the Activation settings. Now you’ll be prepared to back up your database!
Step 2: Create a Package
Using Duplicator, you’ll create packages that contain your website’s content, plugins, themes, database, and WordPress files. These packages are fully customizable, so you can easily save just your database if needed.
To create your first database backup, go to Duplicator Pro » Packages » Create New:
On the next page, name your package. Under Storage, select the offsite location where you want to save your website backup. Duplicator supports local storage, as well as cloud storage in Google Drive, Amazon S3, Dropbox, OneDrive, FTP, SFTP, and SSH:
For this tutorial, we’ll save the database backup to a local computer.
Next, you’ll need to adjust the archive file to only include your database. Normally, it would also package your core WordPress files.
To do this, find the Archive section. Then, check the box next to Archive only the database:
After you click Next, Duplicator will scan your website. If a successful database backup is possible, you’ll see all Good notices:
Lastly, hit Build. Your database backup will start automatically.
Tip: You can also use Duplicator to do file backups. As we mentioned earlier, it can be more helpful to have a full backup of your WordPress files and database. For complete backups, don’t make any changes to the default package settings.
Step 3: Download Your Backup
Once you create a database backup, you can download it to your computer. If your database ever becomes corrupted, this backup will be available for recovery.
To download your backup, go to the Packages page. Then, click on Download » Archive (zip):
This will download your database in a zip file. Whenever you need to restore your database, Duplicator can import this saved archive. First, find Duplicator Pro » Import:
Simply drag and drop your database archive into the upload box. After it uploads, you’ll see an overview of the package. Review this information and click Continue:
Then, Duplicator will prompt you to set a recovery point. However, if your website is already broken, you don’t need to set one. To continue, hit Launch Installer:
At the top of the page, make sure the mode is set to Overwrite Install – Database Only. After this, accept the terms and notices and click on Next:
Finally, you’ll need to confirm the installation settings. In the pop-up window, hit OK:
Duplicator will then install your database. You’ll need to log back into your dashboard:
By now, your original WordPress database will be restored!
Note: Keep in mind that a database-only package won’t restore your WordPress files. You should only use this method if there is an error within your current database. To fully restore a broken site, you’ll need to import a complete package of your entire website.
Step 4: Set up Automatic Backups
If you run a WooCommerce store, you might want to regularly back up your database to save your customer data. Instead of creating manual backups every time, consider enabling automated backups.
In your dashboard, go to Duplicator Pro » Schedules » Add New:
First, give your backup schedule a name. For example, you might label it Monthly Database Backup:
To only back up your database, you’ll need to create a custom template. To do this, hit the + icon next to Package Template:
On the next page, name the template. Then, select Archive only the database:
You can also choose a custom storage location if you’d like. Once you make these changes, go back to the Schedules page. Be sure to select the template you just created:
Now you can select how often you want your database backed up. Duplicator supports monthly, weekly, hourly, and daily backups:
You’ll also need to set a Start Time. This will tell Duplicator when you want to start the backup.
Finally, scroll to the bottom of the page. Here, check the box next to Enable This Schedule:
After you save your backup schedule, your database will be automatically backed up. By creating scheduled backups, you’ll have peace of mind that your data is secure!
Method 2: Back Up Your Database with phpMyAdmin
If you don’t want to use a plugin, you can also back up your database manually. However, this is not the best backup solution because it comes with more room for error. For secure site backups, we’d recommend using Duplicator instead.
One way to manually back up your database is through phpMyAdmin. This is software for managing MySQL databases with a web browser. It provides an intuitive interface for administrating WordPress database tasks.
Usually, hosting companies will give you access to phpMyAdmin. With Bluehost’s WordPress hosting plan, for example, there is a phpMyAdmin button in your control panel:
Once you’re in phpMyAdmin, select your database name. Then, click on the Export tab:
For the Export Method, choose Custom. The Format should be a SQL file:
Under this, you’ll see a list of database tables. You can deselect any of these to exclude them from the export file:
Next, scroll down to the Output section. Here, select Save output to a file. You’ll also need to set the Compression to zipped or gzipped:
To download your database, hit Go. Your database will download as a zipped or gzipped backup file to your local computer. You’ll need to save this in case your database ever unexpectedly changes.
Frequently Asked Questions (FAQs)
If you’re backing up your database for the first time, it can be a confusing process. To help, let’s answer some frequently asked questions!
How do I do a full backup of my WordPress site?
You can fully back up your site by creating a package with Duplicator. By default, Duplicator will bundle your site files, custom plugin and theme data, and database tables. After your package is built, you can download the archive and installer files to your computer. These make it easy to restore your site later if needed.
What is the best WordPress backup plugin?
The best WordPress backup plugin is Duplicator. You can use it to schedule automatic backups or manually back up your site in real-time. The plugin also has cloning and migration options to help you move to a new host without downtime.
Alternatives: BackWPup, BlogVault, and UpdraftPlus are also effective backup plugins. However, Duplicator provides a standalone installer which makes it easy to restore backups. Plus, it can back up larger sites and Multisite networks.
How do I manually back up my WordPress database?
You can manually back up your WordPress database by exporting it in phpMyAdmin. As an alternative, some web hosting providers have a backup feature in cPanel.
That’s it! You now know how to back up your WordPress database!
Do you need to restore your database backup after a crash or error? Check out our guide on restoring WordPress from a backup.
Are you ready to start backing up your database? Download Duplicator Pro today!