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'])) {
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

avergara created an issue. See original summary.

avergara’s picture

Issue summary: View changes
avergara’s picture

Issue summary: View changes
couturier’s picture

Status: Active » Postponed (maintainer needs more info)

Please upgrade to the new 7.x-3.2 version and see if this resolves your issue.

couturier’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

Closing after more than two weeks with no activity.

pdcarto’s picture

This remains a bug in 7.x-3.6. A quick look at backup_migrate_source_db::_backup_db_to_file_mysqldump in includes/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 in backup_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.

pdcarto’s picture

Status: Closed (outdated) » Needs review
pdcarto’s picture

@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!

DamienMcKenna’s picture

Thanks 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.

  • DamienMcKenna committed bb48983 on 7.x-3.x authored by pdcarto
    Issue #2885094 by pdcarto, avergara, couturier: CLI option dumps the...
DamienMcKenna’s picture

Status: Needs review » Fixed
Parent issue: » #3020775: Plan for Backup and Migrate 7.x-3.7

Committed. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.