Search This Website

Tuesday, 20 October 2009

Migrating from Trac to Redmine

Trac

The Trac importer migrates:
  • Users
  • Components
  • Milestones
  • Tickets
  • Ticket comments and changes (status and resolution)
  • Trac specific fields (eg. Resolution) are added as custom fields in Redmine
  • Ticket files and custom fields
  • Wiki pages with history
Notes:
  1. User passwords are all set to trac
  2. Ticket ids are preserved if there's no ticket in your Redmine database yet
  3. Custom fields are all created as text custom fields in Redmine
You need the sqlite-ruby gem to access the Trac database.

     gem install sqlite-ruby

Before starting, you need a fresh Redmine database, with default data loaded (required). See Redmine installation by clicking on the left menu.


Step 1:
Run the following command, where test is your Redmine target environment:

 
      rake redmine:migrate_from_trac RAILS_ENV="test"


Step 2:
The script asks you for your Trac settings:

Trac directory []: /var/trac/myproject
     Trac database adapter (sqlite, sqlite3, mysql, postgresql) [sqlite]:
     Database encoding [UTF-8]:
     Target project identifier []: myproject
Trac directory is the root directory of your Trac environment. 
Redmine will look in this directory for db/trac.db (if you choose 
sqlite/sqlite3 database) and the attachments directory.
Whenusing a mysql or postgresql Trac database, the script will ask 
you for the connection parameters (host, database name, username and 
password). Targetproject identifier is the identifier of the Redmine project in which
the data will be loaded (the project is created if not found).
 
The script gives you the total number of migrated objects.
Now, you should see a project called Myproject in Redmine with your 
Trac data loaded in this project. 

No comments:

Post a Comment