Skip to content

Partial Database Exports

Partial Database Exports allow a custom set of data to be exported from the current state of a VIP Platform environment’s database.

To generate and download a Partial Database Export file to a user’s local machine use the VIP-CLI command: vip export sql [options]. Command options allow specific tables to be included in the exported file. The VIP-CLI command vip export sql can also reference a custom WP-CLI command or a reference a JSON-formatted configuration file to retrieve a more specific set of data from the database for export.

Prerequisites

Export tables by name

The name of one or more tables can be passed with the command option --table=<table_name> to include only those tables in the Partial Database Export file.

In this example, only the wp_posts table will be included in the Partial Database Export:

vip @example-app.develop export sql --table=wp_posts

To export more than one table to the same file, pass the --table option more than once in the same command for each requested table.

In this example, only the wp_3_posts table and the wp_5_comments table from the database of a WordPress multisite environment will be included in the Partial Database Export:

vip @example-app.develop export sql --table=wp_3_posts --table=wp_5_comments

Alternatively, multiple table names can be passed as a comma-separated list (no spaces between values):

vip @example-app.develop export sql --table=wp_3_posts,wp_5_comments

For WordPress multisite environments, the ID of one or more network sites can be passed in the VIP-CLI command to export all tables related to those sites.

Note

The multisite global tables of the network database (e.g., wp_blogswp_users) belong to the main site (ID 1). If the exported tables for a network site are imported to a different environment, the tables for the main site must also be exported and imported in order for the site to work as expected.

The ID of one or more network sites can be passed with the command option --site-id=<site_id> to include only the tables related to that site in the Partial Database Export file.

In this example, only the tables related to site ID 7 will be included in the Partial Database Export:

vip @example-app.develop export sql --site-id=7

To export more than the tables for more than one site to the same file, pass the --site-id option more than once in the same command for each requested site.

In this example, only the tables related to site ID 7 and site ID 11 will be included in the Partial Database Export:

vip @example-app.develop export sql --site-id=7 --site-id=11

Alternatively, multiple network site IDs can be passed as a comma-separated list (no spaces between values):

vip @example-app.develop export sql --site-id=7,11

Last updated: December 29, 2025

Relevant to

  • WordPress