Hi,

we ported our project from bugzilla to trac now and we also ran into this 
problem. Maybe you already came up with a solution within the past 7 years, 
but I only wanted to contribute a workaround for this problem. I just 
renamed the identical components in the database as follows:

UPDATE components AS c SET c.name = '<new comp. name>' WHERE c.id = <id of 
the comp. entry>;

For exmaple, I changed it to '<component name>_<product>'.

Greets

Jan



Am Montag, 2. Oktober 2006 01:37:03 UTC+2 schrieb z00m1n:
>
> Hi all,
>
> I am trying to import Bugzilla issues into Trac using bugzilla2trac.py.
>
> This is the script output:
>
> Using Bugzilla v2202 schema.
> Bugzilla MySQL('bugs':'<servername>':'<username>':'****'): connecting...
> Trac SQLite('D:\Server\Trac\TracTest'): connecting...
>
> Cleaning all tickets...
> All tickets cleaned...
>
> 0. Filtering products...
>   Using products <names of 4 different products>
>
> 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 'Memory', owner '<email address>'
>   inserting component 'Power Supply', owner '<email address>'
>   inserting component 'Modem (CDMA/GPRS)', owner '<email address>'
>   inserting component 'Processor', owner '<email address>'
>   inserting component 'Audio', owner '<email address>'
>   inserting component 'Display', owner '<email address>'
>   inserting component 'GPS', owner '<email address>'
> Traceback (most recent call last):  inserting component 'Serial Port', 
> owner '<email address>'
>   inserting component 'SD Card', owner '<email address>'
>   inserting component 'Movement Sensor', owner '<email address>'
>   inserting component 'CAN Interface', owner '<email address>'
>   inserting component 'Bluetooth', owner '<email address>'
>   inserting component 'Audio', owner '<email address>'
>
>   File "C:\Program Files\Development\ActiveState Komodo 
> 3.5\lib\support\dbgp\pythonlib\dbgp\client.py", line 1843, in runMain
>     self.dbg.runfile(debug_args[0], debug_args)
>   File "C:\Program Files\Development\ActiveState Komodo 
> 3.5\lib\support\dbgp\pythonlib\dbgp\client.py", line 1538, in runfile
>     h_execfile(file, args, module=main, tracer=self)
>   File "C:\Program Files\Development\ActiveState Komodo 
> 3.5\lib\support\dbgp\pythonlib\dbgp\client.py", line 596, in __init__
>     execfile(file, globals, locals)
>   File "D:\DevBase\Server\Trac\code\python\bugzilla2trac.py", line 883, in 
> __main__
>     main()
>   File "D:\DevBase\Server\Trac\code\python\bugzilla2trac.py", line 880, in 
> main
>     convert(BZ_DB, BZ_HOST, BZ_USER, BZ_PASSWORD, TRAC_ENV, TRAC_CLEAN)
>   File "D:\DevBase\Server\Trac\code\python\bugzilla2trac.py", line 532, in 
> convert
>     trac.setComponentList(components, 'name')
>   File "D:\DevBase\Server\Trac\code\python\bugzilla2trac.py", line 281, in 
> setComponentList
>     (comp[key].encode('utf-8'),
>   File "C:\Program 
> Files\Development\ActivePython\lib\site-packages\trac\db\util.py", line 47, 
> in execute
>     return self.cursor.execute(sql_escape_percent(sql), args)
>   File "C:\Program 
> Files\Development\ActivePython\lib\site-packages\trac\db\util.py", line 47, 
> in execute
>     return self.cursor.execute(sql_escape_percent(sql), args)
>   File "C:\Program 
> Files\Development\ActivePython\lib\site-packages\MySQLdb\cursors.py", line 
> 163, in execute
>     self.errorhandler(self, exc, value)
>   File "C:\Program 
> Files\Development\ActivePython\lib\site-packages\MySQLdb\connections.py", 
> line 35, in defaulterrorhandler
>     raise errorclass, errorvalue
> IntegrityError: (1062, "Duplicate entry 'Audio' for key 1")
>
> 3 of the 4 products have an Audio component which seems to be the reason 
> why the script fails.
>
> What can I do ?
>
>
> TIA,
>
> CU z00m1n
>
> -- 
> Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
> Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
>
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to