Skip to content

Commit 4c65adb

Browse files
authored
Merge pull request #21 from wp-cli/clarify-bundled
Clarify this command as a bundled command
2 parents 6f96719 + 5f3ca9f commit 4c65adb

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

README.md

+20-3
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ Executes an arbitrary SQL query using `DB_HOST`, `DB_NAME`, `DB_USER`
227227
Exports the database to a file or to STDOUT.
228228

229229
~~~
230-
wp db export [<file>] [--<field>=<value>] [--tables=<tables>] [--porcelain]
230+
wp db export [<file>] [--<field>=<value>] [--tables=<tables>] [--exclude_tables=<tables>] [--porcelain]
231231
~~~
232232

233233
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
244244
[--tables=<tables>]
245245
The comma separated list of specific tables to export. Excluding this parameter will export all tables in the database.
246246

247+
[--exclude_tables=<tables>]
248+
The comma separated list of specific tables that should be skipped from exporting. Excluding this parameter will export all tables in the database.
249+
247250
[--porcelain]
248251
Output filename for the exported database.
249252

@@ -265,6 +268,18 @@ Runs `mysqldump` utility using `DB_HOST`, `DB_NAME`, `DB_USER` and
265268
$ wp db export --tables=$(wp db tables --all-tables-with-prefix --format=csv)
266269
Success: Exported to 'wordpress_dbase.sql'.
267270

271+
# Skip certain tables from the exported database
272+
$ wp db export --exclude_tables=wp_options,wp_users
273+
Success: Exported to 'wordpress_dbase.sql'.
274+
275+
# Skip all tables matching a wildcard from the exported database
276+
$ wp db export --exclude_tables=$(wp db tables 'wp_user*' --format=csv)
277+
Success: Exported to 'wordpress_dbase.sql'.
278+
279+
# Skip all tables matching prefix from the exported database
280+
$ wp db export --exclude_tables=$(wp db tables --all-tables-with-prefix --format=csv)
281+
Success: Exported to 'wordpress_dbase.sql'.
282+
268283

269284

270285
### wp db import
@@ -438,9 +453,11 @@ The size defaults to a human-readable number.
438453

439454
## Installing
440455

441-
Installing this package requires WP-CLI v0.23.0 or greater. Update to the latest stable release with `wp cli update`.
456+
This package is included with WP-CLI itself, no additional installation necessary.
457+
458+
To install the latest version of this package over what's included in WP-CLI, run:
442459

443-
Once you've done so, you can install this package with `wp package install wp-cli/db-command`.
460+
wp package install [email protected]:wp-cli/db-command.git
444461

445462
## Contributing
446463

composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"branch-alias": {
3131
"dev-master": "1.x-dev"
3232
},
33+
"bundled": true,
3334
"commands": [
3435
"db create",
3536
"db drop",

0 commit comments

Comments
 (0)