Project

General

Profile

RedmineMigrate » History » Version 31

Robert Schneider, 2015-07-12 22:04
Fixed numbering

1 17 Jean-Philippe Lang
h1. Migrating from other systems
2 1 Jean-Philippe Lang
3
{{>TOC}}
4
5
h2. Trac
6
7
The Trac importer migrates:
8 17 Jean-Philippe Lang
9 1 Jean-Philippe Lang
    * Users
10
    * Components
11
    * Milestones
12
    * Tickets
13
    * Ticket comments and changes (status and resolution)
14 7 Jean-Philippe Lang
    * Trac specific fields (eg. Resolution) are added as custom fields in Redmine
15 1 Jean-Philippe Lang
    * Ticket files and custom fields
16
    * Wiki pages with history
17
18
Notes:
19
20 8 Jean-Philippe Lang
# User passwords are all set to @trac@
21 7 Jean-Philippe Lang
# Ticket ids are preserved if there's no ticket in your Redmine database yet
22 8 Jean-Philippe Lang
# Custom fields are all created as text custom fields in Redmine
23 1 Jean-Philippe Lang
24 11 Barbara Post
You need the sqlite-ruby gem to access the Trac database.
25
26
- For sqlite: <pre>gem install sqlite-ruby</pre>
27
- For sqlite3: <pre>gem install sqlite3-ruby</pre>
28 1 Jean-Philippe Lang
29
Before starting, you need a fresh Redmine database, *with default data loaded (required)*. See [[RedmineInstall|Redmine installation]].
30 3 Jean-Philippe Lang
31 12 Barbara Post
The script was tested with a 0.10 Trac sqlite database and a 0.11 Trac sqlite3 database.
32 1 Jean-Philippe Lang
33
1. Run the following command, where test is your Redmine target environment:
34
35
  rake redmine:migrate_from_trac RAILS_ENV="test"
36 2 Jean-Philippe Lang
37 22 James Rowe
2. The script (source:trunk/lib/tasks/migrate_from_trac.rake) asks you for your Trac settings:
38 1 Jean-Philippe Lang
39
<pre>
40
Trac directory []: /var/trac/myproject
41 7 Jean-Philippe Lang
Trac database adapter (sqlite, sqlite3, mysql, postgresql) [sqlite]:
42 1 Jean-Philippe Lang
Database encoding [UTF-8]:
43
Target project identifier []: myproject
44
</pre>
45
46 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.
47
When using a mysql or postgresql Trac database, the script will ask you for the connection parameters (host, database name, username and password).
48 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).
49
50 31 Robert Schneider
3. The script migrates your data:
51 1 Jean-Philippe Lang
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 7 Jean-Philippe Lang
Now, you should see a project called Myproject in Redmine with your Trac data loaded in this project.
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 8 Jean-Philippe Lang
Bug files migration only works if they're stored in your Mantis database (this is the default Mantis behaviour).
86 1 Jean-Philippe Lang
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 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/
91 1 Jean-Philippe Lang
92 30 Toshi MARUYAMA
Make sure to apply the patch #10504.
93 20 Terence Mill
94 1 Jean-Philippe Lang
1. Run the following command, where test is your Redmine target environment:
95
96 2 Jean-Philippe Lang
  rake redmine:migrate_from_mantis RAILS_ENV="test"
97 1 Jean-Philippe Lang
98
2. The script asks you for your Mantis database settings:
99
100
<pre>
101
Please enter settings for your Mantis database
102
adapter [mysql]:
103
host [localhost]:
104
database [bugtracker]: mantis
105
username [root]:
106
password []:
107
encoding [UTF-8]:
108
</pre>
109
110
Give the adapter, host name, database name, login, password and encoding of your Mantis database, or leave the default values.
111
112
The adapter can be mysql (default) or postgresql.
113
114
3. The script migrates your data:
115
116
<pre>
117
Migrating users...............
118
Migrating projects.............
119
Migrating bugs........................................
120
Migrating news...
121
Migrating custom fields..
122
123
Users: 15/15
124
Projects: 13/13
125
Memberships: 10/10
126
Versions: 33/33
127
Categories: 4/4
128
Bugs: 180/180
129
Bug notes: 336/336
130
Bug files: 46/46
131
Bug relations: 11/11
132
Bug monitors: 8/8
133
News: 3/3
134
Custom fields: 2/2
135
</pre>
136
137
The script gives you the total number of migrated objects.
138 19 Ralph Juhnke
 
139 18 Jean-Philippe Lang
h2. Other systems and third-party scripts
140 9 Jean-Philippe Lang
141 18 Jean-Philippe Lang
You can find other importers created by Redmine users:
142
143 20 Terence Mill
* "Non-destructive migration from Mantis to Redmine":http://blog.foaa.de/2010/04/non-destructive-migration-from-mantis-to-redmine/
144 9 Jean-Philippe Lang
* Jira importer: #1385
145 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.
146 13 Lucas Panjer
* Scarab importer: #2928
147 18 Jean-Philippe Lang
* Mantis 1.2.0rc1: http://www.webismymind.be/page/fr/17/migrate-mantis-120rc1-to-redmine.html
148 23 Adrien Crivelli
* Migrate projects from another instance of Redmine: https://github.com/PowerKiKi/redmine-tools
149 24 Terence Mill
* "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
150 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
151 14 Clauber Anjos
152 17 Jean-Philippe Lang
These scripts are neither tested nor supported.