WP-CLI Command – Export Subcommand
wp migratedb export <output-file> [--find=<strings>] [--replace=<strings>] [--include-tables=<tables>] [--exclude-post-types=<post-types>] [--skip-replace-guids] [--exclude-spam] [--gzip-file] [--include-transients] [--subsite=<blog-id|subsite-url>] [--prefix=<new-table-prefix>]
Export your local DB to a file.
<output-file> A file path to export to. Filename will be modified to end in .sql or .sql.gz if necessary. [--find=<strings>] A comma separated list of strings to find when performing a string find and replace across the database. Table names should be quoted as needed, i.e. when using a comma in the find/replace string. The --replace=<strings> argument should be used in conjunction to specify the replace values for the strings found using this argument. The number of strings specified in this argument should match the number passed into --replace=<strings> argument. [--replace=<strings>] A comma separated list of replace value strings to implement when performing a string find & replace across the database. Should be used in conjunction with the --find=<strings> argument, see it's documentation for further explanation of the find & replace functionality. [--exclude-post-revisions] Exclude post revisions from export. Available only in WP Migrate DB. [--skip-replace-guids] Do not perform a find & replace on the guid column in the wp_posts table. [--exclude-spam] Exclude spam comments. [--gzip-file] GZip compress export file. [--include-transients] Include transients (temporary cached data).
WP Migrate DB Pro Options
When running WP Migrate DB Pro the following option replaces the
--exclude-post-revisions option in WP Migrate DB.
[--exclude-post-types=<post-types>] A comma separated list of post types to exclude. Excluding this parameter will migrate all post types.
The following option is only available in WP Migrate DB Pro.
[--include-tables=<tables>] The comma separated list of tables to migrate. Excluding this parameter will migrate all tables in your database that begin with your installation's table prefix, e.g. wp_.
Multisite Tools Addon Options
When the Multisite Tools addon is installed and activated, you also have the following options.
[--subsite=<blog-id|subsite-url>] Export the given subsite as a single site install. [--prefix=<new-table-prefix>] A new table prefix to be used for a subsite export.