wiki:ScarabToTracScript

Migrate Scarab issues to Trac tickets

Description

This is a script that migrates Scarab issues to Trac tickets. Scarab is an artefact tracking system released under the Apache license. It is currently developed in the Spanish locale only.

See also: t:TracImport

Bugs/Feature Requests

Existing bugs and feature requests for ScarabToTracScript are here.

If you have any issues, create a new ticket.

TODO

  1. Translate error messages to English.
  2. Improve validation errors.
  3. Implement tickets updating.
  4. Implement a console (vielleicht readline) to facilitate the importation.

Download

Download the zipped source from here.

Source

You can check out ScarabToTracScript from here using Subversion, or browse the source with Trac.

Installation

General instructions on installing Trac plugins can be found on the TracPlugins page.

Configuration

You must install the XmlRpcPlugin, because updates are done through it.

  1. Modify the configuration file, import-configuration.sample.xml. There are several sections:
    1. Common: scarab-attachments-path should be the path where the Scarab attachments are located:
      <common>
          <trac-xmlrpc-url>http://user:password@any-host-to-trac/projects/a-project/login/xmlrpc</trac-xmlrpc-url>
          <scarab-attachments-path>/tmp/scarab/attch_scarab</scarab-attachments-path>
      </common>
      
    2. Mappings between scarab users and Trac users
      <users-map>
         <user id-scarab="scarab-userA" id-trac="trac-userA" />
         <user id-scarab="scarab-userA" id-trac="trac-userB" />
      </users-map>
      
    3. Global mappings between Scarab and Trac form fields. The optional ignore attribute indicates that if the field does not exist in the Trac form, will be ignored. It is used to define fields to be used as part of other fields (in transformations). The transformation element indicates that before setting the value of these field there will be a Genshi transformation, using as Genshi's context a variable named ticket with all Scarab issue's fields, including those marked with ignore = true and also the aditional-attributes:
      <global-attributes-map>
          <attribute id-scarab="Para" id-trac="owner" />
          <attribute id-scarab="CC" id-trac="cc" ignore="true"/>
          <attribute id-scarab="Caso de Test" id-trac="summary">
              <transformation>$ticket.summary [Issue Scarab $ticket.id]</transformation>
          </attribute>
      </global-attributes-map>
      
    4. A scarab-artifact section: mappings for a particular Scarab issue type. additional-attributes Adds to Trac ticket (ticket-type attribute) associated with Scarab issue (type attribute). The value is also a Genshi transformation. Should have a scarab-artifact tag for each Scarab Issue type:
      <scarab-artifact type="Reporte Error QA" ticket-type="Defecto">
          <attributes-map>
             <!-- equal to globalattributes-map -->
          </attributes-map>
      
          <additional-attributes>
              <attribute id="description">
                  Ticket importado desde Scarab, ID = ${ticket.id}
                  {% if "descripcion_scarab" in ticket %}${ticket.descripcion_scarab}{% end %}
                  {% if "log" in ticket %}Log:
                     ${ticket.log}
                  {% end %}
                  {% if "observaciones_comentarios_mejoras" in ticket %}Observaciones, comentarios y mejoras:
                     $ticket.observaciones_comentarios_mejoras
                  {% end %}
              </attribute>
          </additional-attributes>
      
    5. A status-map: maps the status field between Scarab and Trac statuses:
      <status-map>
          <status id-scarab="Abierto" id-trac="new" />
          <status id-scarab='Resuelto' id-trac='closed' />
      </status-map>
      
  2. The scarab2trac.py script should run in a text terminal. With the "-h" parameter it prints the help:
    Usage: scarab2trac.py [options]
    
    Options:
      -h, --help            show this help message and exit
      -c CONF, --conf=CONF  Archivo de configuracion
      -s SCARAB, --scarab-issues=SCARAB
                            Archivo con los issues exportados desde Scarab
    
    

The CONF file was explained above. The SCARAB file must be a XML file, exported from Scarab (Scarab options: Admin -> Current module -> XML export issues).

Recent Changes

6590 by szaffarano on 2009-09-24 13:18:10
initial version
6589 by szaffarano on 2009-09-24 12:27:01
New hack ScarabToTracScript, created by szaffarano
(more)

Author/Contributors

Author: szaffarano
Maintainer: Sebastián Zaffarano
Contributors:

Last modified 8 years ago Last modified on Dec 14, 2015, 3:33:17 PM