Do you need to backup your WordPress database, for security reasons or to migrate your WordPress site to a new host? The database is an integral part of your website as it contains the information that allows your site to function properly. WordPress database backups are essential, not only to restore critical information in case your site goes down, but also when you find that some of your files are missing or corrupted during site migration.
There are a few different ways to backup the database, and choosing the best method depends on the needs and complexity of your site. In this article, we’ll show you three ways to backup your WordPress database.
What is a WordPress database?
The WordPress database is where all the information related to your WordPress site is stored. It includes your posts, comments, login information, theme, and configuration settings. Your website cannot function without a database.
WordPress uses the MySQL database management system to store and retrieve all of your website’s information. The MySQL database stores your website’s data in tables, rows, and columns. You can add, modify or delete the data so long as you have WordPress admin access.
To get the information you request, WordPress has to interact with the MySQL database. It does this by sending queries in SQL, the standard language of the MySQL database management system, within PHP, which is the language WordPress is written in. PHP and SQL work together to output data dynamically, disable comments, show specific content to users, delete records, and more.
When you install WordPress and use a WP Managed Services provider, then the database is created automatically for you. If you don’t opt for Managed WordPress hosting, then you’ll need to get database credentials from your preferred hosting provider. Your database will be stored on the server of your hosting provider.
When a visitor lands on your website, their browser will send a request to the server on which your site is hosted. The server will then send the data to the visitor and allow them to use it as you’ve determined. For example, you may choose to show only a small bit of the gated content such as a whitepaper or ebook on your site, and allow access only after the visitor has filled out a form.
Why WordPress database backups are important
As your WP database stores all the information you create, it’s important to have its copy ready in case your database gets wiped out or corrupted. However, WordPress doesn’t automatically backup data by default, leaving this website management task to owners. Just as you take care of your WordPress site’s security and run WordPress updates, you should perform regular WordPress database backups.
A backup creates a duplicate of your site’s database. In the event of a website crash, you will have access to all the content up until the point the incident occurred. Let’s look at some of the common reasons why the database should be backed up:
- Site migration: An incorrectly migrated database is a common error during WordPress site migrations. The backup and migration of the content of a WordPress site are easy, but lots of third-party backup plugins don’t migrate the database as well. As this can lead to missing databases during site migration, it’s a good idea to look for a backup solution or migration plugin that backs up the database as well.
- Security: The WordPress database stores critical information about your site security, such as login and passwords. Given its large user base, WordPress is a main target of hackers. Keeping fresh backups of your database will allow you to restore your site quickly in the event that your site is compromised.
- Accidental overwrites: Sometimes, you may accidentally change an important setting or delete something that should be kept. If your database is well backed-up, you can simply revert to the most recent backup and carry on!
- Before an upgrade: WordPress recommends that you backup your database before an upgrade of your theme, plugins, and WordPress core. If something goes wrong after you’ve made the updates, you’ll be able to restore your database from the backup and address the problem more easily.
How a WordPress database backup differs from a WordPress website backup
A WordPress database backup and a WordPress website backup are two different things.
A full WP site backup involves saving the files of the WordPress installation, along with the database. These files are stored in the public_html main directory and include WordPress plugins, core files, themes, images, code files, and static webpages. A database stores site data that isn’t contained in the site files, such as pages, posts, and comments. Site owners generally create a recurring backup task to save all of these files.
How often should you backup your WordPress database?
It’s a good idea to perform WordPress database backups as often as your site changes. Consider performing a site backup when you add or modify your site’s content, upload new themes/plugins, conduct new transactions on your WooCommerce site, register new users or receive new comments.
Are you adding content like articles, blogs, images, infographics, podcasts, videos, and other information on a regular basis or several times a day? Then your WordPress database backups should be regular too, and ideally mimic the frequency of content additions.
For example, if you’re running a marketing campaign and post multiple pieces of content a day on your WordPress blog or landing page, then you should run automated backups many times a day. This will protect you in the unfortunate event that your site crashes or suffers an attack. You won’t have to deal with a situation where the posts you created so painstakingly are lost. A lot of time and energy can be saved and frustration avoided by planning scheduled backups of your WordPress database ahead of time.
Does your site receive many comments and contact form responses every day? A tight WordPress database backup schedule ensures that the daily interactions remain in place and are accessible as needed. Not creating daily backups can cause more data to be lost between backups. The longer the time between backups, the bigger the risk of data loss when recovering from a backup. With adequate backup and recovery mechanisms in place, you can protect your database against data loss or corruption.
As already explained, any time you update WordPress, you should run a full backup. This includes changes to the WordPress core version, plugins, themes, content, and development-related changes.
WordPress database backup methods
Consider these three ways to perform WordPress database backups as part of your website or ecommerce management plan.
Method 1: Plugin backup
There are WordPress backup plugins that generate backups when you make changes to your website. Here, we’re going to run through the process with BlogVault, which is used by over 400,000 site owners.
- Download and install the BlogVault plugin
- Create a backup
- Done! Download the backup file to your computer for offline access
This is a quick and easy way to backup your WP database. Yet, you should make sure that the backup plugin you use also has a way to restore the backup, or else you might have to manually configure the database restoration yourself. Ideally, the plugin should offer automatic restoration and also indicate the timestamps for previous and upcoming backups, as is the case with BlogVault.
A few other issues may also crop up when you use a backup plugin. For example, backup plugins store their data in a folder on the WordPress site. If your site is corrupted, those files will be too, creating problems when you’re backing up your full site.
If the backups are taken at a server level rather than through your website, then even a minor issue can cause the backup to fail. As the backup happens regardless of whether your website is functional or online, you may be unaware that it has failed until you need the particular backup.
You’ll also have to consider the disk space the backups take up on the web server. The good news is that many WordPress backup plugins do incremental backups and do not use up disk space.
Disclaimer: Codeable is not associated with any of the plugins and solutions mentioned in this post.
Method 2: Manual backup through your hosting provider
You can manually backup your WP database. The advantage of this method is that it gives you control over which parts of the database to backup. For example, you might want to migrate a WordPress database to a new site, but without certain login details or theme settings. When you choose a manual backup, you can do a partial backup or only backup the information you need and leave the rest as is.
Many hosting providers have a database backup option. You may or may not find this option depending on whether you use cloud or shared web hosting, or use cPanel to manage your site. If you have access to cPanel, you can backup your database using phpMyAdmin, but there is usually an easier way through the ‘Backups’ section of the cPanel, as stated below:
- Open cPanel and look for the ‘Backups’ option
- Click ‘Download a MySQL Database Backup’
- Download the .gz database backup file to your computer
While this is a quick way to backup your database, restoring the database to a new hosting provider will require you to recreate the database login credentials and modify the wp-config.php file. If you’re not used to working with code, you’re bound to find manual WordPress database backup complicated and daunting.
You can save your database in a secure location on your PC as a backup. If you’re doing a full backup, you can save copies in the same folder as your WordPress files. Also, make sure you keep a record of when you’re performing the backups.
Method 3: Hire an expert
The easiest way to backup a WordPress site is to use a plugin. With a WordPress backup plugin, you don’t have to go into the cPanel or download copies of your database. You can schedule automatic backups and restore your database in one click, which will no doubt save you a lot of time and effort.
However, backing up a WordPress database is prone to errors. As we’ve already discussed, things can go wrong even with the best WordPress backup plugins. Also, you’ll need to check whether the plugin is able to restore the backup to a new location. This will come in handy when you’re backing up your database for a site migration, in which the database backup is only one step of the way, and restoring the backup to a new site is a different challenge entirely.
The manual method of WordPress database backup gives you more flexibility around what you’d like to backup. But it is more time-consuming and unviable if you don’t have coding knowledge.
You can skip these ways and bring in a WordPress professional to perform a database backup and migration for you. Many companies and freelancers offer these services online. You just have to choose wisely so that you can get the job done reliably and at a reasonable cost. However, here are some things to consider:
- Not all companies and freelancers have specialized knowledge of WordPress. If you hire a third party, make sure they have a great knowledge of the WordPress infrastructure and ecosystem.
- Pricing might differ depending on how the backup goes. Watch out for extra service fees in case you need to fix potential backup errors or problems with the data.
- Not everybody offers ongoing support after backup and migration. If you prefer to have continuing assistance for WordPress-related tasks, make sure the service is included in the package you choose.
A better way to find a WordPress database backup and migration expert is to use a platform like Codeable. Here’s why:
- All Codeable experts specialize in WordPress and have worked on similar projects. You can rest assured that they have what it takes to meet your expectations.
- Codeable experts are all carefully vetted – you can save time on checking references and portfolios.
- The process to hire someone on Codeable is quick and simple. Fill out a brief with the information about your existing site and migration plans, and Codeable will introduce you to 1-5 experts who are suitable for the job. Once you accept the estimate of one of the proposed experts, they can start working on your project!
Make smart choices about your WordPress database backup and security
Your website’s data is a valuable asset. It has monetary value for your business. You’ve spent hundreds of hours creating content that brings in customers. You never want to be in a situation where you’re unable to get back your site’s content after an adverse event.
Backing up your data and restoring it quickly is essential. While there are easy ways to backup your database, restoring it can be less simple and require technical expertise if you use manual restore procedures. A backup plugin is a convenient solution but it has its risks.
Entrusting a WordPress expert to carry out the job offers peace of mind knowing that an important website management task is in safe hands. Agencies offering this service may not provide ongoing support, include complete backups within a higher-priced WordPress maintenance plan, or charge you extra for ongoing support. Finding and vetting WordPress developers on freelance platforms will rob you of your time.
Instead, you can let Codeable put you in touch with vetted freelancers. Only those with the right skills will apply to your project. Estimates are free and there’s no obligation to hire if you aren’t ready! Want to see how it works right away? Submit your project on https://app.codeable.io/tasks/new.