Importing old mahara project bugs into launchpad

Asked by Richard Mansfield on 2009-12-07

We have just started using the launchpad bug tracker (we like it a lot!) for the Mahara project ( and we'd like to import the bug history from our old tracker at

I have had a go at extracting and converting them into the launchpad import format:

-- although I'm not entirely sure I've done the right thing, and couldn't find a dtd to use for validation.

Could you import the bugs in that file to the testing area so that we can have a look at them?


Question information

English Edit question
Launchpad itself Edit question
Eleanor Berger Edit question
Solved by:
Richard Mansfield
Last query:
Last reply:

I am getting errors running a test import because of invalid date formats. Investigating.

The dates are all missing the final Z. That was easy to fix, but after doing that I get new errors:

2009-12-16 20:34:00 INFO Handling bug 2040
2009-12-16 20:34:00 ERROR Could not import bug #2040
Traceback (most recent call last):
  File "/home/tom/canonical/lp-branches/test-mahara-import/lib/lp/bugs/scripts/", line 276, in importBugs
  File "/home/tom/canonical/lp-branches/test-mahara-import/lib/lp/bugs/scripts/", line 305, in importBug
    commentnode = comments.pop(0)
IndexError: pop from empty list

Hi Tom,

Thanks for looking at this. It looks like the launchpad format requires at least one comment per bug, which wasn't the case on the old tracker. I will regenerate the file and put the bug description in as the first comment (and add the Z). I'll post again here when it's done.


Richard, great. I'm marking the question as needing information until then.

I've regenerated the file now, added the Z and added a dummy comment into the bugs that didn't have any comments. In the process I discovered there was another problem too -- I'd previously put all the comments into a <comments> element that doesn't exist in the format. All fixed now.

If you could run it again, that'd be great.

Hi Tom,

Any chance you could have another go at importing these bugs into launchpad sometime, or else let me know how to go about doing it myself? I regenerated the xml as mentioned in the last post, it's here:

The server running our old bug tracker is going away in April, so it would be great to get these old bugs into launchpad and avoid the hassle of setting up another copy of the old tracker.


Onkar Shinde (onkarshinde) said : #7


I am just another user trying to help here. Don't add a dummy comment. The first comment should be the bug description itself. This is useful when trying to detect changes to bug summary. I had a discussion regarding first comment on #launchpad yesterday for my own project. I thought it will be useful to you too.


Sorry for taking so long to get to this. I can now complete the import successfully on a local instance. That's great news! When you're next available online, let me know and I'll import the bugs to our staging server so that you can review the results. When you're happy with them, we can proceed with importing the bugs into the production Launchpad servers.


Thanks for the advice. I've regenerated the file and put the bug description in the first comment for every bug.


It'd be great if you could download the file again (with the comments fixed up) and import the bugs into the staging server. I'm about to leave for the day (GMT+13 here) but I can review them tomorrow if that's okay.

Thanks again,



I've imported the bugs from the current XML file into Can you please have a look? Once you confirm that you're happy with the result we'll repeat the import on the main server.

Thanks Tom!

Sorry about this but it turned out there were a few bugs that were quite hard to read because there were some html entities that were double encoded.

Would you mind downloading and importing them again? (last time, I promise). If it's a really big hassle don't worry about it, we can deal with the current import on staging.


Thanks Richard. We've now completed the import without any problem.

Thanks Tom, that's awesome!