wp db export <file>
Exports the database to a file or to STDOUT
Arguments
Name | Description |
---|
file | The name of the SQL file to export. If ‘-‘, then outputs to STDOUT. If omitted, it will be ‘{dbname}-{Y-m-d}-{random-hash}.sql’ |
Options
Name | Description |
---|
--dbuser <value> | Username to pass to mysqldump. Defaults to DB_USER |
--dbpass <value> | Password to pass to mysqldump. Defaults to DB_PASSWORD |
--field=value | Extra arguments to pass to mysqldump. Refer to mysqldump docs |
--tables <tables> | The comma separated list of specific tables to export. Excluding this parameter will export all tables in the database |
--exclude_tables <tables> | The comma separated list of specific tables that should be skipped from exporting. Excluding this parameter will export all tables in the database |
--include-tablespaces | Skips adding the default –no-tablespaces option to mysqldump |
--porcelain | Output filename for the exported database |
--defaults | Loads the environment’s MySQL option files. Default behavior is to skip loading them to avoid failures due to misconfiguration |