MDL-41838 Backup/restore: Support .tar.gz format for .mbz (2 of 2)

The new experimental setting enabletgzbackups allows backups to be
created so that the internal format for .mbz files is .tar.gz.

Restore transparently supports .mbz files with either internal
formats (.zip or .tar.gz).

The .tar.gz format has the following benefits for backup:
- Supports larger files (no limit on total size, 8GB on single file
  vs. 4GB limit on total size)
- Compresses text better, resulting in smaller .mbz files.
- Reports progress regularly during compression of single files,
  reducing the chance of timeouts during backups that include a
  very large file.

Time performance may also be improved although I haven't done a
direct comparison.
This commit is contained in:
sam marshall 2013-09-24 18:14:09 +01:00
parent c858655dde
commit 39e5102f8b
8 changed files with 281 additions and 4 deletions

View file

@ -1704,7 +1704,7 @@ class backup_zip_contents extends backup_execution_step implements file_progress
$zipfile = $basepath . '/backup.mbz';
// Get the zip packer
$zippacker = get_file_packer('application/zip');
$zippacker = get_file_packer('application/vnd.moodle.backup');
// Zip files
$zippacker->archive_to_pathname($files, $zipfile, true, $this);