Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
On function _backup_db_to_file_mysqldump()
, 'nodata_tables' filter is completely ignored.
This makes the dump to big because it includes ALL tables, regardless of the settings you set.
I suggest replacing
// Ignore the excluded and no-data tables.
if (!empty($settings->filters['exclude_tables']) {
with
// Ignore the excluded and no-data tables.
if (!empty($settings->filters['exclude_tables']) || !empty($settings->filters['nodata_tables'])) {
Comment | File | Size | Author |
---|---|---|---|
#6 | cli_option_ignores_no_data_settings-2885094-06.patch | 876 bytes | pdcarto |
|
Comments
Comment #2
avergara CreditAttribution: avergara commentedComment #3
avergara CreditAttribution: avergara commentedComment #4
couturier CreditAttribution: couturier as a volunteer commentedPlease upgrade to the new 7.x-3.2 version and see if this resolves your issue.
Comment #5
couturier CreditAttribution: couturier as a volunteer commentedClosing after more than two weeks with no activity.
Comment #6
pdcarto CreditAttribution: pdcarto as a volunteer commentedThis remains a bug in 7.x-3.6. A quick look at
backup_migrate_source_db::_backup_db_to_file_mysqldump
inincludes/sources.db.mysql.inc
reveals the problem. It skips checking for$settings->filters['nodata_tables']
if no tables are excluded in$settings->filters['exclude_tables']
. This actually has been fixed inbackup_migrate_destination_db::_backup_db_to_file_mysqldump
(commit ccda7626fbd687de760e8459caa56dcc1fbdc8d3), but that is not the function that is used for exporting a backup.The attached patch replicates the code from
backup_migrate_destination_db::_backup_db_to_file_mysqldump
and fixes the issue.Comment #7
pdcarto CreditAttribution: pdcarto as a volunteer commentedComment #8
pdcarto CreditAttribution: pdcarto as a volunteer commented@DamienMcKenna - I'm unsure as to why six of the automated tests are failing. None of the failures, as far as I can tell, are due to the changes in this patch. I'm loathe to start mucking with uninvolved code, just to make the tests pass!
Comment #9
DamienMcKennaThanks for providing the patch for this issue, it's much appreciated.
We're trying to fix the tests in #3102506: Fix tests on 7.x-3.x branch.
Comment #11
DamienMcKennaCommitted. Thanks!