Home      FAQ      Idea Exchange      Ask a Question      My Stuff      Help   
  
Backup Tool - XML option
Could the backup tool be extended with an XML option that would dump out everything in an XML structure (+ an attachments folder), as an alternative to the HTML in folders as is available now?
ID
286
Category
Integration (PRO)
  Import and Export
Author
Justin Willey
Date Created
8/18/2010 2:29:15 PM
Date Updated
8/19/2010 8:51:35 AM
Status
Implemented
Score
10
Promoted By
Justin Willey
Comments
Kirill Bondar  Staff  8/19/2010 5:15:36 AM
BUGtrack backup tool gets the data via the API in XML format and produces the output via XSL transformation: the default, html.xsl, is provided in a package. You can use custom XSL transformation to produce output in a format you want: provide the path to your file via -xsl option of btbackup.

The transformation below can be used to dump the XML data as-is:

<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml" indent="yes"/>

<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>
Justin Willey 8/19/2010 8:00:44 AM
Many thanks for that Kirill - I tried it and it works fine - I now get individual xml files for each bug in the year / month / day folder structure. I was really hoping to get a single xml file - but I supose that that is dictated by the exe, not the xsl.
Kirill Bondar  Staff  8/19/2010 8:44:10 AM
That's what we have started from - the backup process was implemented via web query functionality. Then we encountered the problem - resulting XML including all the issues, their comments and attachments was often few gigabytes in size and took hours to download. You can still perform a web query, but attachments are not included there anymore.

btbackup does the job in more sophisticated way, checking what issues were changed since last backup and downloading updates issue by issue.
Justin Willey 8/19/2010 8:51:35 AM
That's fine - if I want a single file I can always parse the index.xml file and use that to assemble a new file from the individual bug files. Many thanks for your help.
Feedback
 
Back to Search Results