mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
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:
parent
c858655dde
commit
39e5102f8b
8 changed files with 281 additions and 4 deletions
|
@ -243,7 +243,8 @@ abstract class backup_general_helper extends backup_helper {
|
|||
// Extract moodle_backup.xml.
|
||||
$tmpname = 'info_from_mbz_' . time() . '_' . random_string(4);
|
||||
$tmpdir = $CFG->tempdir . '/backup/' . $tmpname;
|
||||
$fp = get_file_packer('application/vnd.moodle.backup');
|
||||
$packer = get_file_packer('application/vnd.moodle.backup');
|
||||
|
||||
$extracted = $fp->extract_to_pathname($filepath, $tmpdir, array('moodle_backup.xml'));
|
||||
$moodlefile = $tmpdir . '/' . 'moodle_backup.xml';
|
||||
if (!$extracted || !is_readable($moodlefile)) {
|
||||
|
|
|
@ -212,7 +212,7 @@ class restore_ui_stage_confirm extends restore_ui_independent_stage implements f
|
|||
|
||||
$this->filepath = restore_controller::get_tempdir_name($this->contextid, $USER->id);
|
||||
|
||||
$fb = get_file_packer();
|
||||
$fb = get_file_packer('application/vnd.moodle.backup');
|
||||
$result = $fb->extract_to_pathname("$CFG->tempdir/backup/".$this->filename,
|
||||
"$CFG->tempdir/backup/$this->filepath/", null, $this);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue