Bulk export attachments from bugzilla

Our Bigzilla installation has several GB of data and no server administrator. I have access to the web admin for bugzilla and you want to receive all attachments (with their original name and # error).

I know that the bulk export of the database is in XML format, but presumably after that you will need to parse the attachments.

I can request access to the server, and then look at the attachments table in the error database, but then, again, I will have to somehow decode the attachment data. Thus,

How to export all Bugzilla attachments at once, as files?

Perhaps some desktop clients have this feature? Or does someboday have a script to create a tarball?

+4
source share
2 answers

I do not know the existing tool, but here are some useful links for retrieving data from the database (if you or someone else is making the tool, please connect it here.)

The attached file name is in the associated attachments table, which also indicates the error number.

https://dev.mysql.com/doc/refman/5.0/en/select-into.html - to write files from the database.

You can also use the bugzilla web service, although this is likely to be slow: http://www.bugzilla.org/docs/4.0/en/html/api/Bugzilla/WebService/Bug.html#attachments

0
source

I used below to create a separate sql file that you can execute to pull files. tip: watch special characters in the file name

 select concat('SELECT ad.thedata into DUMPFILE \'e:/temp/attachments/' , a.bug_id , '___' , ad.id , '___' , replace(a.filename,'\'','') , '\' FROM bugs.attachments a, bugs.attach_data ad where ad.id = a.attach_id' , ' and ad.id = ' , ad.id ,';') into outfile 'C:/Temp/attachments.sql' from bugs.attachments a, bugs.attach_data ad where ad.id = a.attach_id; 
0
source

Source: https://habr.com/ru/post/1499625/


All Articles