Edgewall Software

Changes between Initial Version and Version 1 of Ticket #9940


Ignore:
Timestamp:
Dec 21, 2010, 1:40:42 PM (13 years ago)
Author:
Remy Blank
Comment:

Thanks for your contribution!

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #9940

    • Property Milestoneunscheduled
    • Property Reporter changed from anonymous to Eric Auer
  • Ticket #9940 – Description

    initial v1  
    1 When trying to use bugzilla2trac.py mentioned in
    2 http://trac.edgewall.org/wiki/TracImport I ran
    3 into the problem that (admin / firewall wise) it
    4 was not possible to give the TRAC server direct
    5 access and suitable drivers for the PostgreSQL
    6 database of the source Bugzilla instance.
     1When trying to use bugzilla2trac.py mentioned in http://trac.edgewall.org/wiki/TracImport I ran into the problem that (admin / firewall wise) it was not possible to give the TRAC server direct access and suitable drivers for the PostgreSQL database of the source Bugzilla instance.
    72
    8 Because of this, I wrote a script which converts
    9 the XML output of the Bugzilla search result web
    10 page into CSV suitable for the csv2trac.2.py
    11 script. An example of the search results is on:
     3Because of this, I wrote a script which converts the XML output of the Bugzilla search result web page into CSV suitable for the csv2trac.2.py script. An example of the search results is on:
    124
    135https://landfill.bugzilla.org/bugzilla-tip/buglist.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&product=&content=broken
    146
    15 At the bottom, you see a link CSV (which only
    16 returns columns like the bug titles) and a
    17 button XML. The XML button returns the full
    18 content of all bugs in the result list. Note
    19 that attached files are not included in this.
     7At the bottom, you see a link CSV (which only returns columns like the bug titles) and a button XML. The XML button returns the full content of all bugs in the result list. Note that attached files are not included in this.
    208
    21 To find all bugs, just use all states as the
    22 search constraint. If simple search does not
    23 let you search without search terms, you can
    24 use advanced search. It is also configurable
    25 by Bugzilla admins whether trivial searches
    26 are allowed. Yet even at strict settings, it
    27 is possible to search "all states, no term".
     9To find all bugs, just use all states as the search constraint. If simple search does not let you search without search terms, you can use advanced search. It is also configurable by Bugzilla admins whether trivial searches are allowed. Yet even at strict settings, it is possible to search "all states, no term".
    2810
    2911----
    3012
    31 To convert the Bugzilla XML data to CSV for
    32 csv2trac usage, I wrote a small Perl script.
    33 At least compared to bugzilla2trac, it is
    34 quite small. The script can be put under any
    35 free open source license of your choice. It
    36 can even be put into the public domain...
     13To convert the Bugzilla XML data to CSV for csv2trac usage, I wrote a small Perl script. At least compared to bugzilla2trac, it is quite small. The script can be put under any free open source license of your choice. It can even be put into the public domain...
    3714
    3815Dependency import lines of the Perl script are:
     
    4825Those extra modules are small: light dependencies.
    4926
    50 To run the script, put your XML into bugs.xml and
    51 receive your CSV as bugs.csv - do not forget to
    52 read or store the output. It will give you a list
    53 of all converted bugs and all attachments.
     27To run the script, put your XML into bugs.xml and receive your CSV as bugs.csv - do not forget to read or store the output. It will give you a list of all converted bugs and all attachments.
    5428
    55 Note that you have to copy attachments manually:
    56 The XML does not contain them and csv2trac does
    57 not handle them either. If you want to script a
    58 download of attachments from Bugzilla, they all
    59 have download URLs in the style of
    60 yourbugzilla.example.com/dir/attachment.cgi?id=N
    61 where N is their attachment number / ID value.
     29Note that you have to copy attachments manually: The XML does not contain them and csv2trac does not handle them either. If you want to script a download of attachments from Bugzilla, they all have download URLs in the style of yourbugzilla.example.com/dir/attachment.cgi?id=N where N is their attachment number / ID value.
    6230
    6331----
    6432
    65 The script combines all posts about one bug into
    66 one string for TRAC usage. Wiki markup keeps the
    67 posts in original layout, with headings about
    68 the who and when of the posts. Attachment meta
    69 data is also added there, using Wiki markup, as
    70 is information about duplicate-of, blocked-by
    71 and depends-on bug bug relations.
     33The script combines all posts about one bug into one string for TRAC usage. Wiki markup keeps the posts in original layout, with headings about the who and when of the posts. Attachment meta data is also added there, using Wiki markup, as is information about duplicate-of, blocked-by and depends-on bug bug relations.
    7234
    73 Bugs are normally converted to defects, but if
    74 the severity is enhancement, they are converted
    75 as enhancements. The type called task is never
    76 used by the current version of the script.
     35Bugs are normally converted to defects, but if the severity is enhancement, they are converted as enhancements. The type called task is never used by the current version of the script.
    7736
    78 The isobsolete, ispatch and isprivate flags of
    79 Bugzilla attachments and the global properties
    80 of maintainer, urlbase and version of Bugzilla
    81 itself are not converted (although the latter
    82 three are logged to standard output). The name
    83 attribute of users is also not converted, the
    84 script copies the user name / email instead.
     37The isobsolete, ispatch and isprivate flags of Bugzilla attachments and the global properties of maintainer, urlbase and version of Bugzilla itself are not converted (although the latter three are logged to standard output). The name attribute of users is also not converted, the script copies the user name / email instead.
    8538
    86 The Bugzilla bug number is used as start of
    87 the bug title (e.g. "bug 42: internet broken")
    88 because TRAC has to use other ticket numbers.
     39The Bugzilla bug number is used as start of the bug title (e.g. "bug 42: internet broken") because TRAC has to use other ticket numbers.
    8940
    90 The versions unspecified and svn HEAD are not
    91 copied and the milestones --- and *unspecified*
    92 are not copied. They are converted into empty
    93 strings. The component field is converted as
    94 keywords like Component_examplecomponent but
    95 the value core is not converted.
     41The versions unspecified and svn HEAD are not copied and the milestones --- and *unspecified* are not copied. They are converted into empty strings. The component field is converted as keywords like Component_examplecomponent but the value core is not converted.
    9642
    97 The flags reporter_accessible, cclist_accessible,
    98 classification and ..._id and everconfirmed are
    99 not converted.
     43The flags reporter_accessible, cclist_accessible, classification and ..._id and everconfirmed are not converted.
    10044
    101 The rep_platform is converted as a keyword like
    102 Reporter_Macintosh unless the value was All.
    103 The op_sys is converted as keyword as well, e.g.
    104 OS_Linux, unless the value was originally All.
     45The rep_platform is converted as a keyword like Reporter_Macintosh unless the value was All. The op_sys is converted as keyword as well, e.g. OS_Linux, unless the value was originally All.
    10546
    106 Resolutions FIXED, INVALID, WONTFIX, DUPLICATE
    107 and WORKSFORME are converted to lower case to
    108 fit into TRAC syntax. Open bugs have the empty
    109 string as resolution state. Also, states as
    110 NEW, ASSIGNED, REOPENED, CLOSED and RESOLVED
    111 are converted to lower case for TRAC and the
    112 value RESOLVED is replaced by closed for TRAC.
     47Resolutions FIXED, INVALID, WONTFIX, DUPLICATE and WORKSFORME are converted to lower case to fit into TRAC syntax. Open bugs have the empty string as resolution state. Also, states as NEW, ASSIGNED, REOPENED, CLOSED and RESOLVED are converted to lower case for TRAC and the value RESOLVED is replaced by closed for TRAC.
    11348
    114 Priorities P1 to P5 are mapped to TRAC strings
    115 highest, high, normal, low, lowest respectively.
    116 Severities blocker, critical, major, normal,
    117 minor, trivial and enhancement are copied as
    118 is, but if severity is enhancement then the
    119 type enhancement is used instead of defect.
     49Priorities P1 to P5 are mapped to TRAC strings highest, high, normal, low, lowest respectively. Severities blocker, critical, major, normal, minor, trivial and enhancement are copied as is, but if severity is enhancement then the type enhancement is used instead of defect.
    12050
    12151----
     
    13565----
    13666
    137 It turned out to be necessary to update csv2trac.2.py
    138 to process even bugs with special characters in their
    139 discussion or title, so I also provide a patch for the
    140 csv2trac script. In short, the original
     67It turned out to be necessary to update csv2trac.2.py to process even bugs with special characters in their discussion or title, so I also provide a patch for the csv2trac script. In short, the original
    14168
    14269{{{
     
    14471}}}
    14572
    146 style syntax was using values inline, causing SQL
    147 injection style problems. The patched script uses
     73style syntax was using values inline, causing SQL injection style problems. The patched script uses
    14874
    14975{{{
     
    15985}}}
    16086
    161 at one place to allow non-ASCII chars in the content.
    162 Be aware that other fields do not use decode yet, so
    163 e.g. component names or version numbers still have to
    164 be plain ASCII even with my patch applied to csv2trac.
    165 
     87at one place to allow non-ASCII chars in the content. Be aware that other fields do not use decode yet, so e.g. component names or version numbers still have to be plain ASCII even with my patch applied to csv2trac.