Lebih baik memangkas database besar pada dump dengan menggunakan drush sql-dumpuntuk membuang file SQL. Ini memberi Anda keuntungan untuk menentukan opsi tambahan untuk melewati tabel tertentu saat membuang (seperti cache atau migrasi tabel).
Ini dapat ditentukan di baris perintah (lihat :)drush help sql-dump atau konfigurasikan di file drushrc Anda seperti yang ditunjukkan pada example.drushrc.phpseperti:
$options['structure-tables']['common'] = array('cache', 'cache_*', 'history', 'search_*', 'sessions', 'watchdog');
$options['skip-tables']['common'] = array('migration_*');
atau per basis host seperti jika Anda menggunakan sql-syncatau di sql-dumpantara remote:
$aliases['global'] = array(
// These options will only be set if the alias is used with the specified command.
'command-specific' => array(
'sql-sync' => array(
'structure-tables-key' => 'common',
'skip-tables-key' => 'common',
'structure-tables' => array(
// You can add more tables which contain data to be ignored by the database dump
'common' => array('cache', 'cache_*', 'history', 'search_*', 'sessions', 'watchdog'),
),
'skip-tables' => array(
'common' =>array('migration_*'),
),
),
'sql-dump' => array(
'ordered-dump' => FALSE,
'structure-tables-key' => 'common',
'skip-tables-key' => 'common',
),
), // end: command-specific
);
Kemudian Anda dapat memuat pengaturan ini ke host Anda melalui:
$aliases['stage'] = array(
// ...
) + $aliases['global'];
Maka Anda dapat mencoba sesuatu seperti:
drush @source sql-dump | drush @self sql-cli
Untuk memantau progres, Anda dapat menambahkan penampil pipa ( pv) di antaranya (seperti ... | pv | ...).
Lihat juga: