15

I'm aware of mysqldump utility, but is there any way of dumping a single table from database using drush (e.g. for sql-dump, sql-sync)?

1 Answer 1

40

You can use --tables-list option on drush command to dump specific tables.

drush sql-dump --tables-list=node,system > exportdb.sql

Above command will only make sql-dump for node and system tables.

Source

3
  • 2
    First of all "--table-list" is unknown option. Actually "-tables-list" is used. Second thing that correct option "--tables-list" is not working on Windows machine and full DB dump will be created instead. Commented Jan 26, 2015 at 17:11
  • Tested drush sql-dump --tables-list=rules_config --ordered-dump on Drush 8.1-dev, it seems to work fine.
    – kenorb
    Commented Apr 4, 2016 at 16:38
  • Full DB dump will be created if the table in tables-list doesn't exitsts (may due misspeling or not adding prefix) - github.com/drush-ops/drush/issues/3708 . Commented Jan 23, 2021 at 9:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.