Project

General

Profile

RedmineMigrate » History » Version 34

Hideyuki KATO, 2020-07-30 15:12

1 17 Jean-Philippe Lang
h1. Migrating from other systems
2 1 Jean-Philippe Lang
3
{{>TOC}}
4
5
h2. Trac
6
7 34 Hideyuki KATO
*Obsolete: Does not work*
8
9 1 Jean-Philippe Lang
The Trac importer migrates:
10 17 Jean-Philippe Lang
11 1 Jean-Philippe Lang
    * Users
12
    * Components
13
    * Milestones
14
    * Tickets
15
    * Ticket comments and changes (status and resolution)
16 7 Jean-Philippe Lang
    * Trac specific fields (eg. Resolution) are added as custom fields in Redmine
17 1 Jean-Philippe Lang
    * Ticket files and custom fields
18
    * Wiki pages with history
19
20
Notes:
21
22 8 Jean-Philippe Lang
# User passwords are all set to @trac@
23 7 Jean-Philippe Lang
# Ticket ids are preserved if there's no ticket in your Redmine database yet
24 8 Jean-Philippe Lang
# Custom fields are all created as text custom fields in Redmine
25 1 Jean-Philippe Lang
26 11 Barbara Post
You need the sqlite-ruby gem to access the Trac database.
27
28
- For sqlite: <pre>gem install sqlite-ruby</pre>
29
- For sqlite3: <pre>gem install sqlite3-ruby</pre>
30 1 Jean-Philippe Lang
31
Before starting, you need a fresh Redmine database, *with default data loaded (required)*. See [[RedmineInstall|Redmine installation]].
32 3 Jean-Philippe Lang
33 12 Barbara Post
The script was tested with a 0.10 Trac sqlite database and a 0.11 Trac sqlite3 database.
34 1 Jean-Philippe Lang
35
1. Run the following command, where test is your Redmine target environment:
36
37
  rake redmine:migrate_from_trac RAILS_ENV="test"
38 2 Jean-Philippe Lang
39 22 James Rowe
2. The script (source:trunk/lib/tasks/migrate_from_trac.rake) asks you for your Trac settings:
40 1 Jean-Philippe Lang
41
<pre>
42
Trac directory []: /var/trac/myproject
43 7 Jean-Philippe Lang
Trac database adapter (sqlite, sqlite3, mysql, postgresql) [sqlite]:
44 1 Jean-Philippe Lang
Database encoding [UTF-8]:
45
Target project identifier []: myproject
46
</pre>
47
48 7 Jean-Philippe Lang
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.
49
When using a mysql or postgresql Trac database, the script will ask you for the connection parameters (host, database name, username and password).
50 1 Jean-Philippe Lang
Target project identifier is the identifier of the Redmine project in which the data will be loaded (the project is created if not found).
51
52 31 Robert Schneider
3. The script migrates your data:
53 1 Jean-Philippe Lang
54
<pre>
55
Deleting data
56
Migrating components..............................
57
Migrating milestones..............
58
Migrating custom fields.......
59
Migrating tickets.................................
60
Migrating wiki...........
61
62
Components: 29/30
63
Milestones: 14/14
64
Tickets: 1275/1275
65
Ticket files: 106/106
66
Custom values: 4409/4409
67
Wiki edits: 102/102
68
</pre>
69
70
The script gives you the total number of migrated objects.
71 7 Jean-Philippe Lang
Now, you should see a project called Myproject in Redmine with your Trac data loaded in this project.
72 1 Jean-Philippe Lang
73
h2. Mantis
74 34 Hideyuki KATO
75
*Obsolete: Does not work*
76 1 Jean-Philippe Lang
77
The Mantis importer migrates:
78
79
    * Users
80
    * Projects
81
    * Project versions, categories and news
82
    * Project memberships
83
    * Bugs
84
    * Bug notes, files, relations and monitors
85
    * Custom fields
86
87
User passwords are all set to "mantis".
88
89 8 Jean-Philippe Lang
Bug files migration only works if they're stored in your Mantis database (this is the default Mantis behaviour).
90 1 Jean-Philippe Lang
91
The script was tested with different 1.0.x Mantis databases and should work with any other recent versions.
92 5 Jean-Philippe Lang
93
Before starting, you need a fresh Redmine database, *with default data loaded (required)*. See [[RedmineInstall|Redmine installation]].
94 21 Terence Mill
When migrating into filled Redmine database, you can use "Ulrichs":email://uk@fortrabbit.de "Non-destructive migration Script":http://blog.foaa.de/2010/04/non-destructive-migration-from-mantis-to-redmine/
95 1 Jean-Philippe Lang
96 30 Toshi MARUYAMA
Make sure to apply the patch #10504.
97 20 Terence Mill
98 1 Jean-Philippe Lang
1. Run the following command, where test is your Redmine target environment:
99
100 2 Jean-Philippe Lang
  rake redmine:migrate_from_mantis RAILS_ENV="test"
101 1 Jean-Philippe Lang
102
2. The script asks you for your Mantis database settings:
103
104
<pre>
105
Please enter settings for your Mantis database
106
adapter [mysql]:
107
host [localhost]:
108
database [bugtracker]: mantis
109
username [root]:
110
password []:
111
encoding [UTF-8]:
112
</pre>
113
114
Give the adapter, host name, database name, login, password and encoding of your Mantis database, or leave the default values.
115
116
The adapter can be mysql (default) or postgresql.
117
118
3. The script migrates your data:
119
120
<pre>
121
Migrating users...............
122
Migrating projects.............
123
Migrating bugs........................................
124
Migrating news...
125
Migrating custom fields..
126
127
Users: 15/15
128
Projects: 13/13
129
Memberships: 10/10
130
Versions: 33/33
131
Categories: 4/4
132
Bugs: 180/180
133
Bug notes: 336/336
134
Bug files: 46/46
135
Bug relations: 11/11
136
Bug monitors: 8/8
137
News: 3/3
138
Custom fields: 2/2
139
</pre>
140
141
The script gives you the total number of migrated objects.
142 32 Robert Schneider
143 18 Jean-Philippe Lang
h2. Other systems and third-party scripts
144 9 Jean-Philippe Lang
145 18 Jean-Philippe Lang
You can find other importers created by Redmine users:
146
147 20 Terence Mill
* "Non-destructive migration from Mantis to Redmine":http://blog.foaa.de/2010/04/non-destructive-migration-from-mantis-to-redmine/
148 33 Timon Eckert
> * No support anymore
149 9 Jean-Philippe Lang
* Jira importer: #1385
150 19 Ralph Juhnke
* Bugzilla importer: #989 There are currently two bugzilla importers. bz2redmine http://github.com/ralli/bz2redmine and migrate_from_bugzilla http://github.com/ralli/migrate_from_bugzilla. The bz2redmine preserves the original bugzilla bug numbers and the migrate_from_bugzilla rake task uses the ActiveRecord framework and may be used to migrate from and to postgresql databases.
151 18 Jean-Philippe Lang
* Scarab importer: #2928
152 1 Jean-Philippe Lang
* Migrate projects from another instance of Redmine: https://github.com/PowerKiKi/redmine-tools
153 33 Timon Eckert
-* "A trick to import data from Mantis":http://dotnetmarche.org/blogs/externalblogs/archive/2009/05/29/redmine-a-trick-to-import-data-from-mantis.aspx-
154 27 Jonathan Katon
* Migrate phpBugTracker-1.0.5 to Redmine 2.5: https://github.com/ottodude125/migrate_from_phpbt_to_redmine - Though not exact, this shares some similarities to the Mantis import script
155 14 Clauber Anjos
156 17 Jean-Philippe Lang
These scripts are neither tested nor supported.