How to Take a WordPress Database Backup Without a Plugin

Here is the 2800+ word blog post on "How to Take a WordPress Database Backup Without a Plugin":

Taking regular backups of your WordPress site is one of the most important things you can do to protect your data. Without backups, a failed update, hack, or server issue could permanently destroy all your hard work building your site.

While backup plugins can automate the process for you, they add another point of failure. If your site gets compromised to the point you can‘t access the admin area, those plugins do you no good. That‘s why learning how to manually backup your WordPress database is an essential skill.

In this step-by-step guide, you’ll learn:

  • What the WordPress database contains and why it’s important to back up
  • 3 methods to backup your database without a plugin
  • How to easily restore those backups

Knowing how to properly back up and restore gives you full control to protect your site, so let’s get started!

Understanding the WordPress Database

WordPress stores all your site’s content, settings, and users in a MySQL database. This database is defined in the wp-config.php file, which contains the database name, user, password, and other key details.

Some of the key pieces of data stored in the standard 11 WordPress database tables include:

  • Published posts, pages, and custom post types
  • Comments and comment metadata
  • Menu locations and structures
  • Widget settings
  • Plugin settings and data
  • Theme options
  • User profiles and roles

As you can see, the database contains sensitive information you wouldn’t want to lose. Without it, you’d have to rebuild your entire site from scratch.

That’s why it’s so important to back up the database regularly, especially before making major changes like:

  • Installing new plugins
  • Changing themes
  • Performing WordPress updates
  • Making edits to your .htaccess file or other key files

With backups in place, you have full protection. Even if an update or hacked plugin wipes out your site, you can restore a backup and be up and running again in minutes.

Now let’s go through several easy methods to back up your database without needing any backup plugins.

Backup Method #1: Schedule automatic backups with cPanel Cron Jobs

If your WordPress site is hosted on a shared hosting plan, chances are your provider gives you access to cPanel for managing settings and files.

The great thing about cPanel is it has a Cron Jobs feature that lets you easily schedule automatic database backups. With just a couple clicks, you can have peace of mind knowing your backups happen like clockwork.

Here’s how to schedule a daily database backup with Cron Jobs:

  1. Login to your cPanel dashboard
  2. Under “Advanced” in the main sidebar, click “Cron Jobs”
  3. In the Add New Cron Job section, configure settings:
    • Common Settings: How often you want backups performed (e.g. daily)
    • Command: Copy this code, replacing placeholders with your details:
      mysqldump –opt -Q -u [dbusername] –password=‘[dbpassword]‘ [dbname] | gzip > /path/to/backup/db_backup_[datetime].sql.gz
  4. Click “Add New Cron Job”

That’s all there is to it! cPanel will now automatically backup your database on the schedule you chose.

You can click the “View/Edit” link next to the cron job in cPanel at any time to make changes or view previous backup logs.

While this handles backups automatically, having an off-site backup is still a good idea as an extra precaution. So next let’s go over how to manually create database backups.

Backup Method #2: Manual Backup with cPanel Backup Wizard

In addition to cron jobs, cPanel also provides an easy-to-use Backup Wizard to create database backups manually.

The wizard includes helpful options for backing up:

  • Account files (themes, plugins, uploads)
  • MySQL databases
  • Email accounts
  • Email filters

Follow these simple steps to back up your WordPress database and files:

  1. Access cPanel and click “Backup Wizard” under Files
  2. Check the boxes to select which items to back up
    • Account files
    • MySQL databases
  3. Click “Generate Backup”
  4. Save backup .tar or .tar.gz file to your computer

The key thing to understand with cPanel backups is there are two types available:

  • Full backups – Contains all data needed to migrate your site to a new host. But full backups typically can NOT restore over existing data.
  • Partial backups – Only backs up account files and databases. Can restore over existing site in place.

So if you ever need to rollback changes or restore data after issues, a partial backup is what you‘d use in most cases.

Either way, running occasional manual backups gives you an extra layer of protection. Especially before making site edits, test upgrades first on a staging copy, then take a manual backup right before pushing changes live.

Next up, let‘s go over using the phpMyAdmin tool found in many cPanels to easily back up your database.

Backup Method #3: Manual Backup with phpMyAdmin

phpMyAdmin provides a quick way to directly access and edit your MySQL databases. Most shared hosting plans have this tool available through cPanel.

We can leverage phpMyAdmin’s database export feature to manually create WordPress database backups. Just navigate to it in cPanel, then:

  1. Select your WordPress database from the left sidebar
  2. Click “Export” tab near the top
  3. Check the boxes to select all tables
  4. Under Output, Check “Save output to a file”
    • Set character set to utf-8
    • Set compression as needed (e.g. gzipped)
  5. Scroll down and click “Go” to export
  6. Save the SQL file containing your backup

As you can see, phpMyAdmin makes it quick and easy to generate a DB backup without needing access to the WordPress admin area or installing any plugins.

The backup SQL file also gives you the flexibility to open and review the raw database contents if needed.

Now let’s go over how to restore your database from these backups if issues ever occur.

Restoring Database Backups

While preventative backups are great, they‘re only half of the equation. You need to make sure you can successfully restore those backups when needed too.

Thankfully restoring a MySQL WordPress database from backup is very straightforward using phpMyAdmin.

Here are the steps:

  1. Log into cPanel and access phpMyAdmin
  2. Select your WordPress database on the left sidebar
  3. Click “Import” tab near the top
  4. Click “Browse…” and select your backup SQL file
  5. Scroll down and select “Go” to import the backup

Once imported, you can check your WordPress site to confirm your backup was successfully restored. Rejoice knowing you have your site back fully intact!

Having this easy restoration process makes regular backups all the more important. You can experiment, upgrade plugins/themes, or make other changes without worrying about losing your data.

Keep Your Site Safe with Backups

I hope this guide gives you confidence for easily backing up and restoring your WordPress database for protection, maintenance, and disaster recovery.

As you saw, cPanel and phpMyAdmin provide straightforward tools for database-only backups without needing plugins or access to the WordPress admin.

Automatic cron jobs provide reliable “set it and forget it” background backups. And occasional manual backups give an extra layer of recent backups to restore from if issues arise.

To take your backup process even further, consider also using a specialized WordPress backup plugin like My WP Backup Pro. Features like scheduled backups to remote destinations, migration tools, and 1-click restores take your protection to the next level.

But at the very least, periodically manually backing up gives you crucial protection. No site owner can afford to not have recent backups these days!

Have you used any of these cPanel or phpMyAdmin backup/restore methods before? Or do you rely solely on WordPress backup plugins instead? I’d love to hear what database backup approach has worked best for you in securing your site! Please share your experiences in the comments.

Tags: