Title: vip export sql
Published: November 5, 2026

---

 1. [VIP-CLI command reference](https://docs.wpvip.com/vip-cli/commands/)
 2. [vip export](https://docs.wpvip.com/vip-cli/commands/export/)
 3. vip export sql

#  vip export sql

Generate a copy of a database backup for an environment and download it as an archived
SQL file.

## Usage

    ```wp-block-preformatted
    vip export sql [options]
    ```

## Options

| Option | Description | 
|  `-a`, `--app [value]` |  Target an application. Accepts a string value for the application name or an integer for the application ID. |  
|  `-e`, `--env [value]` |  Target an environment. Accepts a string value for the environment type. |  
|  `-h`, `--help` |  Retrieve a description, examples, and available options for a (sub)command. (default: false) |  
|  `-v`, `--version` |  Retrieve the version number of VIP-CLI currently installed on the local machine. (default: false) |  
|  `-d`, `--debug [value]` |  Generate verbose output during command execution to help identify or fix errors or bugs. |  
|  `-o`, `--output [value]` |  Download the file to a specific local directory path with a custom file name. |  
|  `-t`, `--table [value]` |  The name of a table to include in the partial database export. Accepts a string value and can be passed more than once with a different value, or add multiple values in a comma-separated list. |  
|  `-s`, `--site-id [value]` |  The ID of a network site to include in the partial database export. Accepts an integer value and can be passed more than once with a different value, or add multiple values in a comma-separated list. |  
|  `-w`, `--wpcli-command [value]` |  Run a custom WP-CLI command that has logic to retrieve specific data for the partial database export. |  
|  `-c`, `--config-file [value]` |  A local configuration file that specifies the data to include in the partial database export. Accepts a relative or absolute path to the file. |  
|  `-g`, `--generate-backup [value]` |  Generate a fresh database backup and export an archived copy of that backup. |  
|  `--skip-download [value]` |  Skip downloading the file. |

## Examples

    ```wp-block-preformatted
    - Download an archived copy of the most recent database backup for an environment to the current local directory.$ vip @example-app.develop export sql- Download an archived copy of the most recent database backup for an environment to a specific file path.$ vip @example-app.develop export sql --output=~/Desktop/export.sql.gz- Generate a fresh database backup for an environment and download an archived copy of that backup.$ vip @example-app.develop export sql --generate-backup- Skip downloading the database backup file.$ vip @example-app.develop export sql --skip-download- Generate and download an archived partial database export file that includes only the wp_posts and wp_comments tables.$ vip @example-app.develop export sql --table=wp_posts --table=wp_comments- Use comma-separated syntax to generate and download a partial database export file that includes only the wp_posts and wp_comments tables.$ vip @example-app.develop export sql --table=wp_posts,wp_comments- Generate and download a partial database export file that includes only the tables related to network site ID 2 and network site ID 3.$ vip @example-app.develop export sql --site-id=2 --site-id=3- Use comma-separated syntax to generate and download a partial database export file that includes only the tables related to the network site ID 2 and network site ID 3.$ vip @example-app.develop export sql --site-id=2,3- Reference a local configuration file that specifies the data to include in the partial database export file that is generated and dowloaded.$ vip @example-app.develop export sql --config-file=~/db-export-config.json
    ```

Last updated: November 05, 2026