Project

General

Profile

RedmineMigrate » History » Version 5

Jean-Philippe Lang, 2007-11-09 14:16

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