When submitting a support request for a WordPress plugin, one of the things you will commonly be asked for is a database dump of your site. A database dump allows the support technician to load your data into a test site to receive insight about the state of your particular site. Having a database dump provides an enormous amount of information to make support responses not only faster but more accurate.
WordPress and PHP provide several processes for exporting a database dump. We’re going to look at a few of the more common ones.
Table Of Contents
phpMyAdmin
phpMyAdmin is a PHP based web tool which is included with nearly all managed WordPress hosts. It is also available with many popular development environment tools. If you’re using a host like WP Engine, XAMPP or cPanel you already have phpMyAdmin available.
Each host has a slightly different location for accessing phpMyAdmin but it should be easy to find. You can also consult your host’s documentation on how to access phpMyAdmin.
Once you open phpMyAdmin you will see a screen which looks something like this.

Step 1: On the left side you will see a list of databases
Click on the database used by your site.
Step 2: Click on the “Export” tab
It will be located near the top middle of the screen.
Step 3: Click “Go.”
Make sure the “Quick” option is selected under the “Export Method” section.

Using SSH (Terminal)
Because your server or local computer is running MySQL it almost certainly has the mysqldump command available.
Step 1: Open your terminal and go to the directory where the export should be generated
The user and path will be different on your server but here is an example.
Step 2: Run the mysqldump command
You will need to pass the following information to the command using command flags.
-u
Username of your database.-p
Prompt you for a password.-h
Domain of your database server.- This will not always be required as it defaults to the current
localhost
.
- This will not always be required as it defaults to the current
Here is an example command. Replace <username>
, <password>
, <database name>
and <domain>
with the values for your specific database.
- This will export the database into the
~/sites/site-one/database-backup/backup.sql
file. - You may change the name of the export file by replacing “backup.sql” with another
<file>.sql
name in the command.
Using WP-CLI
If you are familiar using the terminal, there is a good chance you already have WP-CLI installed on your server. You can check for WP-CLI by opening your terminal and running wp --version
.
Step 1: Open your terminal and go to the directory where your site is located
The user and path will be different on your server but here is an example.
Step 2: Run the db export command
- The format of the command is
wp db export <file>.sql
. - The export
<file>
may be named whatever you like as long as it has a.sql
extension at the end of the file. - The file will be exported to the current directory.
- In this example it will be exported to
~/sites/site-one/public_html
.
- In this example it will be exported to
Using a WordPress Plugin
Many WordPress backup plugins exist which allow you to export a dump of your WordPress database. If you have a backup plugin you are familiar with, by all means, use it to create your database export.
If you are new to backup plugins and want to quickly install one for the purposes of a one-time export, WordPress.org recommends using Database Backup for WordPress.
Conclusion
As you can see, many solutions exist for the simple problem of exporting a WordPress database. If we find another one that we like, we’ll add it to this article.
Next time a support technician asks you for a database dump, you’ll be ready.
A note about security
A database export may contain information you do not want to share with the world so you’ll want to make sure you don’t publicly share the export. Passwords won’t show up in the export, but other personally identifying information such as names and email addresses will. There is also potential for internal information such as private posts or customer orders which you’ll want to protect.
OnPoint Plugins’ support includes a “Private Information” field for requests and responses. Be sure to use the “Private Information” field when you send us a link to download the export.