Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A manual WordPress database backup is an SQL export of the database that stores your posts, pages, comments, users, and settings. It does not include themes, plugins, media uploads, wp-config.php, or any other files. For a restorable site backup, save the database export together with a copy of the WordPress files.

The most accessible method is phpMyAdmin. If you have SSH access, mysqldump or WP-CLI is easier to automate and usually better for large databases. Always back up regularly and before upgrades, migrations, or other high-risk changes.

Before you export: identify the right database

A hosting server can contain several databases, so first identify the one used by this WordPress installation.

  1. Open the site’s wp-config.php file.
  2. Record DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST. Do not publish or share the password.
  3. Note the table prefix in $table_prefix. It is often wp_, but WordPress installations can use a different prefix.

Use the database named by DB_NAME and preserve its complete set of prefixed tables. Exporting a similarly named database or omitting tables can produce an incomplete backup.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose the manual backup method

Method Access required Best for Trade-off
phpMyAdmin Hosting control panel Most users and one-off exports Web upload and timeout limits can affect very large databases
mysqldump SSH or another shell Large databases and scripted backups Requires command-line access and correct credentials
WP-CLI Shell access and a WordPress installation WordPress-aware scripts and table selection Requires WP-CLI to be installed and usable by your account

Back up with phpMyAdmin

  1. Sign in to your hosting control panel and open phpMyAdmin.
  2. Select the database identified by DB_NAME in the left-hand navigation.
  3. Open the Export tab.
  4. Choose Quick, keep the format as SQL, and click Go. This exports all tables in a straightforward dump.
  5. Save the downloaded .sql file with a date and site identifier in its name.

Choose Custom instead of Quick when you need to select particular tables or adjust export options. A normal full database backup should include every WordPress table, including tables created by active plugins.

Back up with mysqldump over SSH

Run the command from a shell, replacing the host, username, and database name with the values from your hosting account or wp-config.php:

mysqldump --add-drop-table -h db01.example.net -u dbusername -p dbname > blog.bak.sql

Enter the database password when prompted. The resulting blog.bak.sql file is an uncompressed SQL dump.

Compress the completed dump

gzip blog.bak.sql

This creates blog.bak.sql.gz. For a single streaming operation, export and compress simultaneously:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
mysqldump --add-drop-table -h db01.example.net -u dbusername -p dbname | gzip > blog.bak.sql.gz

The WordPress handbook also documents bzip2. Gzip is generally faster for large databases, while bzip2 can produce a smaller archive at the cost of more processing time.

Back up with WP-CLI

Change to the WordPress installation directory and run:

wp db dump backup.sql

WP-CLI reads DB_HOST, DB_NAME, DB_USER, and DB_PASSWORD from wp-config.php, then runs a database dump. You can choose another destination filename:

wp db dump /path/to/archives/site-2026-09-30.sql

For targeted exports, WP-CLI supports --tables to include tables and --exclude_tables to omit them. It also accepts valid mysqldump flags. A targeted dump is useful for troubleshooting or migration work, but a disaster-recovery backup should normally contain the entire database.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Store and verify the backup

  • Move the export off the web server. An external USB hard drive or portable SSD is suitable for a local copy.
  • Keep a second copy in another location so a server failure, theft, or local storage problem does not destroy every copy.
  • Check that the file exists and has a plausible size for the site. An unexpectedly empty or tiny file warrants investigation.
  • Open an uncompressed .sql file as text and confirm it contains SQL statements and the expected table names. Do not edit it casually.
  • For a production site, perform a test restore into a staging database before relying on the archive during an emergency.

Official WordPress guidance recommends regular database backups and an additional backup before an upgrade. It does not specify one universal retention period or storage capacity; choose a schedule based on how often the site changes and how much data you can afford to lose.

Rank #4
Teacher Record Book
  • Keep track of everything from attendance to test scores
  • Spiral bound
  • Measures 8-1/2" x 11"
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Restore an SQL backup with phpMyAdmin

  1. Create or select the destination MySQL or MariaDB database. Make sure it is the intended database; importing into the wrong one can overwrite another site.
  2. Open phpMyAdmin and select that destination database.
  3. Choose Import.
  4. Browse to the .sql file (or a compressed archive format supported by your host), confirm the SQL format, and run the import.
  5. Confirm that the expected WordPress tables, including the correct table prefix, appear after the import.

The import restores the state captured in the dump and can overwrite the destination database contents. Changes made after the backup date can therefore be lost.

Restore from the command line

Decompress a gzip archive first:

gzip -d blog.bak.sql.gz

Then feed the SQL file to the MySQL client:

mysql -h mysqlhostserver -u mysqlusername -p databasename < blog.bak.sql

Enter the password when prompted. Verify the host, username, and destination database before running the command because the import replaces the destination with the dump’s captured state.

What changes when you move the site to another domain?

Importing the database alone does not update every URL used by a WordPress site. After importing into the new environment, update the siteurl and home values in the wp_options table for the new domain. Then use a WordPress-aware search-and-replace tool for the remaining URL changes so serialized data is handled safely. Editing only plain text matches can corrupt serialized values.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Database backup versus full-site backup

The database contains content and configuration data such as posts, pages, comments, users, and settings. A complete recovery also needs the WordPress files: themes, plugins, uploads, wp-config.php, and other files in the installation. Keep the SQL archive with a corresponding file backup and record which date and site each pair represents.

Quick Recap

SaleBestseller No. 1
SaleBestseller No. 3
Bestseller No. 4
Teacher Record Book
Teacher Record Book
Keep track of everything from attendance to test scores; Spiral bound; Measures 8-1/2" x 11"
$4.89

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.