Hello there and thanks for your work,
but my backup file doesn't get compressed when backing up the "entire site" or "public files". "DB only" is working.
Only a tar file gets created. Even if i select "use cli commands". Offsite and onsite backup is affected. The site isnt getting out of maintenance mode if backing up via entire site.

Running kickstart 2.20 (D7.34) and B&M3.0
BTW: the archive of "public files" has no namepart like "sitearchive" or "mysql" in it.

Comments

Anonymous’s picture

Title: Compression not running (only when entire site) » Compression not running (only when backing up entire site)
Issue summary: View changes
Anonymous’s picture

Issue summary: View changes
Anonymous’s picture

I also tried the latest dev (7.x-3.0+10-dev) with no difference.
Setting up a second cron with a source for the files manually works as expected.

greggmarshall’s picture

I am seeing the same issue. Whether I select gzip or zip, I get a .tar file. I opened the file in 7zip (Windows enviornment) and it is showing as an uncompressed tar archive, so it isn't just a file naming issue. Compressing the file to .gz reduces the file size about 30%.

cozzamara’s picture

Same Issue...

interdruper’s picture

After some research, I found where is the problem; 'Full site backup' option is composed by the backup of the files and the backup of the database. The database is always backed up without compression, this is hardcoded, and this option overwrites any compression option for the files.

The issue is fixed with the following modification at line 167 of \includes\sources.archivesource.inc, but probably this is not the best place to fix it...

The pair of added lines are marked:

  /**
   * Get a database dump to add to the archive.
   */
  function get_db() {
    backup_migrate_include('destinations', 'files', 'filters', 'profiles');

    $file = new backup_file();
    $settings = _backup_migrate_profile_saved_default_profile();
    $settings->source_id = 'db';
/**/$compression = $settings->filters['compression'];
    $settings->filters['compression'] = 'none';
    $file = backup_migrate_filters_backup($file, $settings);
/**/$settings->filters['compression'] = $compression;

    // Generate a tmp file with the correct final title (because ArchiveTar doesn't seem to allow renaming).
    $tmpdir = backup_migrate_temp_directory();1
    $filepath = $tmpdir . '/database.sql';
    rename($file->filepath(), $filepath);

    return $filepath;
  }
interdruper’s picture

Status: Active » Needs work
nicorac’s picture

@interdruper: thanks for posting it.
This is just to confirm that your patch works great on my websites, even if not so "elegant" ;)

Compression is an important feature, hope some devel will review it and commit.

ronan’s picture

Status: Needs work » Fixed

I think I've figured this out. Fixed in dev.

  • ronan committed 32bb0aa on 7.x-3.x
    Issue #2393615: Compression not running (only when backing up entire...
manyk’s picture

Great ronan. That is exactly what I wanted to say yesterday. But you already took care of it.

Thanks.

Status: Fixed » Closed (fixed)

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