Для дампа с исключением данных из определенных таблиц нашел такую команду:
drush sql-dump --skip-tables-key=common
a
Но куда положить правильно файл drushrc.php и нужно ли указывать префиксы для таблиц если он используется?
Кидал по разным путям указаным в http://drush.ws/examples/example.drushrc.php
Все равно делает полный дамп игнорируя настройки.
Конфиг такой:
$options['structure-tables']['common'] = array(
'cache',
'cache_block',
'cache_bootstrap',
'cache_field',
'cache_filter',
'cache_form',
'cache_image',
'cache_menu',
'cache_page',
'cache_path',
'cache_token',
'cache_update',
'cache_views',
'cache_views_data',
'history',
'sessions',
'watchdog'
);
'cache',
'cache_block',
'cache_bootstrap',
'cache_field',
'cache_filter',
'cache_form',
'cache_image',
'cache_menu',
'cache_page',
'cache_path',
'cache_token',
'cache_update',
'cache_views',
'cache_views_data',
'history',
'sessions',
'watchdog'
);
Комментарии
Ответ в файле с примерами:
/**
* List of tables whose *data* is skipped by the 'sql-dump' and 'sql-sync'
* commands when the "--structure-tables-key=common" option is provided.
* You may add specific tables to the existing array or add a new element.
*/
# $options['structure-tables']['common'] = array('cache', 'cache_filter', 'cache_menu', 'cache_page', 'history', 'sessions', 'watchdog');
/**
* List of tables to be omitted entirely from SQL dumps made by the 'sql-dump'
* and 'sql-sync' commands when the "--skip-tables-key=common" option is
* provided on the command line. This is useful if your database contains
* non-Drupal tables used by some other application or during a migration for
* example. You may add new tables to the existing array or add a new element.
*/
# $options['skip-tables']['common'] = array('migration_data1', 'migration_data2');
drush sql-dump --structure-tables-key=common
спасибо. работает.
только почему-то надо указывать таблицы с префиксом (например 'ddd_cache' вместо 'cache'), иначе пишет что таблица не найдена.
это странно - веть настройки БД берутся их конфига сайта и там же префикс уже указан.