-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clarify this command as a bundled command
- Loading branch information
1 parent
6f96719
commit 5f3ca9f
Showing
2 changed files
with
21 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -227,7 +227,7 @@ Executes an arbitrary SQL query using `DB_HOST`, `DB_NAME`, `DB_USER` | |
Exports the database to a file or to STDOUT. | ||
|
||
~~~ | ||
wp db export [<file>] [--<field>=<value>] [--tables=<tables>] [--porcelain] | ||
wp db export [<file>] [--<field>=<value>] [--tables=<tables>] [--exclude_tables=<tables>] [--porcelain] | ||
~~~ | ||
|
||
Runs `mysqldump` utility using `DB_HOST`, `DB_NAME`, `DB_USER` and | ||
|
@@ -244,6 +244,9 @@ Runs `mysqldump` utility using `DB_HOST`, `DB_NAME`, `DB_USER` and | |
[--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. | ||
|
||
[--porcelain] | ||
Output filename for the exported database. | ||
|
||
|
@@ -265,6 +268,18 @@ Runs `mysqldump` utility using `DB_HOST`, `DB_NAME`, `DB_USER` and | |
$ wp db export --tables=$(wp db tables --all-tables-with-prefix --format=csv) | ||
Success: Exported to 'wordpress_dbase.sql'. | ||
|
||
# Skip certain tables from the exported database | ||
$ wp db export --exclude_tables=wp_options,wp_users | ||
Success: Exported to 'wordpress_dbase.sql'. | ||
|
||
# Skip all tables matching a wildcard from the exported database | ||
$ wp db export --exclude_tables=$(wp db tables 'wp_user*' --format=csv) | ||
Success: Exported to 'wordpress_dbase.sql'. | ||
|
||
# Skip all tables matching prefix from the exported database | ||
$ wp db export --exclude_tables=$(wp db tables --all-tables-with-prefix --format=csv) | ||
Success: Exported to 'wordpress_dbase.sql'. | ||
|
||
|
||
|
||
### wp db import | ||
|
@@ -438,9 +453,11 @@ The size defaults to a human-readable number. | |
|
||
## Installing | ||
|
||
Installing this package requires WP-CLI v0.23.0 or greater. Update to the latest stable release with `wp cli update`. | ||
This package is included with WP-CLI itself, no additional installation necessary. | ||
|
||
To install the latest version of this package over what's included in WP-CLI, run: | ||
|
||
Once you've done so, you can install this package with `wp package install wp-cli/db-command`. | ||
wp package install [email protected]:wp-cli/db-command.git | ||
|
||
## Contributing | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ | |
"branch-alias": { | ||
"dev-master": "1.x-dev" | ||
}, | ||
"bundled": true, | ||
"commands": [ | ||
"db create", | ||
"db drop", | ||
|