If you’re running a WordPress site, you might eventually need to export WordPress database for backups, migration, or troubleshooting. And yet, many users find this process very daunting, especially when encountering unexpected hiccups like data corruption or incomplete exports. Just keep in mind that a database export only covers your content and settings; media files, themes, and plugins live in your site’s files and need to be backed up separately.
But don’t worry; we’re here to help you through it all! In this article, our team will discuss 4 different ways to export WordPress database:
- Method 1: How to export the database using phpMyAdmin
- Method 2: How to export using SSH
- Method 3: How to export with WP-CLI
- Method 4: How to export using MySQL GUI tools
Key takeaways:
- phpMyAdmin is the easiest way to export WordPress database files for beginners with small to medium databases.
- SSH (mysqldump) and WP-CLI are faster and more reliable for large databases, since they aren’t limited by browser timeouts.
- MySQL GUI tools, such as MySQL Workbench, suit users who prefer a desktop app with export wizards.
- Want to move your whole site or store to another platform? A migration solution like LitExtension saves you from handling SQL files yourself.
Not sure which way to export WordPress database files fits you best? Here’s a quick comparison:
|
Method |
Best for |
Skill level |
Large databases? |
|
phpMyAdmin |
Beginners with small to medium databases who want a point-and-click export from the hosting panel |
Beginner |
Limited (browser timeouts and PHP limits may apply) |
|
SSH (mysqldump) |
Developers and site owners with SSH access who want a fast, reliable export |
Advanced |
Yes |
|
WP-CLI |
WordPress users comfortable with the terminal; reads database details from wp-config.php automatically |
Intermediate |
Yes |
|
MySQL GUI tools |
Users who prefer a desktop app with export wizards and extra database features |
Beginner to intermediate |
Yes (depends on the tool and connection) |
Are you ready? Let’s get started!
Export WordPress Database: A Quick Overview
First, before exploring the different export methods, let’s take a moment to clarify what exactly this export process is meant to achieve!

Simply put, exporting a WordPress database means all the data (your posts, pages, user info, settings, etc.) will get saved in a file, usually in SQL format, that can be read by most database systems available. This is important for three reasons:
- Safety: Having a database backup means that if something goes wrong (e.g., server crash or hacker attack), you can quickly bring your website back online with minimal downtime.
- Flexibility: Need to pull just a few posts or pages for a new project? A WordPress export database will let you do that easily. There’s no need to start from scratch when repurposing some of your content.
- Website migration: If you’re moving to a new hosting provider or switching servers, a fresh export ensures all your site’s data can facilitate the move without a hitch.
Moving Your WordPress Site to a New Platform?
LitExtension Automated Migration Tool transfers your pages, blog posts, products, customers, and orders to your new platform, with no manual database export or import.

Before You Export: Find Your Database Details
Whichever method you choose to export WordPress database content, you’ll need a few details about your database first. All of them are stored in the wp-config.php file in your site’s root folder, which you can open with your host’s File Manager or an FTP/SFTP client:
- DB_NAME: The name of your WordPress database. This tells you which database to pick in phpMyAdmin or a GUI tool.
- DB_USER and DB_PASSWORD: The database username and password you’ll need for mysqldump or a GUI tool connection.
- DB_HOST: The database server address, often “localhost” on shared hosting.
- $table_prefix: The prefix of your WordPress tables (“wp_” by default). If your database is shared with other apps, export only the tables that start with this prefix.
If you have several databases and still can’t tell which one belongs to your site, ask your hosting provider. And since wp-config.php contains your database password, never share this file or leave a copy in a public folder.
Method 1: How to Export WordPress Database Using phpMyAdmin
Are you a beginner looking to avoid the technical deep dive? Then, this free, open-source tool is perfect for you, especially if you’re working with simple or smaller databases! You don’t even need to turn to the command line during the entire process.
However, one catch with phpMyAdmin is that it’s not included in all hosting providers. For instance, managed hosts like Cloudways don’t include phpMyAdmin by default; instead, they provide a built-in database manager, which also lets you export your database as an SQL or gzip file. So, make sure your hosting provider supports phpMyAdmin before proceeding to the steps below:
Step 1. Select your database
First, log in to your web hosting control panel (usually cPanel) and click the “phpMyAdmin” icon. Have no cPanel on your host? Then look for phpMyAdmin (or a similar database tool) in your host’s dashboard, or check its help docs for the right access link.
Once in phpMyAdmin, find a list of databases on the left-hand side, then click the database name associated with your WordPress site (the DB_NAME value in wp-config.php).

Step 2. Select your export method
After selecting the database in Step 1, click the “Export” tab at the top. When the export screen shows up, choose the “Custom” option under the “Export Method” section. (The “Quick” option also works if you simply want to export everything with the default settings.)
Next, from the dropdown menu, choose “SQL” as the format. This is the format you need to back up or restore the whole database; CSV (or “CSV for MS Excel”) is only handy if you want to open individual tables in a spreadsheet.

Once done, scroll to the “Tables” section and ensure all tables are selected to back up the entire database. For larger databases, you can also select “gzipped” under “Compression” in the “Output” section to get a smaller file.

Step 3. Export WordPress database
Finally, scroll to the bottom and click the “Export” button (“Go” on older phpMyAdmin versions) to start the export process. Your database file (in SQL format) will be downloaded to your computer!

Method 2: How to Export WordPress Database Using SSH
Now, let’s talk about SSH (short for Secure Shell). It’s a powerful protocol that gives you secure, remote access to servers and ensures the connection between your computer and the server is locked down tight.
However, that means you’ll need a solid grasp of command-line interfaces (CLI) and a basic understanding of server management to export WordPress site databases. Without that technical know-how, the following steps might be a bit tricky:
Step 1. Log in to your server
First, open your terminal or command prompt, then type the following command:
ssh username@server_ip
Make sure to replace “username” with your actual server user name and “server_ip” with your server’s IP address! Once done, press “Enter” to connect.
Step 2. Run the mysqldump command
After connecting, run this command to back up your database:
mysqldump -u database_user -p database_name > ~/wordpress_backup.sql
Remember to replace “database_user” with your database username (DB_USER) and “database_name” with your WordPress database name (DB_NAME). Also, adjust “~/wordpress_backup.sql” with the location and name you want for the backup file. Since this command runs on the server, the path must be a folder on the server (here, your home directory), not a folder on your own computer.
Need a smaller file or only part of the database? Here are a few useful variations:
- Compress the backup: mysqldump -u database_user -p database_name | gzip > ~/wordpress_backup.sql.gz
- Export only specific tables: mysqldump -u database_user -p database_name wp_posts wp_postmeta > ~/posts_backup.sql
- Skip a large table (e.g., a plugin’s log table): mysqldump -u database_user -p database_name –ignore-table=database_name.wp_table_name > ~/wordpress_backup.sql
After that, press “Enter.”
Step 3. Export WordPress database
When prompted, type your database password and press “Enter.” Your WordPress database backup is now created! To confirm the backup is complete, list the files in your directory by typing:
ls -lrt
Now, check if you see the file “wordpress_backup.sql”; if it’s there, the backup was successful! (If mysqldump shows an “Access denied” error about the PROCESS privilege, which is common on shared hosting, add –no-tablespaces to the command and run it again.)
You just need to download this backup file to your local drive for safekeeping. To do so, open a new terminal window on your computer (not on the server) and run the command below, or use an SFTP client or your host’s File Manager:
scp username@server_ip:~/wordpress_backup.sql .
Method 3: How to Export WordPress Database Using WP-CLI
Another common approach is to use WP-CLI (WordPress Command Line Interface). As its name suggests, you can skip the admin dashboard entirely to handle everything from the command line — whether it’s a database export, plugin update, or theme installation!
But before we go into the steps, here’s a word of caution: although WP-CLI isn’t too complex, you still need to be comfortable using basic command lines or terminals. WP-CLI must also be installed on your server; many managed WordPress hosts include it, but on your own VPS, you may need to install it first. Read our instructions carefully to avoid hiccups along the way:
Step 1. Log in to the WordPress server
The first thing to do is to open the terminal and use the SSH command to access your WordPress server:
ssh username@wordpress-ip-address
Make sure to replace “username” with your actual username and “wordpress-ip-address” with the IP address of your server.
Step 2. Locate the WordPress root directory
Once logging in, navigate to the folder where WordPress is installed. The simplest way to do so is by running this command:
cd /var/www/html/wordpress
Note that this path is just an example and varies by host (for instance, many shared hosts use ~/public_html). The right folder is the one that contains your wp-config.php file; if you’re not sure, use the ls command to list the files in each folder.
Step 3. Export WordPress database
Now, create a backup of your WordPress database using this command:
wp db export
WP-CLI reads the database credentials from your wp-config.php file, so you don’t need to type a username or password. This command will save the export in your current directory, with a file name based on your database name and the date (e.g., dbname-2026-11-11-a1b2c3d.sql). If you prefer another storage location or file name, use this command:
wp db export /backup/wp-backup.sql
Replace /backup/ with a specific folder you choose, and that’s it! WP-CLI also lets you compress or filter the export:
- Compress the backup: wp db export – | gzip > wp-backup.sql.gz
- Export only specific tables: wp db export –tables=wp_posts,wp_postmeta
- Skip certain tables: wp db export –exclude_tables=wp_table_name
Method 4: How to Export Using MySQL GUI Tools
If you prefer a visual interface instead of command lines, MySQL GUI tools offer a much more intuitive way to export WordPress database files. These tools typically provide point-and-click workflows, built-in query editors, and export wizards that simplify the entire backup process, even for larger or more complex databases.
That said, each tool differs in terms of supported operating systems and additional features. Below is a curated comparison table to help you choose the most suitable option:
|
Tool Name |
Supported OS (Paid Version) |
Supported OS (Free / Trial Version) |
Key Features |
|
MySQL Workbench |
Windows, macOS, Linux (commercial editions) |
Windows, macOS, Linux (free Community Edition) |
– Official MySQL tool from Oracle |
|
EMS SQL Management Studio for MySQL |
Windows |
Windows (14-day trial) |
– Visual database designer with ER diagrams |
|
Aqua Data Studio |
Windows, macOS, Linux |
Windows, macOS, Linux (14-day trial) |
– Supports many database types beyond MySQL |
|
Navicat for MySQL |
Windows, macOS, Linux |
Windows, macOS, Linux (14-day trial) |
– GUI for backup, restore, and data transfer |
|
SQLyog |
Windows |
Windows (14-day trial) |
– Fast, lightweight interface |
|
DBeaver |
Windows, macOS, Linux (DBeaver PRO) |
Windows, macOS, Linux (free, open-source Community Edition) |
– Universal database tool for MySQL, MariaDB, and many other databases |
|
HeidiSQL |
– |
Windows, macOS, Linux (free, open-source) |
– Export to SQL, CSV, XML, JSON, HTML, and more |
|
Sequel Ace |
– |
macOS (free, open-source) |
– Native macOS app for MySQL and MariaDB |
|
Querious |
macOS (one-time purchase) |
macOS (free trial) |
– Clean, modern macOS interface |
How to export with MySQL Workbench
Let’s take MySQL Workbench, the free official tool from Oracle, as an example. Before you start, make sure your computer can connect to the database server: many hosts require you to allow your IP address under “Remote MySQL” in cPanel, or you can connect through SSH instead. Then, follow these steps:
- Step 1: Open MySQL Workbench, click the “+” icon next to “MySQL Connections,” and enter your connection details (hostname, port 3306, and the DB_USER from wp-config.php). If your host only allows SSH access, choose “Standard TCP/IP over SSH” as the connection method. Then, open the connection.
- Step 2: Click “Server” > “Data Export” in the top menu (or “Data Export” in the left-hand Navigator panel).
- Step 3: Tick your WordPress database (schema), then choose the tables to export. Keep “Dump Structure and Data” selected to get a full backup.
- Step 4: Under “Export Options,” select “Export to Self-Contained File” and choose where to save the .sql file on your computer.
- Step 5: Click “Start Export.” Once the progress bar finishes, your database file is ready in the folder you selected.
WordPress Export Tool vs. Database Export: What’s the Difference?
Many users confuse the steps to export WordPress database files with the built-in export tool in WordPress (Tools > Export). While both give you a downloadable file, they serve very different purposes.
The WordPress export tool creates an XML file (called a WordPress eXtended RSS, or WXR, file) containing your content, which you can import into another WordPress site via Tools > Import > WordPress. A database export, on the other hand, copies the entire database, so you can fully restore your site or move it to a new server. Here’s how they compare:
|
Criteria |
Tools > Export (WordPress) |
Database export |
|
File format |
XML file (WordPress eXtended RSS, or WXR) |
SQL file (optionally compressed as .sql.gz) |
|
What’s included |
Posts, pages, custom post types, comments, custom fields, categories, tags, custom taxonomies, navigation menus, and users |
Every table in the database, including content, site settings, users, and data saved by plugins and themes |
|
What’s not included |
Site settings, widgets, most plugin data, and the media files themselves |
Media files, themes, plugins, and other site files |
|
How to restore |
Tools > Import > WordPress on another WordPress site |
phpMyAdmin, WP-CLI, or the mysql command |
|
Best for |
Moving selected content to another WordPress site |
Full backups, restores, and server or hosting migrations |
In short, use Tools > Export when you only want to move posts and pages to another WordPress site, and export WordPress database files with the methods above when you need a complete backup of your site’s data.
Common Issues When Exporting Large Databases
When you export WordPress database files for a small site, the process is usually straightforward. However, dealing with large datasets might be a different story, as certain limitations and errors tend to appear more frequently:
Timeout errors and incomplete exports
One of the most frequent problems, especially with phpMyAdmin, is timeout errors. Since phpMyAdmin runs through your browser, it is subject to server execution limits. If your database is too large, the export process may stop midway without completing.
To avoid this, you can either increase your server’s max execution time (if you have access) or switch to more robust methods like SSH or WP-CLI, which are not restricted by browser timeouts.
Another workaround is to export the database in smaller chunks; for example, you can export selected tables instead of the entire database at once.
Memory limits or server constraints
Large exports can also hit PHP memory limits or server resource caps. This issue is particularly common in shared hosting environments, where resources are tightly controlled.
If you encounter memory-related errors, the most reliable fix is to use command-line tools like mysqldump or wp db export, which run outside PHP and are not bound by its memory limit. Enabling compression (such as gzip) also helps by making the exported file much smaller to store and download.
For those who are performing a one-time migration, upgrading your hosting plan or temporarily increasing memory limits can also help.
Character encoding issues
Another critical issue is incorrect character encoding. If your export settings do not match the database’s original encoding (e.g., utf8 vs. utf8mb4), you may encounter broken characters or corrupted content after import.
To prevent this, always verify the encoding settings before exporting. New WordPress installations use utf8mb4 by default (see the DB_CHARSET value in wp-config.php), while some older sites may still use utf8. Most tools let you explicitly define the charset, so make sure it matches your WordPress database configuration.
Failed imports of large export files
Sometimes, the export itself works fine, but the file fails when you import it to the new server. Here are the most common causes:
- The file exceeds the upload limit: phpMyAdmin shows a maximum upload size on its Import screen, which depends on PHP settings such as upload_max_filesize and post_max_size. Compress the file with gzip, ask your host to raise these limits, or import with WP-CLI or the mysql command instead.
- “MySQL server has gone away”: This usually means a single SQL statement is larger than the server’s max_allowed_packet setting (64MB by default in MySQL 8.4, though many hosts use a lower value). When exporting with phpMyAdmin’s “Custom” method, lower the “Maximal length of created query” option so large INSERT statements are split into smaller ones, or ask your host to increase max_allowed_packet.
- “Access denied” errors: Double-check the database username and password, and make sure the database user has full privileges on the target database.
How to Restore A WordPress Database from An Exported Database File
We have already walked you through ways to export WordPress database files and how to fix common export issues. Now, let’s tackle the next step: restoring your WordPress database from a backup!
The process is straightforward, nothing complicated. Just remember that a restore replaces the tables in your current database, so export the current version first if you might need it later.
Restore using phpMyAdmin
First, open phpMyAdmin and select your WordPress database from the left-hand side. Then, click “Check all” below the table list to select all tables, find the drop-down menu labeled “With selected,” and choose “Drop” from the menu.

When prompted, click “Yes” to confirm the operation. Once this operation is done, click on the “Import” tab. Click “Choose File” and select the backup file you want to import (phpMyAdmin accepts both .sql and compressed .sql.gz files). Finally, to finish, click the “Import” button (“Go” on older phpMyAdmin versions).

Restore using WP-CLI or the command line
For large backup files, the command line is usually faster and avoids phpMyAdmin’s upload limits. First, upload the backup file to your server, connect via SSH, and navigate to your WordPress folder (the one containing wp-config.php). Then, run:
wp db import wordpress_backup.sql
WP-CLI uses the database details in wp-config.php, but it doesn’t create the database itself, so make sure the database already exists. Don’t have WP-CLI? Use the mysql command instead:
mysql -u database_user -p database_name < wordpress_backup.sql
If your backup is compressed, unzip it first with gunzip wordpress_backup.sql.gz. And if you’re restoring to a site with a different domain, run wp search-replace ‘https://old-domain.com’ ‘https://new-domain.com’ –dry-run to preview the URL changes, then run it again without –dry-run to apply them. This command safely handles serialized data, unlike editing URLs directly in the SQL file.
How to Migrate A WordPress Database
We’ve just covered how to export WordPress database with 4 methods and how to restore it, which are ideal if you simply want to create a WordPress backup or extract specific data. But for a full WordPress site migration, you’ll likely need a more comprehensive alternative! Here are two highly recommended migration approaches you may consider:
To use the WP Migrate plugin (Basic)
Among the many WordPress database export plugins available, WP Migrate (formerly WP Migrate DB) is one of the most widely used, with 200,000+ active installations. And true to the “Migrate” in its name, the free WP Migrate Lite version goes beyond regular exports: it can find and replace URLs and file paths during the export, and even export your whole site (database, media, themes, and plugins) as a ZIP file. Here’s how to get started:
Step 1. Adjust the settings
Install and activate WP Migrate Lite, then go to the sidebar in your WordPress dashboard, click “Tools,” and select “WP Migrate.” On the “Migrate” tab, choose “Export” as your migration action.

In the “Database” panel, keep all tables selected to export the entire database. If you only need the database, leave the other panels (Media Uploads, Themes, Plugins, etc.) unchecked; select them as well if you want a full-site export.

Next, in the “Find & Replace” panel, enter the new URL and the new file path where the site will be stored on the new server. The plugin handles serialized data, so these values are replaced safely throughout the database.

Step 2. Export WordPress database
Finally, run the export. Once the export finishes, the file will automatically download to your computer: a database-only export gives you an SQL file, while a full-site export comes as a ZIP archive. Now, you can upload the SQL file to your new server and import it using the command line, WP-CLI, or phpMyAdmin, as shown in the restore section above!

To contact LitExtension (Advanced)
As you can see, the WordPress export database plugin above is very beginner-friendly. But that’s exactly why you can only use this plugin for simple, basic migrations, preferably to a platform fairly similar to WordPress in core features! Otherwise, more complex requirements will likely cause you frustrating roadblocks along the way.
So, let us suggest a much smarter alternative: contact the LitExtension team. With 15+ years of experience and support for 140+ eCommerce platforms and website builders, we can handle even the most challenging migrations effortlessly!
Overall, there are only three steps to keep in mind:

Step 1. Consultation by LitExtension experts
The first thing to do is to reach out to our LitExtension team; our primary goal at this stage is to fully understand your migration needs. For example, do you want to migrate your WordPress media library, blog posts, orders, products, or other data types?
We will provide a clear outline of the services and pricing after reviewing your requirements (the All-in-One Migration Service starts from $129, as a one-time payment). Once you’re good to go, we’ll sign an SLA, and a dedicated Personal Assistant will take over the migration process from here!
Step 2. Data mapping and setup by experts
Now that your needs have been clearly defined, our LitExtension team will start the technical groundwork, which involves:
- Setting up and validating your new store’s platform
- Installing the necessary plugins and preparing the environment
- Running a demo migration for each data type
- Creating 301 redirects to keep your SEO intact
Interested in seeing how it works before committing? No problem; we can offer you a free LitExtension demo migration.
Step 3. Perform full eCommerce replatforming
The setup in Step 2 is finalized; now, it’s time for us to carry out the full migration process for you! Your Personal Assistant will send you regular progress updates throughout the entire process.
After the data transfer, our experts will run multiple rounds of testing with our in-house automated testing system, then confirm the results with you to ensure nothing is out of place. At this point, your new site is ready for you to launch on its new platform.
And the benefits just keep coming even after that! All additional options, such as 301 redirects, are included at no extra cost to you. Plus, for up to 60 days after the full migration, you can rest easy knowing that we’ve got you covered with 2 free re-migrations, plus free and unlimited Smart Updates and Recent Data Migrations (as long as the new data doesn’t exceed 5% of the initial migration) to ensure no data is missing.
Ready to unlock your next big win? Reach out to our team today!
Let Our Experts Handle Your WordPress Migration!
With the All-in-One Migration Service, our experts plan, map, and transfer your WordPress data, then test the results before you launch.

Export WordPress Database: FAQs
Can you export a WordPress database?
Yes. You can export WordPress database content, such as posts, pages, products, orders, comments, and settings, using phpMyAdmin, SSH (mysqldump), WP-CLI, a MySQL GUI tool, or a plugin. For a comprehensive website migration, we recommend contacting the LitExtension team.
Does exporting the database back up my images and themes?
No. A database export only includes the data stored in your database, such as posts, pages, users, and settings. Your media files, themes, plugins, and wp-config.php are stored as files on your server, so back up the wp-content folder and wp-config.php separately (via FTP/SFTP, your host’s File Manager, or a backup plugin).
How do I export only specific tables?
To export WordPress database tables selectively in phpMyAdmin, choose the “Custom” export method and select only the tables you need in the “Tables” section. With WP-CLI, use wp db export –tables=wp_posts,wp_postmeta, or list the table names after the database name in a mysqldump command.
How do I export a WordPress database to Excel?
In phpMyAdmin, select the table you need (for example, wp_posts), open the “Export” tab, choose “Custom,” and pick “CSV for MS Excel” as the format. Alternatively, many export plugins let you download WordPress data as Excel, CSV, or XML files.
How do I backup my WordPress database?
To back up your site, export WordPress database files using any of the methods we have discussed above and download them to your computer. Then, store these files in a secure location, ideally in more than one place (such as your computer and a cloud storage service).
Which is better for WordPress, MySQL or MariaDB?
Both work well. WordPress officially recommends MySQL version 8.0 or greater or MariaDB version 10.11 or greater. MariaDB is a drop-in replacement for MySQL and is popular for its performance and open-source nature, while MySQL remains a highly stable and reliable standard. In most cases, simply use the one your hosting provider offers.
Where is my WordPress database stored?
Your WordPress database isn’t stored in a regular folder like images or theme files. Instead, it runs as a separate system managed by MySQL or MariaDB on your web server. You can find its connection details (DB_NAME, DB_USER, and DB_HOST) in your site’s wp-config.php file.
Can you restore a WordPress database from backup?
Yes. You can import your SQL backup file using phpMyAdmin, WP-CLI (wp db import), or the mysql command, as shown in the restore section above. Many backup plugins also offer one-click restores.
Final Words
This article has explored various methods to export WordPress database. We also have a guide on how to import a WordPress database; check it out!
Nevertheless, note that basic methods (like phpMyAdmin or plugins) mostly work for simple tasks, such as creating a backup before a WordPress update. More complex WordPress migrations, on the other hand, usually require a more robust solution. And that’s where LitExtension comes in!
With 15+ years of experience and over 300,000 successful migrations for 200,000+ customers in 100+ countries, our team understands clearly what it takes to perform a smooth, hassle-free transfer. We can’t wait to bring that same success to your store; let’s make your next migration a roaring success together!
For more information, check out our eCommerce guides.
