Edgewall Software

Ticket #5585 (assigned defect)

Opened 17 months ago

Last modified 4 months ago

bugzilla2trac does not work with bugzilla 3.0

Reported by: dekimsey@… Owned by: jruigrok
Priority: normal Milestone: 0.13
Component: ticket system Version:
Severity: normal Keywords: helpwanted bugzilla
Cc:

Description

The bugzilla2trac.py script does nto seem to work with bugzilla 3.0. Using the default version number nor a version of '3' will function. However, it should be noted that using the default bugzilla version in the script, actually gets farther along in the import before failing.

Using Bugzilla v3 schema.
Bugzilla MySQL('*':'*':'*':'*******'): connecting...
Trac SQLite('/home/trac/projects/signin'): connecting...

Cleaning all tickets...
All tickets cleaned...

0. Filtering products...
Traceback (most recent call last):
  File "bugzilla2trac.py", line 894, in <module>
    main()
  File "bugzilla2trac.py", line 891, in main
    convert(BZ_DB, BZ_HOST, BZ_USER, BZ_PASSWORD, TRAC_ENV, TRAC_CLEAN)
  File "bugzilla2trac.py", line 505, in convert
    mysql_cur.execute("SELECT product AS name FROM products")
  File "/usr/lib/python2.5/site-packages/MySQLdb/cursors.py", line 164, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib/python2.5/site-packages/MySQLdb/connections.py", line 35, in defaulterrorhandler
    raise errorclass, errorvalue
_mysql_exceptions.OperationalError: (1054, "Unknown column 'product' in 'field list'")
Using Bugzilla v2180 schema.
Bugzilla MySQL('*':'*':'*':'*******'): connecting...
Trac SQLite('/home/trac/projects/signin'): connecting...

Cleaning all tickets...
All tickets cleaned...

0. Filtering products...
  Using products Signin

1. Import severities...
  inserting severity 'blocker' - '1'
  inserting severity 'critical' - '2'
  inserting severity 'major' - '3'
  inserting severity 'normal' - '4'
  inserting severity 'minor' - '5'
  inserting severity 'trivial' - '6'

2. Import components...
  inserting component 'General', owner 'bellaire'
  inserting component 'Scheduling, Preference Forms', owner 'bellaire'
  inserting component 'Sign-in, Timesheets', owner 'bellaire'

3. Import priorities...
  inserting priority 'highest' - '1'
  inserting priority 'high' - '2'
  inserting priority 'normal' - '3'
  inserting priority 'low' - '4'
  inserting priority 'lowest' - '5'

4. Import versions...
  inserting version '.Production'
  inserting version 'Development'
  inserting version 'Release'
  inserting version '2.0'
  inserting version 'unspecified'

5. Import milestones...

6. Retrieving bugs...

7. Import bugs and bug activity...
Traceback (most recent call last):
  File "bugzilla2trac.py", line 894, in <module>
    main()
  File "bugzilla2trac.py", line 891, in main
    convert(BZ_DB, BZ_HOST, BZ_USER, BZ_PASSWORD, TRAC_ENV, TRAC_CLEAN)
  File "bugzilla2trac.py", line 681, in convert
    field_name = trac.getFieldName(mysql_cur, activity['fieldid']).lower()
  File "bugzilla2trac.py", line 431, in getFieldName
    (fieldid))
  File "/usr/lib/python2.5/site-packages/MySQLdb/cursors.py", line 164, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib/python2.5/site-packages/MySQLdb/connections.py", line 35, in defaulterrorhandler
    raise errorclass, errorvalue
_mysql_exceptions.OperationalError: (1054, "Unknown column 'fieldid' in 'where clause'")

Attachments

bugzilla_3.0_compatibility.patch (1.3 KB) - added by dekimsey@… 17 months ago.
in bugzilla 3.0 the pkey of the fielddefs changed. this patch should fix that. additionally, removes a newline from an sql statement that was preventing compile.

Change History

Changed 17 months ago by dekimsey@…

in bugzilla 3.0 the pkey of the fielddefs changed. this patch should fix that. additionally, removes a newline from an sql statement that was preventing compile.

  Changed 12 months ago by sid

  • keywords helpwanted added

Can someone test this out and give feedback on the patch?

follow-up: ↓ 3   Changed 10 months ago by dave@…

Patch fails for me

#patch < patch (Stripping trailing CRs from patch.) patching file bugzilla2trac.py Hunk #2 FAILED at 816. 1 out of 2 hunks FAILED -- saving rejects to file bugzilla2trac.py.rej #cat bugzilla2trac.py.rej *************** *** 812,819 ****

ticketid = trac.addTicket(**ticket)

if BZ_VERSION >= 2180:

- mysql_cur.execute("SELECT attachments.*, attach_data.thedata FROM attachments, attach_data - WHERE attachments.bug_id = %s AND attachments.attach_id = attach_data.id" % bugid)

else:

mysql_cur.execute("SELECT * FROM attachments WHERE bug_id = %s" % bugid)

attachments = mysql_cur.fetchall()

--- 816,822 ----

ticketid = trac.addTicket(**ticket)

if BZ_VERSION >= 2180:

+ mysql_cur.execute("SELECT attachments.*, attach_data.thedata FROM attachments, attach_data WHERE attachments.bug_id = %s AND attachments.attach_id = attach_data.id" % bugid)

else:

mysql_cur.execute("SELECT * FROM attachments WHERE bug_id = %s" % bugid)

attachments = mysql_cur.fetchall()

Running Version: 0.10.3-1etch2

in reply to: ↑ 2   Changed 10 months ago by dave@…

redownloaded original script and patch from here - can apply patch but get the following erro:

7. Import bugs and bug activity... Traceback (most recent call last):

File "./bugzilla2trac.py", line 898, in ?

main()

File "./bugzilla2trac.py", line 895, in main

convert(BZ_DB, BZ_HOST, BZ_USER, BZ_PASSWORD, TRAC_ENV, TRAC_CLEAN)

File "./bugzilla2trac.py", line 685, in convert

field_name = trac.getFieldName(mysql_cur, activityfieldid?).lower()

File "./bugzilla2trac.py", line 435, in getFieldName

(fieldid))

File "/usr/lib/python2.4/site-packages/MySQLdb/cursors.py", line 163, in execute

self.errorhandler(self, exc, value)

File "/usr/lib/python2.4/site-packages/MySQLdb/connections.py", line 35, in defaulterrorhandler

raise errorclass, errorvalue

_mysql_exceptions.OperationalError?: (1054, "Unknown column 'fieldid' in 'where clause'") MONITOR_SERVER#

  Changed 7 months ago by jruigrok

  • owner changed from jonas to jruigrok
  • status changed from new to assigned

  Changed 5 months ago by Piotr Kuczynski <piotr.kuczynski@…>

  • keywords bugzilla added

  Changed 5 months ago by Piotr Kuczynski <piotr.kuczynski@…>

  • component changed from general to ticket system
  • milestone set to 0.12

  Changed 4 months ago by Larry Silverman

I'm running Bugzilla 3.0, also hitting this issue. I think you might need to remove the tostring() on the filedata = StringIO.StringIO line.

Add/Change #5585 (bugzilla2trac does not work with bugzilla 3.0)

Author



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