N.612 Backup files could not exceed 4Gb (technology limitation). The fix consists in archiving the backup as a tar.gz instead of a zip. As a consequence, installing iTop now requires TWO additional PHP modules: phar/zlib. The zip module remains mandatory because it is used in other places. The restore utility accepts both legacy zip files and brand new tar.gz files. DBBackup::CreateZip is deprecated in favor of DBBackup::CreateCompressedBackup. DBRestore::RestoreFromZip is deprecated in favor of DBRestore::RestoreFromCompressedFile (which autodetects the format for backward compatibility).

SVN:trunk[4803]
This commit is contained in:
Romain Quetiez
2017-07-06 15:26:03 +00:00
parent bc476295cb
commit e31fa066fc
9 changed files with 463 additions and 80 deletions

View File

@@ -1,5 +1,5 @@
<?php
// Copyright (C) 2010-2016 Combodo SARL
// Copyright (C) 2010-2017 Combodo SARL
//
// This file is part of iTop.
//
@@ -30,7 +30,7 @@ require_once(APPROOT.'setup/backup.class.inc.php');
* while displaying a progress bar, or in an unattended manner
* (for example from the command line), to run all the steps
* in one go.
* @copyright Copyright (C) 2010-2016 Combodo SARL
* @copyright Copyright (C) 2010-2017 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
@@ -172,7 +172,7 @@ class ApplicationInstaller
case 'backup':
$aPreinstall = $this->oParams->Get('preinstall');
// __DB__-%Y-%m-%d.zip
// __DB__-%Y-%m-%d
$sDestination = $aPreinstall['backup']['destination'];
$sSourceConfigFile = $aPreinstall['backup']['configuration_file'];
$aDBParams = $this->oParams->Get('database');
@@ -412,11 +412,11 @@ class ApplicationInstaller
return $sReport;
}
protected static function DoBackup($sDBServer, $sDBUser, $sDBPwd, $sDBName, $sDBPrefix, $sBackupFile, $sSourceConfigFile)
protected static function DoBackup($sDBServer, $sDBUser, $sDBPwd, $sDBName, $sDBPrefix, $sBackupFileFormat, $sSourceConfigFile)
{
$oBackup = new SetupDBBackup($sDBServer, $sDBUser, $sDBPwd, $sDBName, $sDBPrefix);
$sZipFile = $oBackup->MakeName($sBackupFile);
$oBackup->CreateZip($sZipFile, $sSourceConfigFile);
$sTargetFile = $oBackup->MakeName($sBackupFileFormat);
$oBackup->CreateCompressedBackup($sTargetFile, $sSourceConfigFile);
}