Following my previous question How to set Drush sql-sync not to clone users between @dev and @staging? I have manually preselected over 80 tables that should not be automatically synced (content, roles and permissions, users, temporary, cache). I am not fully satisfied with this solution. Why? Because my filter decisions is based on experience, intuition and guess when I would like to use the best practice method.
How to properly choose what tables to skip for drush sql-sync @dev @tst
and drush sql-sync @production @staging
?
My setup:
git.drupal.org ==> local drupal git repository ==> @dev -> @tst -> @staging -> @production (configuration, static content, roles and permissions)@staging <- @production (content, production scenarios to be tested)
The Definitive Guide to Drupal 7 by Benjamin Melançon and others says:
Here is the list of tables that appears in
example.drushrc.php
:$options['structure-tables'] = array( 'common' => array('cache', 'cache_filter', 'cache_menu', 'cache_page', 'history', 'sessions', 'watchdog'), );
You may need to add some more tables to this list. A good place to start would be to consider the list of tables that contain
cache
in their name viadrush sql-query 'show tables;' | grep cache
Remove from this list tables such as
imagecache_action
and so on, and add the remainder to your structure tables list.After you do an
sql-sync
with skipped tables, you will need to clear the cache on the target site to make sure that things work right.
What are the other tables to consider? Why?