MyBB Community Forums

Full Version: [F] Backup doesn't work in FF3
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
A backup database produces an empty file when generated under Firefox 3.0.1.

Procedure
Attempt a database backup with the settings:

Select All to select all the tables, file type to GZIP, Download, backup Structure and Data and select Analyze and Optimize.

The resulting file contains little or no backup content. There does not appear to be a problem doing this from IE7 instead of FF3.
Does it work without gzip? If so, then that just says that you have a faulty gzip extension installed.
Yes, I've just tried Plain Text and that works OK. So, where is this faulty GZIP module installed?
Could you also try saving the download (GZipped) then downloading the saved file?
Thanks.
(2008-08-07, 09:22 AM)ZiNgA BuRgA Wrote: [ -> ]Could you also try saving the download (GZipped) then downloading the saved file?
Thanks.
You mean save the GZIPped backup on the server and then FTP that to my local machine?
Yes, or download the file via the AdminCP (after saving to the server).
The reason is because when saving to the server, we use different functions.
(2008-08-07, 09:30 AM)ZiNgA BuRgA Wrote: [ -> ]Yes, or download the file via the AdminCP (after saving to the server).
The reason is because when saving to the server, we use different functions.
Since I am new to MyBB I am also new to making backups of MyBB databases and so I have found further problems/bugs along the way.

Firefox3
Saving the backup on the server under Firefox3 as a GZIP works (it gives me a 127k backup). Directly saving the backup to my local machine gives me a 1k backup (sometimes repeating this gives a 0k backup).

Internet Explorer 7
Saving the backup on the server under Internet Explorer 7 as a GZIP works (it gives me a 127k backup). Directly saving the backup to my local machine gives me a 480k backup. However, extracting this to a text file gives roughly the same size text file as the 127k file on the server when expanded so I assume that a different compression algorithm is used.

However, when saving to the server, it shows me a path which must be an absolute path on the server and one which I am not familiar with:

[Image: attachment.php?aid=10326]

If I then click on the Download link at the end, I get:

[Image: attachment.php?aid=10327]

In the case of my testing above, I simply FTPed the backup from the backup folder to my local machine. Does my logic/procedure make sense to you?
Can you try this edit?
In admin/modules/tools/backupdb.php, find (it's near the top of the file):
function clear_overflow($fp, &$contents) 
{
	global $mybb;
	
	if($mybb->input['method'] == 'disk') 
	{
		if($mybb->input['filetype'] == 'gzip') 
		{
			gzwrite($fp, $contents);
		} 
		else 
		{
			fwrite($fp, $contents);
		}
	} 
	else 
	{
		if($mybb->input['filetype'] == "gzip")
		{
			echo gzencode($contents);
		}
		else
		{
			echo $contents;
		}
	}
		
	$contents = '';	
}
replace with:
function clear_overflow($fp, &$contents) 
{
	global $mybb;
	
	if($mybb->input['method'] == 'disk') 
	{
		if($mybb->input['filetype'] == 'gzip') 
		{
			gzwrite($fp, $contents);
		} 
		else 
		{
			fwrite($fp, $contents);
		}
	} 
	else 
	{
		if($mybb->input['filetype'] == "gzip")
		{
			return;
		}
		else
		{
			echo $contents;
		}
	}
		
	$contents = '';	
}

See if that fixes the issue with downloading the DB backup directly (without saving to server first).



I'm not sure why you're getting an error trying to download the file though :/
Here are the figures for file sizes created from backups via IE7 and FF3 via the two backup scenarios. Hope they help.

[Image: attachment.php?aid=10355]
Hi,

This should work. It should go in admin/modules/tools/



Other minor notes:

See http://www.ietf.org/rfc/rfc2616.txt [^] section 14.3:
Note: Most HTTP/1.0 applications do not recognize or obey values
associated with content-encodings. This means that values will not
work and are not permitted with x-gzip or x-compress.
Pages: 1 2 3