Best ways to export WordPress database for backups

By Jelena Janić Posted Category Guides and resources Topics UpdraftPlus, WordPress,

Key points:

  • WordPress database exports are digital insurance for protecting site content, settings, and user data.
  • Database exports alone don’t include media files or themes – complete site backups require additional steps.
  • 3 reliable export methods are covered:
    • UpdraftPlus (user-friendly, automated).
    • phpMyAdmin (manual, requires technical knowledge).
    • WP-CLI (command-line, for advanced users).
  • UpdraftPlus offers the most comprehensive solution with automated scheduling, selective exports, and remote storage options.

Why you need to export your WordPress database

Section titled Why you need to export your WordPress database

When you export a WordPress database, you create a backup that contains the database elements of your website. This captures your site’s core WordPress database, including posts, pages, comments, user information and site configurations.

However, it’s essential to understand that database exports alone don’t include files and folders, such as images in your wp-content/uploads folder or themes stored on the server. For complete protection, you’d need to take a complete backup that includes both the database and file components.

Database exports provide essential protection in several critical scenarios:

  • Protection against data loss: Server crashes, hacking attempts and failed plugin updates can compromise your database without warning. Having a recent export means you can restore your site’s functionality within minutes rather than starting from scratch.
  • Site migrations made simple: Database exports are a must-have for transferring your site’s core content and settings when you’re changing hosting providers, moving to a staging environment or creating a local development copy.
  • Troubleshooting and rollback capability: When new plugins or themes cause conflicts, database exports allow you to restore your site to a previous working state. This rollback capability is invaluable when you need to isolate problems or test different configurations.
  • Professional development workflows: Agencies and developers particularly benefit from database exports during client handovers, as they provide clean snapshots of sites at specific development milestones.
  • Confident experimentation: With a recent database backup, you can test new features, make structural changes or experiment with different configurations, knowing you can always return to a working version.

The frequency of your database exports should align with how often your content changes and your risk tolerance. Here are the recommended schedules:

  • Before any major changes: Always export before WordPress updates, new plugin installations or theme modifications.
  • After significant content additions: Export following major content publishing sessions or structural changes.
  • Regular scheduled exports based on site activity:
    • eCommerce or membership sites: Daily exports due to frequent user data and transaction changes.
    • Active blogs or content sites: Weekly exports to capture regular publishing schedules.
    • Static or rarely updated sites: Monthly exports provide adequate protection.

Database backups are your first line of defence against data loss. In our experience helping millions of WordPress users, sites with regular database exports recover from incidents 90% faster than those without proper backup strategies. The key is consistency – automated, scheduled exports ensure your data is always protected.”

Anthonius Andreas – Lead Developer at UpdraftPlus

3 reliable methods to export your WordPress database

Section titled 3 reliable methods to export your WordPress database

Now that you understand why database exports are crucial, let’s dive into the practical side. You have three excellent options for exporting your WordPress database, each designed for different skill levels and use cases.

The key is choosing the approach that matches your comfort level and backup needs. Some methods prioritise ease of use and automation, while others offer granular control and advanced features. Here’s how they stack up:

Method  Best For  Advantages Limitations
 UpdraftPlus Plugin Regular users seeking simplicity. User-friendly interface, automation capabilities, scheduled backups, selective exports, remote storage options. Requires plugin installation.
 phpMyAdmin Users comfortable with database management. Direct database access, granular control, no plugin required, works with all hosting providers. Manual process, requires hosting panel access, no automation.
 WP-CLI Developers and advanced users. Lightning-fast exports, automation potential, excellent for large sites, command-line efficiency. Requires command-line knowledge and server access.

While all three methods reliably export WordPress databases, dedicated WordPress backup plugins like UpdraftPlus offer the best balance of simplicity and comprehensive protection for most users. They eliminate technical barriers while providing enterprise-level features like automation and remote storage integration.

Method 1: Export WordPress database with UpdraftPlus

Section titled Method 1: Export WordPress database with UpdraftPlus

UpdraftPlus is one of the industry’s most trusted WordPress backup plugins, with over 3 million active installations and an excellent Trustpilot rating. This popularity is mainly due to its ability to make complex database operations accessible to users of all technical levels, while providing enterprise-grade reliability.

UpdraftPlus – Best WordPress database backup and migration plugin

The plugin simplifies what was once a technical challenge into a straightforward process. Here’s your step-by-step guide to exporting your WordPress database with UpdraftPlus:

1. Install UpdraftPlus. Navigate to your WordPress admin dashboard, select “Plugins”, then “Add New”. Search for “UpdraftPlus” and click “Install Now”. After installation completes, click “Activate”.

Install and activate the UpdraftPlus plugin

2. Access the backup interface. From your WordPress admin dashboard, go to “UpdraftPlus” then “Backup/Restore”. This opens your backup control centre, where you can manage all backup operations.

Navigating to the backup and restore settings in UpdraftPlus

3. Initiate the database export. Click the blue “Backup Now” button. A popup window will appear with backup options.
4. Select database-only backup. In the popup, check only the “Include your database in the backup” option. This creates a focused export containing just your database content, perfect for migration or troubleshooting purposes. Click “Backup Now” to start the process.

Choose to backup only your database

5. Download your exported database. Once the backup completes, navigate to the “Existing Backups” tab. Here you’ll see your database backup listed with a download link. Click on the database component to download the file to your computer.

Download the database to your local storage device

Alternately, UpdraftPlus also gives users the option to not use the default and configure where they want their backup to be saved.

6. Choose remote storage. UpdraftPlus also offers sophisticated remote storage options that automatically save your backups to cloud services. To configure this, go to “UpdraftPlus” > “Settings” and choose your preferred remote storage option (Dropbox, Google Drive, Amazon S3 and others).

Choose the remote storage option where you want to store the database backup

7. Send database backup to remote storage. When taking future backups, select “Send this backup to remote storage” to automatically upload your database export after completion.

Send your database backup to your selected remote storage option

Premium features that enhance database exports

Section titled Premium features that enhance database exports

UpdraftPlus Premium unlocks advanced capabilities that streamline database management:

  • Automated scheduling: Eliminate the risk of forgotten backups with customisable intervals that match your site’s update frequency.
  • Selective backups: Choose specific database tables or exclude unnecessary data to reduce backup size and processing time.
  • High-capacity handling: Manage extremely large databases and navigate hosting memory limits with optimised processing.
  • Database encryption: Enhance the security of your exported databases with advanced encryption protection for sensitive sites.
  • Pre-update backup automation: Automatically create database backups before WordPress core, plugin or theme updates.

UpdraftPlus eliminates the technical complexity traditionally associated with manual database exports. You don’t need to understand SQL, navigate hosting control panels or remember command-line syntax. The plugin handles the technical details while giving you complete control over when and how your database gets exported.

Method 2. Manual export via phpMyAdmin

Section titled Method 2. Manual export via phpMyAdmin

phpMyAdmin provides direct access to your WordPress database through a web-based interface available in most hosting control panels. This method requires no plugins but demands more technical knowledge and understanding of database structures. It’s ideal for one-time exports or situations where you need granular control over the export process.

This approach works well when you want to examine your database structure, export specific tables or work in environments where plugin installation isn’t feasible. However, it lacks the automation capabilities that make regular backups practical for most users.

Here’s your complete guide to manually exporting your WordPress database:

1. Log in to your web hosting control panel (commonly cPanel, Plesk or a custom dashboard).

2. Navigate to the Databases section.

3. Click on the phpMyAdmin icon or link.

Accessing the site database in phpMyAdmin

4. Click on the database associated with your WordPress installation from the left sidebar, where all your databases are listed. If you’re unsure which database belongs to your WordPress site, you can find this information in your wp-config.php file (located in your WordPress root directory).

5. Click on the Export tab at the top of the phpMyAdmin interface. You’ll be presented with two export methods:

  • Quick: Uses default export settings (simpler option). For most standard WordPress sites, this option is sufficient, so choose it.
  • Custom: Allows for more detailed configuration.

6. Select SQL from the format dropdown menu.

7. Click Go to start the export process.

💡Best practices for phpMyAdmin exports: Store your database backups in multiple locations – never rely solely on your web server for backup storage. Consider using cloud storage services or external drives to ensure your backups survive server failures.

While phpMyAdmin provides complete control over your database export process, it requires manual execution each time. For regular backups, automated solutions like UpdraftPlus offer better reliability and convenience.

Troubleshooting large database exports

Section titled Troubleshooting large database exports

If your WordPress site contains thousands of posts, comments or products, you might encounter timeout issues during export. Here are proven solutions:

  • Enable compression: Use the “Custom” export method and enable gzip compression to reduce file size and transfer time.
  • Adjust server settings: Contact your hosting provider to temporarily increase timeout limits:
    • Apache configuration: Set Timeout 900 (allows 900 seconds for request processing).
    • PHP configuration: Set max_execution_time = 900 and memory_limit = 512M.
  • Export in segments: If full exports continue failing, export tables individually or in smaller groups through the Custom export options.

Method 3. Command-line exports with WP-CLI

Section titled Method 3. Command-line exports with WP-CLI

WP-CLI (WordPress Command Line Interface) represents the most efficient method for exporting WordPress databases, particularly for developers, system administrators and users managing multiple WordPress installations. This powerful tool enables lightning-fast database operations without browser interfaces or graphical tools.

The command-line approach excels in scenarios requiring automation, handling large databases or integrating database exports into deployment workflows. Advanced users appreciate WP-CLI’s speed and scriptability, which allows for sophisticated backup strategies and bulk site management.

Prerequisites and setup: WP-CLI must be installed on the server. If it isn’t already installed, the recommended installation method involves downloading the Phar build and placing it in the system’s executable path.

WP-CLI commands must be executed from the WordPress root directory. If you don’t operate within this directory, errors may occur because WP-CLI relies on detecting the wp-config.php file to infer database credentials. Use cd to navigate:

cd /path/to/wordpress

The core command for database exports is wp db export, which invokes mysqldump internally:

wp db export backup.sql

This command:

  • Automatically detects database credentials from wp-config.php (DB_NAME, DB_USER, DB_PASSWORD, DB_HOST).
  • Generates an SQL dump file (backup.sql) in the current directory.
  • Includes all tables by default unless filtered using –tables or–exclude_tables.

You know it executed successfully when it returns:

Success: Exported to 'backup.sql'.

Specify custom file paths: You can specify an absolute path to save the backup outside the WordPress directory to prevent accidental public exposure and use the $(date +\%F) to macro append the current date (e.g., 2025-05-06.sql) to facilitate organised backups:

wp db export /home/user/backups/$(date +\%F).sql

Compress exports for large databases: Pipe output to gzip for compressed backups, dramatically reducing storage requirements and transfer times:

wp db export - | gzip > backup.sql.gz

The compression typically reduces database file sizes by 80-90%, making it an excellent option for large websites or environments with limited storage.

Handle extremely large databases: Split exports into manageable chunks for databases exceeding memory limits using split:

wp db export - | split -b 500M - backup_part_

This creates multiple 500MB files (backup_part_aa, backup_part_ab, etc.) that can be recombined later if needed.

Table filtering options: Export specific tables or exclude unnecessary data:

wp db export --tables=wp_posts,wp_postmeta backup.sql
wp db export --exclude_tables=wp_comments,wp_commentmeta backup.sql

These options prove valuable when you need focused exports for debugging or when migrating specific content types.

If you don’t have WP-CLI but have SSH access, you can run mysqldump -u user -p dbname > backup.sql && gzip backup.sql for the same result. Replace user with your actual MySQL username and dbname with the name of the database you want to back up. This approach provides a reliable fallback for command-line database exports.

Command breakdown:

  • > backup.sql redirects the output to a file named backup.sql.
  • && ensures this command only runs if the previous one succeeds.
  • gzip backup.sql compresses the backup.sql file into backup.sql.gz and deletes the original backup.sql file.

You can find your database credentials in your wp-config.php file. Look for DB_USER (username), DB_NAME (database_name) and be prepared to enter the DB_PASSWORD when prompted.

This SSH method provides the same core functionality as WP-CLI database exports while working in environments where WP-CLI isn’t available. The compressed output saves significant storage space and reduces transfer times for large databases.

Secure your WordPress site with reliable UpdraftPlus backups today

Section titled Secure your WordPress site with reliable UpdraftPlus backups today

You now have three proven methods for exporting your WordPress database: UpdraftPlus for simplicity, phpMyAdmin for hands-on control and WP-CLI for developer efficiency. Each serves its purpose, but the reality is that manual approaches often fail when life gets busy, deadlines pile up or you simply forget.

Your database contains everything that makes your WordPress site unique, from every blog post you’ve crafted to every customisation you’ve made. Protecting this data should be a priority, not an afterthought.

UpdraftPlus stands out as the most complete solution for this, addressing the key concerns we’ve discussed throughout this guide. Plus, with UpdraftPlus Premium, you gain access to enterprise-level features like scheduled backups that turn database protection from a manual chore into an automated safeguard.

Don’t wait for a crisis to discover the value of database backups. Start protecting your WordPress site today with UpdraftPlus.

About the author

Profile picture of Jelena, the product manager for WP-Optimize

Jelena Janić

Jelena is the Product Manager for UpdraftPlus and WP-Optimize. With seven years of experience, she’s taken on many roles – from tester to developer and now product manager. Along the way, she noticed a disconnect between how products are built and what customers need, sparking a passion for steering products toward solutions that truly serve the people who use them. Today, she ensures every WP-Optimize development decision is geared toward boosting WordPress website performance, enhancing usability, and increasing customer satisfaction.

UpdraftPlus

Get all our premium features. Direct site-to-site migration, incremental backups, back up automatically before updates and a whole lot more.

From just $70 for the year.

More stories

Our plugins

Try TeamUpdraft’s full suite of WordPress plugins.

  • UpdraftPlus

    Back up, restore and migrate your WordPress website with UpdraftPlus

  • WP-Optimize

    Speed up and optimize your WordPress website. Cache your site, clean the database and compress images

  • UpdraftCentral

    Centrally manage all your WordPress websites’ plugins, updates, backups, users, pages and posts from one location