Project

General

Profile

RedmineMigrate » History » Version 6

Jean-Philippe Lang, 2007-11-10 20:59

1 1 Jean-Philippe Lang
h1. Migrating from other systems
2
3
{{>TOC}}
4
5
h2. Trac
6
7
The Trac importer migrates:
8
9
    * Users
10
    * Components
11
    * Milestones
12
    * Tickets
13
    * Ticket comments and changes (status and resolution)
14
    * Ticket files and custom fields
15
    * Wiki pages with history
16
17
Notes:
18
19
# User passwords are all set to ‘trac’
20
# Ticket ids are preserved
21
# Custom fields are all created as ‘text’ custom fields in Redmine
22
23
You need the sqlite-ruby gem (gem install sqlite-ruby) to access the Trac database.
24
25 5 Jean-Philippe Lang
Before starting, you need a fresh Redmine database, *with default data loaded (required)*. See [[RedmineInstall|Redmine installation]].
26
27 3 Jean-Philippe Lang
The script was tested with a 0.10 Trac sqlite database and should work with 0.11 databases. It only supports SQLite Trac databases for now.
28 6 Jean-Philippe Lang
29
Note: if your Trac database is a sqlite3 database and if you're using Redmine 0.6.0 release or < r894, you'll have to make a slight change to @lib/tasks/migrate_from_trac.rake@:
30 1 Jean-Philippe Lang
31 3 Jean-Philippe Lang
<pre>
32
- TracMigrate.establish_connection({:adapter => 'sqlite',
33
+ TracMigrate.establish_connection({:adapter => 'sqlite3',
34
</pre>
35 1 Jean-Philippe Lang
36
1. Run the following command, where test is your Redmine target environment:
37
38 2 Jean-Philippe Lang
  rake redmine:migrate_from_trac RAILS_ENV="test"
39 1 Jean-Philippe Lang
40
2. The script asks you for your Trac settings:
41
42
<pre>
43
Trac directory []: /var/trac/myproject
44
Database encoding [UTF-8]:
45
Target project identifier []: myproject
46
</pre>
47
48
Trac directory is the root directory of your Trac environment. Redmine will look in this directory for db/trac.db and attachments directory.
49
Target project identifier is the identifier of the Redmine project in which the data will be loaded (the project is created if not found).
50
51
4. The script migrates your data:
52
53
<pre>
54
Deleting data
55
Migrating components..............................
56
Migrating milestones..............
57
Migrating custom fields.......
58
Migrating tickets.................................
59
Migrating wiki...........
60
61
Components: 29/30
62
Milestones: 14/14
63
Tickets: 1275/1275
64
Ticket files: 106/106
65
Custom values: 4409/4409
66
Wiki edits: 102/102
67
</pre>
68
69
The script gives you the total number of migrated objects.
70 4 Jean-Philippe Lang
Now, you should see a project called Myproject in Redmine with your Trac data loaded in this project. You may need to enable the issue tracking and wiki modules in the project settings if the project was automatically created by the migration script.
71 1 Jean-Philippe Lang
72
h2. Mantis
73
74
The Mantis importer migrates:
75
76
    * Users
77
    * Projects
78
    * Project versions, categories and news
79
    * Project memberships
80
    * Bugs
81
    * Bug notes, files, relations and monitors
82
    * Custom fields
83
84
User passwords are all set to "mantis".
85
86
Bug files migration only works if they’re stored in your Mantis database (this is the default Mantis behaviour).
87
88
The script was tested with different 1.0.x Mantis databases and should work with any other recent versions.
89 5 Jean-Philippe Lang
90
Before starting, you need a fresh Redmine database, *with default data loaded (required)*. See [[RedmineInstall|Redmine installation]].
91 1 Jean-Philippe Lang
92
1. Run the following command, where test is your Redmine target environment:
93
94 2 Jean-Philippe Lang
  rake redmine:migrate_from_mantis RAILS_ENV="test"
95 1 Jean-Philippe Lang
96
2. The script asks you for your Mantis database settings:
97
98
<pre>
99
Please enter settings for your Mantis database
100
adapter [mysql]:
101
host [localhost]:
102
database [bugtracker]: mantis
103
username [root]:
104
password []:
105
encoding [UTF-8]:
106
</pre>
107
108
Give the adapter, host name, database name, login, password and encoding of your Mantis database, or leave the default values.
109
110
The adapter can be mysql (default) or postgresql.
111
112
3. The script migrates your data:
113
114
<pre>
115
Migrating users...............
116
Migrating projects.............
117
Migrating bugs........................................
118
Migrating news...
119
Migrating custom fields..
120
121
Users: 15/15
122
Projects: 13/13
123
Memberships: 10/10
124
Versions: 33/33
125
Categories: 4/4
126
Bugs: 180/180
127
Bug notes: 336/336
128
Bug files: 46/46
129
Bug relations: 11/11
130
Bug monitors: 8/8
131
News: 3/3
132
Custom fields: 2/2
133
</pre>
134
135
The script gives you the total number of migrated objects.