Title: Export a SQL file from a site not hosted at WordPress VIP
Author: WordPress VIP Documentation
Published: August 31, 2023
Last modified: December 29, 2025

---

 1. [Databases](https://docs.wpvip.com/databases/)
 2. Export a SQL file from a site not hosted at WordPress VIP

#  Export a SQL file from a site not hosted at WordPress VIP

To migrate the content of a WordPress site to an environment on the WordPress VIP
Platform, a SQL database file must be exported from the non-VIP site. Not all of
the methods described on this page are available on all hosting platforms. Refer
to the documentation for the existing site’s hosting platform to identify which 
methods are available and access more information on how to use them.

Some methods described on this page can be used to export SQL database files from
a WordPress site currently running on a [VIP Local Development Environment](https://docs.wpvip.com/vip-local-development-environment/).

## Database export plugins

Third-party plugins that are designed to export WordPress database content can be
installed on a non-WPVIP site or on a [VIP Local Development Environment](https://docs.wpvip.com/vip-local-development-environment/)
in order to migrate the content. Find a database export plugin that best matches
a customer’s criteria by reviewing available options in [WordPress.org’s Plugins library](https://wordpress.org/plugins/).

## Database exports in the command line

In some cases, the database of a WordPress site can be exported by running a `mysqldump`
command in a command line interface. This command example demonstrates a `mysqldump`
command formatted to output a database file that is most likely to be suitable for
import to a WPVIP Platform environment:

    ```wp-block-preformatted
    mysqldump --add-drop-table --hex-blob --no-create-db --quote-names -h dbhost -u user -p dbname --default-character-set=utf8mb4 --result-file=dbname-full.sql
    ```

## Database exports with WP-CLI

When available, the `wp db export` WP-CLI command can be export all or some of a
WordPress site’s database tables. Refer to [the WordPress Developer Resources for WP-CLI for usage examples and options for the `wp db export` command](https://developer.wordpress.org/cli/commands/db/export/).

### VIP Local Development Environment

To run `wp db export` on a WordPress sites currently running on a VIP Local Development
Environment, use [the `vip dev-env exec` VIP-CLI command](https://docs.wpvip.com/vip-cli/commands/dev-env/exec/).

In this example command, the database file of a local environment with the `--slug`
value of `example-site` is exported to the user’s Desktop directory with the file
name `example-export.sql`. The `-q` option is included to suppress informational
messages from being output and subsequently included in the exported file. The `-
>` operator is directing the output to `STDOUT` and writing the file to a location
that is easily retrievable by the user.

    ```wp-block-preformatted
    vip dev-env exec --slug=example-site -q -- wp db export - > /Users/example-user/Desktop/example-export.sql
    ```

## Database exports from phpMyAdmin

It is possible to [use phpMyAdmin to export a database file from a WordPress site](https://docs.phpmyadmin.net/en/latest/import_export.html#export)
that is suitable for import to a WPVIP Platform environment. However **this option
should be taken with great caution.**

Exports from phpMyAdmin are highly configurable and some settings might include 
SQL statements that are not compatible with WPVIP’s import tooling (e.g., `CREATE
DATABASE IF NOT EXISTS`, `USE`, `ALTER USER`, or `SET PASSWORD`).

To produce a compatible database export using phpMyAdmin:

 1. Navigate to the “**Export**” tab
 2. Select “**Custom**” under “**Export method**” to display all possible options
 3. Find the “**Format-specific options**” area
 4. Select the following options under “**Object creation options**”:
 5.  * Add `DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT / TRIGGER` statement
     * `IF NOT EXISTS`
     * `AUTO_INCREMENT` value
 6. When ready, select “**Export**” at the end of the page

Before importing a database file that was exported with phpMyAdmin to a WPVIP Platform
environment, use VIP-CLI to [validate that the SQL database file is compatible](https://docs.wpvip.com/validate-sql-file/).

### VIP Local Development Environment

[phpMyAdmin is an optional stack service](https://docs.wpvip.com/vip-local-development-environment/stack-services/#phpMyAdmin)
that can be enabled on a VIP Local Development Environment. Enable phpMyAdmin for
a local environment by passing `-p=y` or `--phpmyadmin=y` with the `[vip dev-env create](https://docs.wpvip.com/vip-cli/commands/dev-env/create/)`
or `[vip dev-env update](https://docs.wpvip.com/vip-cli/commands/dev-env/update/)`
commands. Once enabled, the web URL for phpMyAdmin can be retrieved by running `
[vip dev-env info](https://docs.wpvip.com/vip-cli/commands/dev-env/info/)` against
the running environment.

Last updated: December 29, 2025