Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Creating a Bugzilla backup

82 views
Skip to first unread message

Legéndi Richárd Olivér

unread,
Dec 18, 2007, 7:11:45 AM12/18/07
to support-...@lists.mozilla.org
Hi everyone!

I'm creating backups from our Bugzilla for a while, but I guess I do
something wrong :-)

My problem is that we have 800+ bugs recently, many with attachments,
most of them have archived files attached with size of X megabytes, but
the whole backup I create is no more than 6 megabyte... That's strange
because one of the attachments is a 50M zip :-)

Our Bugzilla is a pretty ancient one, with version 2.16.7.

My backup script is something like this


echo "Dumping Bugzilla database..."
mysqldump -umysqldumper -p12345 --database bugzilla > $BUGZILLA_DUMP

echo "Creating acrhive from Bugzilla config files..."
tar -czf $TARGET_DIR/$FNAME /var/lib/bugzilla/data \
$BUGZILLA_DUMP


I cannot figure out where does the Bugzilla store the attached files,
could anybody please help me out? I found some sort of binary data in
the database (in db "bugzilla" table "attachments" column "thedata"),
but the dump is too little for me...

Any suggestions would be greatly appreciated!
Richard

Tosh, Michael J

unread,
Dec 18, 2007, 9:06:03 AM12/18/07
to Legéndi Richárd Olivér, support-...@lists.mozilla.org
run:
du -sk /var/lib/bugzilla/data

Then run tar -tzvf $TARGET_DIR/$FNAME

Make sure everything within the tar looks correct. Attachments can be in data/attachments or in the attachments table for 2.20+, but I don't know about 2.16. If you have "Big Files" checkbox when creating an attachment, then it could be in data/attachments.

Also, mysqldump usually does not need a --database parameter.
mysqldump bugzilla -umysqldumper -p12345
should be all you need. You could specify particular tables if you find they aren't being extracted.
mysqldump bugzilla attachments bugs <other table> -umysqldumper -p12345

Hi everyone!

_______________________________________________
support-bugzilla mailing list
support-...@lists.mozilla.org
https://lists.mozilla.org/listinfo/support-bugzilla
PLEASE put support-...@lists.mozilla.org in the To: field when you reply.

Legéndi Richárd Olivér

unread,
Dec 18, 2007, 9:49:45 AM12/18/07
to support-...@lists.mozilla.org
Hi Michael!

The result of du is:

# du -skh /var/lib/bugzilla/data/
5.9M /var/lib/bugzilla/data/

Yes, I've already checked the created archive, everything is in it what
I want to archive.
I've also tried your version for mysqldumb, but the result is seemingly
the same :-(

Richard

Tosh, Michael J

unread,
Dec 18, 2007, 10:03:06 AM12/18/07
to Legéndi Richárd Olivér, support-...@lists.mozilla.org
What about the $BUGZILLA_DUMP file? is that empty? Does it exist in your tar? Does it have the same size in the tar that it has on the filesystem?

Legéndi Richárd Olivér

unread,
Dec 18, 2007, 4:18:17 PM12/18/07
to support-...@lists.mozilla.org
I had to modify your select as follows (hope its somewhat you seek):

mysql> SELECT bug_id,attach_id,CONCAT(LENGTH(thedata)/1048576," MB") AS
size FROM attachments WHERE LENGTH(thedata) > 1048576;

The result was an empty set :-)

So these attachments are not stored directly in the database, then the
question is where are they? We can download these attachments from the
bugzilla, so they have to be somewhere there but I cannot locate the
necessary files.

Richard

Tosh, Michael J wrote:
> Have you verified that the entire zip was uploaded? Apache usually has an upload limit of a few MB. You can do a:
> SELECT bug_id,attach_id,CONCAT(LENGTH(thedata)/1048576," MB") AS size FROM attach_data LEFT OUTER JOIN attachments ON attach_id=attach_data.id WHERE LENGTH(thedata) > 1048576;
> to make sure you see something greater than 50MB.


>
> -----Original Message-----
> From: Legéndi Richárd Olivér [mailto:roa...@freemail.hu]
> Sent: Tuesday, December 18, 2007 10:07 AM
> To: Tosh, Michael J
> Subject: Re: Creating a Bugzilla backup
>

> No, the ouput files are ok.
>
> I'm suspicious because these files are extremely small. I know we have a
> 50M zip attached in one of the bugs, and the whole mysqldump and other
> archived directories are less than 10M ... I must forget to include
> something.

Tosh, Michael J

unread,
Dec 18, 2007, 4:30:34 PM12/18/07
to Legéndi Richárd Olivér, support-...@lists.mozilla.org
Sorry, I can't help you then, I'm unsure where 2.16 stored the attachments then. You could try to get the attachment id from the attachment details page and look for a file called attach.<id> somewhere on your system (find / -type f -name "attach.<attach_id>")

That may help I hope. Find also has a way to look for files over a certain size, but I don't remember exactly at this time. Maybe if you download the attachment and get the exact size in bytes of the zip, then do a (find / -type f -size <size in bytes>) you will see where it is stored.

Richard

Marc Schumann

unread,
Dec 18, 2007, 4:47:13 PM12/18/07
to support-...@lists.mozilla.org
Richárd,

2007/12/18, Legéndi Richárd Olivér <roa...@freemail.hu>:


> I'm creating backups from our Bugzilla for a while, but I guess I do
> something wrong :-)
>
> My problem is that we have 800+ bugs recently, many with attachments,
> most of them have archived files attached with size of X megabytes, but
> the whole backup I create is no more than 6 megabyte... That's strange
> because one of the attachments is a 50M zip :-)

from the recent discussion, I can't tell what's wrong here either.
Maybe you want to try your backup on an otherwise pristine install?
Perhaps this will shed some light on your situation.

Regards
Marc

Max Kanat-Alexander

unread,
Dec 18, 2007, 4:51:17 PM12/18/07
to support-...@lists.mozilla.org
On Tue, 18 Dec 2007 13:11:45 +0100 Legéndi Richárd Olivér
<roa...@freemail.hu> wrote:
> echo "Dumping Bugzilla database..."
> mysqldump -umysqldumper -p12345 --database bugzilla > $BUGZILLA_DUMP

Are you sure that the "mysqldumper" user has rights to dump
that whole DB?

Attachments are stored in the database, in Bugzilla 2.16,
unless you have customized your Bugzilla to do something else with them.

-Max
--
http://www.everythingsolved.com/
Competent, Friendly Bugzilla and Perl Services. Everything Else, too.

0 new messages