When rewriting the JIRA issues into a Bugzilla bug, I needed to migrate the description into the first comment. xml = %x[curl -u username:password # " ))ĭescription: While JIRA gives the bug description its own element ( description), Bugzilla considers it the first comment on the bug. each do | i | # Use curl with credentials to extract each JIRA issue's XML. (Figure out how many issues to include.) ( 1. As an added bonus, I can avoid any XML SAX state logic that a single large XML file would have needed, so I can focus on transforming issues into bugs in isolation. This process includes comments and involves lots of quick JIRA queries. Second, size: thousands of issues take a long time to process as a single XML file, and neither JIRA nor Chrome seemed happy about the size.Īn alternative to this export is using curl to export issues individually. First, data loss: comments are not included. While straight-forward, this method has two significant downsides. One obvious way is to simply search for the issues you want and click “View” at the top to select a different format, like XML. JIRA Issues: There are a couple ways to export issues from JIRA. each do | attachment | attachment_id = attachment. text # Value of subelement for element doc. Here are some handy snippets of Nokogiri in action: # Element contains doc. Finally, I used this gist and then followed steps here. Installing the gem on that OS was a small battle in itself. Unfortunately, I was using Snow Leopard (10.6). It installs effortlessly on Lion (10.7) with a simple gem install nokogiri. Nokogiri: This handy Ruby gem allowed me to use XPath to search through the JIRA XML files and extract specific fields and values. Also, the script changed the ownership and permissions of the bugzilla directory such that it was no longer accessible on the web I had to recursively revert those like so: chmod -R 754 bugzilla Oddly, when I started the import process, I found that I was still missing XML::Parser, so I had to install that from CPAN as well. In particular, for importing, you will need XML::Twig. # The log below represents a successful import.īugzilla’s : Bugzilla will check your setup with this script and let you know if you are missing any Perl modules. I found it very helpful to add the –verbose flag for better errors./ -verbose bug.xml It meant that I just extract all the issues from JIRA and reformat them into Bugzilla’s DTD. As input, it takes an XML file of one or more bugs, assuming you just used the XML export built into Bugzilla. However, it’s specifically designed for moving bugs from one Bugzilla instance to another. Toolsīugzilla’s : Bugzilla does ship with an import script. I’ll describe the process I used to migrate around 6K bugs. Atlassian has a nice tool for migrating Bugzilla data into its JIRA system, but the one googleable conversation I could find about migrating JIRA to Bugzilla was in 2006. I expected this process to be uncommon but not unheard of. Recently, my team needed to migrate from Atlassian’s JIRA to Mozilla’s Bugzilla.
0 Comments
Leave a Reply. |