-
Notifications
You must be signed in to change notification settings - Fork 68
Description
I see wp db export uses mysqldump. I'd like to be able to pass a --where argument to the mysqldump's where option. The would allow for a selective data dumps. Examples of how I think it should work.
Export selective posts
wp db export --tables=wp_posts --where="ID in (100,101,102)" --no-create-info
Export relating meta for selective posts
wp db export --tables=wp_postmeta --where="post_id in (100,101,102)" --no-create-info
For reference the following mysqldump does work.
mysqldump -u$(wp config get DB_USER) -p$(wp config get DB_PASSWORD) $(wp config get DB_NAME) --no-create-info --tables wp_posts --where="ID in (100,101,102)"
mysqldump -u$(wp config get DB_USER) -p$(wp config get DB_PASSWORD) $(wp config get DB_NAME) --no-create-info --tables wp_postmeta --where="post_id in (100,101,102)"