October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Export a WordPress Database Step by Step

Learn how to export a WordPress database using phpMyAdmin, WP-CLI, or mysqldump, what the SQL file includes, and why themes, plugins, uploads, and wp-config.php need separate backups.
Length9 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To export a complete WordPress database, save an SQL dump from phpMyAdmin, WP-CLI, or the MySQL/MariaDB command line. The SQL file contains database records such as posts, pages, comments, users, and settings, but it does not contain themes, plugins, uploads, or wp-config.php. Back up those files separately and keep both parts together.

For most site owners, phpMyAdmin is the simplest one-time method. WP-CLI or mysqldump is more dependable for large databases and easier to repeat. The steps below show each method, explain the difference between a database dump and a WordPress content export, and cover what the file can—and cannot—restore.

As an Amazon Associate I earn from qualifying purchases.

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

What a WordPress database export contains

A WordPress database export is a SQL dump of the database used by the site. It preserves database-held information, including:

  • Posts and pages
  • Comments
  • Users and user metadata
  • Categories, tags, and other taxonomy terms
  • Site settings and plugin settings that are stored in the database
  • Attachment records and references to media files

The export is not a complete copy of the WordPress installation. It excludes the files that make up the site itself:

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.
  • Theme files
  • Plugin files
  • Uploaded images, videos, documents, and other media
  • wp-config.php
  • Other files in the WordPress directory

Those files need a separate file backup. A usable disaster-recovery set therefore contains the SQL dump plus a copy of the WordPress files. The WordPress Advanced Administration Handbook strongly recommends backing up the database regularly and before an upgrade.

“It is strongly recommended that you backup your database at regular intervals and before an upgrade.”

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

WordPress.org Advanced Administration Handbook

Choose the right export method

The best method depends on the access you have and the size of the database. The following comparison uses the four workflows relevant to WordPress backups.

Method Access required Best use Output Repeatability
phpMyAdmin Web hosting control panel or server access Convenient manual exports SQL database dump Manual download
WP-CLI SSH or another shell with the WordPress installation available Large sites and repeatable exports SQL database dump Scriptable command
mysqldump Shell access and MySQL or MariaDB credentials Large databases when phpMyAdmin is impractical SQL database dump, optionally gzip-compressed Scriptable command
wp export WP-CLI Moving selected WordPress content WXR content file Scriptable command
WordPress.com backup download Access to the site’s available backup tools Advanced WordPress.com administration Database copy when provided by the site’s backups Depends on the available backup feature

Use phpMyAdmin when you want a visual, one-off download and the database is a manageable size. Use WP-CLI or mysqldump when the database is large, phpMyAdmin cannot complete the export, or you need a command you can run repeatedly. Use wp export only when you need a content-transfer file rather than a full database backup.

Prepare before exporting

1. Confirm which database belongs to the site

Open the site’s wp-config.php file and find the value assigned to DB_NAME. That is the database you must select in phpMyAdmin or pass to mysqldump. A hosting account can contain several databases, so do not select one by guesswork.

2. Confirm where the export will be saved

Choose a private location on your computer or server with enough free space for the dump. After a command-line export, note the exact path and filename. Never leave a database dump in a publicly served web directory: anyone who can download it may obtain site content and configuration data.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed

3. Decide whether you need a full SQL dump

A full SQL dump is the normal choice for backup and restoration. A selective export is appropriate only when you deliberately want particular tables or a content-only transfer. If your goal is to rebuild the whole site, do not substitute a WXR file for the SQL backup.

4. Choose a method that matches the database size

phpMyAdmin is convenient, but browser-based exports can be difficult for very large databases. The handbook recommends direct MySQL or MariaDB commands when phpMyAdmin cannot handle the database. WP-CLI and mysqldump keep the work in the shell and can be repeated without navigating a web interface.

Method 1: Export with phpMyAdmin

phpMyAdmin provides the simplest visual workflow when it is available through your hosting panel or server.

  1. Sign in to phpMyAdmin. Open it from your hosting control panel or server administration interface.
  2. Select the WordPress database. In the left-hand pane, choose the database whose name matches DB_NAME in wp-config.php.
  3. Open the Export tab. With the database selected, click Export in the main pane.
  4. Keep Quick selected for a normal full export. The Quick option uses the default settings to export the selected database.
  5. Start the export. Click Go.
  6. Save the downloaded SQL file. Store it outside the public website directory and use a filename that identifies the site and date.

The resulting file is the database dump. Keep it with the corresponding copy of the WordPress files so the two can be restored as one backup set.

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

When to use phpMyAdmin’s Custom option

Select Custom instead of Quick when you need to change the export behavior. Custom export lets you alter the table selection, compression, and other export settings. It is useful when:

  • You need only specific tables.
  • You want to omit selected tables.
  • You need compressed output to reduce the download size.
  • You must adjust export options for a particular restoration environment.

For an ordinary full backup, Quick is less error-prone because it includes the selected database without requiring you to make table-by-table decisions. Custom is powerful, but verify every table choice before starting the download.

Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

phpMyAdmin problems and fixes

  • The expected database is not listed: check the hosting account and compare every database name with DB_NAME in wp-config.php. If the account does not grant access, ask the host to provide database access.
  • The browser times out or the download stops: treat the database as too large for a reliable browser export and use WP-CLI or mysqldump through shell access instead.
  • The wrong content appears after restoration: recheck the selected database against DB_NAME. Exporting a different database creates a valid SQL file that belongs to another site or installation.

Method 2: Export with WP-CLI

WP-CLI reads the database credentials from wp-config.php and uses mysqldump to create the dump. Run the command from the WordPress installation directory:

wp db export backup.sql
  1. Open a shell session with access to the server and the WordPress files.
  2. Change to the WordPress installation directory. This is the directory containing wp-config.php.
  3. Run the export command: wp db export backup.sql.
  4. Confirm the file was created. Inspect the file and record its location before moving it off the server. A shell listing such as ls -lh backup.sql shows whether the file exists and its size.
  5. Move the dump to protected storage. Do not keep it in a web-served directory.

wp db dump backup.sql is an alias for the same export operation. Both commands create an SQL database dump using the credentials that WP-CLI loads from wp-config.php.

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

Export only selected tables

WP-CLI accepts valid mysqldump flags. To restrict the export to named tables, use:

wp db export backup.sql --tables=table1,table2

To omit selected tables, use:

wp db export backup.sql --exclude_tables=table1,table2

Replace the example table names with the actual tables you intend to include or exclude. Selective exports are not interchangeable with a complete backup: omitting a table can leave the restored site without data that a plugin or WordPress core expects.

Why WP-CLI is useful for repeatable backups

The command has a fixed filename, uses the site’s existing database configuration, and runs without a browser session. That makes it practical for a documented backup procedure or a script that an administrator runs at regular intervals. You still need to copy the resulting file away from the server and protect it like any other database backup.

WP-CLI failure checks

  • Database connection errors: verify that the command is running in the correct WordPress directory and that wp-config.php contains the current database host, name, user, and password values.
  • Permission errors while writing: choose an output path where the shell user can create files, then move the completed dump to secure storage.
  • A surprisingly small file: inspect the filename and size, and confirm that you exported the intended database rather than a selective table set.

Method 3: Export with mysqldump or MariaDB

Direct command-line export is useful when you have shell access and phpMyAdmin cannot handle the database. The handbook gives this pattern:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC
mysqldump --add-drop-table -h DB_HOST -u DB_USER -p DB_NAME > wordpress-backup.sql
  1. Replace DB_HOST with the database host.
  2. Replace DB_USER with the database username.
  3. Replace DB_NAME with the database name shown by DB_NAME in wp-config.php.
  4. Run the command and enter the database password when prompted.
  5. Check that wordpress-backup.sql exists, note its path, and move it to protected storage.

The --add-drop-table option places drop-table statements in the dump. That can help replace existing tables during an import, but the import process must still be planned carefully because dropping tables removes the current contents before the replacement data is loaded.

Compress a large dump while exporting

For a large database, pipe the SQL output through gzip:

mysqldump --add-drop-table -h DB_HOST -u DB_USER -p DB_NAME | gzip > wordpress-backup.sql.gz

Enter the password when prompted. The result is a gzip-compressed SQL dump. Keep the .gz extension so you know it must be decompressed before using an import process that expects plain SQL.

When direct mysqldump is preferable

  • The database is large enough that a browser request is unreliable.
  • You already have SSH access and database credentials.
  • You want a command that can be documented or repeated.
  • You need compression during export.

Do not confuse a database dump with a WXR export

WP-CLI has two commands that sound similar but produce different kinds of files:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Command Format Includes Does not include Purpose
wp db export SQL Database tables and the data stored in them WordPress files such as themes, plugins, uploads, and wp-config.php Database backup and database restoration
wp export WXR Authors, terms, posts, comments, and attachment references Site configuration and the attachment files themselves Content transfer between WordPress installations

A WXR file is useful for moving content into another WordPress site, but it is not a complete database backup. It does not preserve the site’s full configuration, and its attachment references do not carry the image or document files. Choose wp db export when you need a restorable SQL copy of the database.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Verify and protect the exported file

Confirm the file and its location

After any export, verify that the expected filename exists and record the path. For command-line exports, inspect the file size with a shell listing. For phpMyAdmin, confirm that the browser saved the download where you intended. A missing file is not a backup, even if the export process appeared to finish.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.

Keep the database and files together

Store the SQL dump with the matching WordPress file backup. The database contains references to uploads and the settings that make the installation work; the files contain the themes, plugins, media, and configuration file that the SQL dump cannot provide. Label both parts with the same site and backup date so they are not accidentally mixed with another installation.

Prevent public exposure

Never leave an SQL or compressed SQL dump in a publicly served web directory. Download it to private storage or move it outside the document root immediately after creating it. Treat the dump as sensitive site data.

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

What restoration requires

Restoring a database export means importing the SQL into MySQL or MariaDB and pairing it with the corresponding WordPress files. The SQL file alone cannot restore themes, plugins, uploads, or wp-config.php. If those files are missing, the database may contain the posts and settings while the site remains incomplete or unusable.

Before replacing a live database, preserve the current database and files as another backup. Confirm that the SQL dump belongs to the site you are restoring, identify whether it is plain SQL or gzip-compressed SQL, and make sure the destination uses compatible MySQL or MariaDB access. A WXR file follows a content-import workflow instead; it is not a substitute for importing the SQL dump when the objective is full database restoration.

WordPress.com considerations

On WordPress.com, database access is treated as an advanced task. WordPress.com documents phpMyAdmin and WP-CLI access for eligible sites and notes that a database copy may be downloadable from the site’s available backups. The exact options depend on the site’s plan and the backup tools shown in its administration area. Use the database-copy download when it is provided, and keep it with the site’s separate file backup if you are preparing a complete recovery set.

A practical decision checklist

  • Need a quick, visual export? Select the database in phpMyAdmin, open Export, leave Quick selected, click Go, and save the SQL file.
  • Have SSH and want a repeatable command? Run wp db export backup.sql from the WordPress directory.
  • Have a very large database or a phpMyAdmin timeout? Use the mysqldump command, optionally piping the output through gzip.
  • Need only posts and related content for a move? Use wp export, remembering that WXR omits configuration and the actual attachment files.
  • Need a complete backup? Keep the SQL dump and a separate copy of themes, plugins, uploads, wp-config.php, and the remaining WordPress files together.

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.

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

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.