Jojodae Ganesh Sivaji
May 2, 2014
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 the 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 Command.
Quick Google Search led me to the Drush project issue in drupal.org, 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,
<?php
$options['structure-tables'] = array(
'common' => array(
'cache',
'cache_block',
'cache_filter',
'cache_form',
'cache_menu',
'cache_page',
'cache_update',
'history',
'watchdog',
'simplenews_subscription',
'simplenews_subscriber',
'customtable_1',
'customtable_2'
),
);
$options['structure-tables-key'] = 'common';
?>
Once done, for all sql-dump and sql-sync commands you would issue, the above tables will be skipped.
Note:
Hope this will help.
Just like how your fellow techies do.
We'd love to talk about how we can work together
Take control of your AWS cloud costs that enables you to grow!