I've added a bit of code into mysqlbackup.php to compress the resultant SQL file with gzip. My database is about 35MB, and it's making it 5MB.
If you want to do the same, here is what to do. Please note, though, that this will only work if you have chosen to combine all data into one SQL file and not split each table into its own file.
File: ./includes/mysqlbackup.php
FIND (lines 525 to 527):
PHP Code:
// Free Memory
$this->MYSQL->free_result($rows);
}
ADD BELOW:
PHP Code:
// Compress file
if(extension_loaded('zlib') && $this->COMBINE)
{
echo "Creating gzip file from SQL file<br />"; vbflush();
$file = fopen($this->FILE, 'r');
$data = fread($file, filesize($this->FILE));
fclose($file);
$file = gzopen($this->FILE, 'w9');
gzwrite($file, $data);
gzclose($file);
rename($this->FILE, $this->FILE . '.gz');
}
You must also have the zlib extension compiled into PHP. Most shared hosts will have zlib installed as well as most PHP installations in general. The script will not attempt to compress the file unless zlib is installed. You can find out if you have zlib by entering the Admin CP and going to Maintenance > View PHP Info and looking in the Configuration Command section for
'--with-zlib'.