Skip to main content
sql dump and sync

Drush sql-dump and sql-sync - skip specific tables

At KnackForge we use Drush more often as a part of Drupal development projects. As Drupal developers, we frequently feel the need for getting the most recent database dump from live site. When I did this recently, it was relatively a big site, thought it would be nice to skip a few tables that are not essential. At least to avoid unnecessary time spent on I/O operations. This is one of the few things that I have least tried with Drush.

Quick Google Search led me to Drush project issue in, mostly outdated posts. Had to connect the dots found here and there to get eventually what I needed, hence writing this blog post.

To skip specific tables when using drush sql-dump and sql-sync, in drushrc.php need to have the below code in place,

['structure-tables'] = array(
'common' => array(

$options['structure-tables-key'] = 'common';

Once done, for all sql-dump and sql-sync commands you would issue, the above tables will be skipped.


  1. Beware if any of the above table is not found in your Drupal database the command will fail to complete successfully
  2. To have skip list per site, you can place drushrc.php in sites/default/ folder.

Hope this will help.


Diane (not verified)

Thu, 05/08/2014 - 17:33

Thanks for sharing this. May I ask.. do you have Drupal hooked up to a MS SQL database, or is this for MySQL? Thanks again!

Yogev (not verified)

Thu, 03/26/2015 - 04:22

I can't make it work.
Tables still coming - just making sure - drushrc file is on dev machine?