Problems Importing from Trac

Hello,

I have an old ubuntu server running trac 0.11b2 using python 2.5, which I would like to import into YouTrack.

I spent the day yesterday figuring out how to upgrade python on my server to version 2.7, including installing the trac python modules into the new python 2.7 environment.

I then attempted to import a small test project from trac, and ran into a few errors:

1)If I use the un-modified value in defaultTrac.py for tracLib.SUPPORT_TIME_TRACKING = "auto", I get the following exception:

Traceback (most recent call last):
  File "trac2youtrack.py", line 457, in <module>
    main()
  File "trac2youtrack.py", line 33, in main
    trac2youtrack(target_url, target_login, target_password, project_ID, project_name, env_path)
  File "trac2youtrack.py", line 304, in trac2youtrack
    client = Client(env_path)
  File "/home/greg/youtrack-rest-python-library-master/python/tracLib/client.py", line 15, in __init__
    self._timetracking_plugins = self._get_timetracking_plugins()
  File "/home/greg/youtrack-rest-python-library-master/python/tracLib/client.py", line 22, in _get_timetracking_plugins
    for com_name, com_enabled in self.env._component_rules.items():
AttributeError: 'Environment' object has no attribute '_component_rules'

I can work around this error by setting tracLib.SUPPORT_TIME_TRACKING = False



2)My test trac project has a 'select'-type custom field, and if I use the default mapping for "select":"enum[1]", I get the following exception during import:

Processing custom field [ Source ]
Traceback (most recent call last):
  File "trac2youtrack.py", line 457, in <module>
    main()
  File "trac2youtrack.py", line 33, in main
    trac2youtrack(target_url, target_login, target_password, project_ID, project_name, env_path)
  File "trac2youtrack.py", line 379, in trac2youtrack
    process_custom_field(target, project_ID, field_type, field_name, trac_values_to_youtrack_values(field_name, values))
  File "/home/greg/youtrack-rest-python-library-master/python/youtrack/importHelper.py", line 122, in process_custom_field
    [connection.addValueToBundle(bundle, bundle.createElement(name)) for name in values_to_add]
  File "/home/greg/youtrack-rest-python-library-master/python/youtrack/connection.py", line 1028, in addValueToBundle
 return self._put(request)
  File "/home/greg/youtrack-rest-python-library-master/python/youtrack/connection.py", line 106, in _put
 return self._reqXml('PUT', url, '<empty/>\n\n')
  File "/home/greg/youtrack-rest-python-library-master/python/youtrack/connection.py", line 83, in _reqXml
    response, content = self._req(method, url, body, ignoreStatus)
  File "/home/greg/youtrack-rest-python-library-master/python/youtrack/connection.py", line 32, in wrapped
    raise e
youtrack.YouTrackException: Error for http://forum.jetbrains.com/admin/customfield/bundle/Source_bundle_SS/?: 405: Method Not Allowed: Method Not Allowed

I can work around this by changing the mapping to "select":"string"



3)After getting past the previous errors, I am now running up against an exception that occurs when the script begins importing issues:

Traceback (most recent call last):
  File "trac2youtrack.py", line 457, in <module>
    main()
  File "trac2youtrack.py", line 33, in main
    trac2youtrack(target_url, target_login, target_password, project_ID, project_name, env_path)
  File "trac2youtrack.py", line 383, in trac2youtrack
    trac_issues = client.get_issues()
  File "/home/greg/youtrack-rest-python-library-master/python/tracLib/client.py", line 181, in get_issues
    at = TracAttachment(Attachment._get_path(self.env.path, 'ticket', str(issue.id), elem[0]))
TypeError: unbound method _get_path() must be called with Attachment instance as first argument (got str instance instead)



I would like to know:

  1. are any of these errors are known issues
  2. is this script still supported?
  3. is there a minimum supported version of the python trac module?
  4. is it a better idea for me to try to work through the issues with the trac importer, or should I be seeking an alternative, such as exporting issues to .csv, and then importing them from csv?

Thanks.

Please sign in to leave a comment.