#1462 closed defect (fixed)
bugzilla2trac.py improvements
Reported by: | Owned by: | Jonas Borgström | |
---|---|---|---|
Priority: | normal | Milestone: | 0.9 |
Component: | general | Version: | devel |
Severity: | normal | Keywords: | bugzilla |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Here are some improvements to bugzilla2trac.py that were useful for my conversion. Read the top of the file for details, highlights are:
- you can now choose to import the Bugzilla products as Trac components, which also puts the Bugzilla components in the Trac keywords,
- remapping of bugzilla identifiers to different Trac usernames,
- remapping of keywords,
- conversion of inline bug numbers to TracLinks,
- ignoring of certain milestones,
- in general more flexibility in the configuration.
Attachments (6)
Change History (14)
by , 20 years ago
Attachment: | bugzilla2trac.py.diff added |
---|
comment:1 by , 20 years ago
by , 19 years ago
Attachment: | bugzilla2trac.py.2.diff added |
---|
Fix for not honouring top-of-file settings
comment:2 by , 19 years ago
Milestone: | → 0.9 |
---|
The patch I added solves the fact that if you modify the in-script settings at the top and running the script it will just print usage(). Which goes against EITHER specifying with command line or with in-script settings.
by , 19 years ago
Attachment: | bugzilla2trac.py.3.diff added |
---|
trac.env does not have get_attachments_dir anymore, rework the code
comment:3 by , 19 years ago
Patch 3 only affects convert, addAttachment still calls .create_attachment
comment:4 by , 19 years ago
Component: | ticket system → general |
---|---|
Version: | 0.8.1 → devel |
If I understand things correctly, for trunk / 0.9 there is a problem with attachments. The solution I think is to use attachment.Attachment in convert tracAttachment = attachment.Attachment(trac.env, 'ticket', str(abug_id), None, trac.db()) tracAttachment.insert(afilename, StringIO.StringIO(athedata.tostring()), len(athedata))
First instantiate an Attachment but do not pass it a file immediately. Add the attachment by calling .insert() on the attachment instance.
I will try and post the diff.
by , 19 years ago
Attachment: | bugzilla2trac.py.4.diff added |
---|
This should be applied directly to trunk, not on top off the existing diffs
comment:5 by , 19 years ago
If you want to import users into the Trac DB then you can extend the convert function. Adjust as necessary but designed to work with my RelationalRoleSupportPatch http://trac-hacks.swapoff.org/wiki/RelationalRoleSupportPatch #import users mysql_cur.execute("SELECT login_name, cryptpassword FROM profiles") users = mysql_cur.fetchall() c.execute("DELETE FROM trac_users") c.executemany("INSERT INTO trac_users (username, password) VALUES (%s, %s)",
[(userlogin_name, usercryptpassword) for user in users])
comment:6 by , 19 years ago
- import severities…
inserting severity blocker 1 Traceback (most recent call last):
File "bugzilla2trac.py", line 681, in ?
main()
File "bugzilla2trac.py", line 678, in main
convert(BZ_DB, BZ_HOST, BZ_USER, BZ_PASSWORD, TRAC_ENV, TRAC_CLEAN)
File "bugzilla2trac.py", line 381, in convert
trac.setSeverityList(severities)
File "bugzilla2trac.py", line 166, in setSeverityList
"severity", value.encode('utf-8'), i)
TypeError: execute() takes at most 3 arguments (5 given)
is the error I get. cmlenz tells me it's due to the DB API not tweaked for pysqlite2.
Thanks,
(Seemant)
by , 19 years ago
Attachment: | bugzilla2trac.py.6.diff added |
---|
Continue building on Guillaume's work and support BZ 2.1[89] as well as PySQLite2
comment:8 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Last patch checked in in [2286]. Thanks!
This is a diff from the trunk, by the way. But it also works with 0.8.1.