Skip to content

Commit

Permalink
Merge pull request #21 from wp-cli/clarify-bundled
Browse files Browse the repository at this point in the history
Clarify this command as a bundled command
  • Loading branch information
schlessera authored May 30, 2017
2 parents 6f96719 + 5f3ca9f commit 4c65adb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"branch-alias": {
"dev-master": "1.x-dev"
},
"bundled": true,
"commands": [
"db create",
"db drop",
Expand Down

0 comments on commit 4c65adb

Please sign in to comment.