Edgewall Software

Ticket #1462 (closed defect: fixed)

Opened 4 years ago

Last modified 2 years ago

bugzilla2trac.py improvements

Reported by: Florent Guillaume <fg@…> Owned by: jonas
Priority: normal Milestone: 0.9
Component: general Version: devel
Severity: normal Keywords: bugzilla
Cc:

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

bugzilla2trac.py.diff (19.2 KB) - added by Florent Guillaume <fg@…> 4 years ago.
bugzilla2trac.py.2.diff (356 bytes) - added by asmodai@… 3 years ago.
Fix for not honouring top-of-file settings
bugzilla2trac.py.3.diff (0.5 KB) - added by Jeroen Ruigrok <asmodai@…> 3 years ago.
trac.env does not have get_attachments_dir anymore, rework the code
bugzilla2trac.py.4.diff (22.2 KB) - added by charlie.clark@… 3 years ago.
This should be applied directly to trunk, not on top off the existing diffs
bugzilla2trac.py.5.diff (3.6 KB) - added by eburghar@… 3 years ago.
support for bugzilla 2.18.1 (#1972)
bugzilla2trac.py.6.diff (43.6 KB) - added by asmodai@… 3 years ago.
Continue building on Guillaume's work and support BZ 2.1[89] as well as PySQLite2

Change History

Changed 4 years ago by Florent Guillaume <fg@…>

Changed 4 years ago by Florent Guillaume <fg@…>

This is a diff from the trunk, by the way. But it also works with 0.8.1.

Changed 3 years ago by asmodai@…

Fix for not honouring top-of-file settings

Changed 3 years ago by Jeroen Ruigrok <asmodai@…>

  • milestone set to 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.

Changed 3 years ago by Jeroen Ruigrok <asmodai@…>

trac.env does not have get_attachments_dir anymore, rework the code

Changed 3 years ago by charlie.clark@…

Patch 3 only affects convert, addAttachment still calls .create_attachment

Changed 3 years ago by anonymous

  • version changed from 0.8.1 to devel
  • component changed from ticket system to general

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.

Changed 3 years ago by charlie.clark@…

This should be applied directly to trunk, not on top off the existing diffs

Changed 3 years ago by charlie.clark@…

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])

Changed 3 years ago by eburghar@…

support for bugzilla 2.18.1 (#1972)

Changed 3 years ago by anonymous

1. 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)

Changed 3 years ago by asmodai@…

Continue building on Guillaume's work and support BZ 2.1[89] as well as PySQLite2

Changed 3 years ago by asmodai@…

This patchset also solves Seemant's problem.

Changed 3 years ago by cmlenz

  • status changed from new to closed
  • resolution set to fixed

Last patch checked in in [2286]. Thanks!

Add/Change #1462 (bugzilla2trac.py improvements)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from jonas. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.