GithubHelp home page GithubHelp logo

ukautz / mantis2redmine Goto Github PK

View Code? Open in Web Editor NEW
11.0 5.0 15.0 230 KB

Script to migrate mantis database to redmine

Home Page: http://blog.foaa.de/2010/04/non-destructive-migration-from-mantis-to-redmine/

Perl 100.00%

mantis2redmine's Introduction

This repo is no longer maintained. Get in touch if you want to continue the project yourself.

mantis2redmine

Description

  • Migrate existing Mantis database non-destructive (keeps your Redmine data).
  • Able to map Mantis data to coresponding Redmine data (eg users, projects and so on).
  • Fully user interactive (suggest what to map to what, but gives you the capability to change.. assume you have a highly configured Mantis installation).
  • Things you should keep in mind before migration: ** Custom fields of the type multi list are not supported in Redmine. ** Custom fields of the type checkbox with multiple values will be translated to simple lists. ** Migrates only attachment files which are stored in the database (default). ** Tested only with Mantis 1.2.0 (current) and Redmine 0.9.3 (debian current). ** Make a backup of your Redmine database BEFORE you run the script (eg mysqldump..)!

Install

Download the script, put it in some directory. Keep in mind, that it will create several small YAML files and save all attachment files from the Mantis database to disk.

Make it executable:

chmod +x mantis2redmine.pl

You need perl up and running. Also install prerequisite perl modules (YAML, DBIx::Simple). On debian that would be:

apt-get install libyaml-perl libdbix-simple-perl

Maybe create a configuration file. All command line parameters could be written in the file.

Example:

mantis_db_host = localhost
mantis_db_name = mantis
mantis_db_login = mantis_user
mantis_db_pass = mantis_password

redmine_db_host = localhost
redmine_db_name = redmine
redmine_db_login = redmine_user
redmine_db_pass = redmine_password

You can run the script with '--help' to see all possible parameters.

Usage

I suggest you run the script in dry-run-mode and setup the Mantis->Redmine mappings as you like (script will guide you through):

./mantis2redmine.pl -c config.file --dry_run

Even in dry-run-mode all your mappings will be stored in files in the current folder (store-<name>.map). If you want re-configure any mapping, simply remove the store-file and run the script again. Now make a backup of your Redmine database and run the script again:

./mantis2redmine.pl -c config.file --load_maps

This could take some time, depending on the size of your original Mantis database.

After the script finishes successfully check your Redmine installation. Probably you have to assign the imported (or existing) users to the projects (because Redmine supports groups the script doesn’t do that).

The last step is to copy all exported attachment files (default in ./attachments/ folder) in your Redmine file directory (in a "normal" Redmine installation this would be /files in your Redmine base dir; if you installed via debian apt-get it is in /var/lib/redmine/default/files).

Done.

mantis2redmine's People

Contributors

obones avatar prusa avatar pschuele avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mantis2redmine's Issues

Script does not support mysql character UTF-8?

when I use this script, it doesn't works.

The command line like this:
*** Stati ***

Mantis: Status
new : 10
feedback : 20
acknowledged : 30
confirmed : 40
assigned : 50
resolved : 80
closed : 90

Redmine: Status
?? : 1
??? : 2
??? : 3
?? : 4
??? : 5
??? : 6

Status translation
Mantis -> Redmine
10:new -> 1:??
20:feedback -> 4:??
30:acknowledged -> 1:??
40:confirmed -> 1:??
50:assigned -> 2:???
80:resolved -> 3:???
90:closed -> 3:???

the data in mysql has Chinese characters and the "??" are all Chinese.

mysql status:

mysql Ver 14.14 Distrib 5.5.32, for debian-linux-gnu (x86_64) using readline 6.2

Connection id: 1223
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.5.32-0ubuntu0.12.04.1 (Ubuntu)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /var/run/mysqld/mysqld.sock
Uptime: 4 hours 10 min 32 sec

Threads: 12 Questions: 346345 Slow queries: 0 Opens: 4690 Flush tables: 1 Open tables: 324 Queries per second avg: 23.040

Incompatible with Rdedmine 3.0.2

Hi,

It seems that Redmine changed the way emails are handled.
They are now stored in a table called email_addresses and the email field is removed from the users table.

Would it be possible to take this into account ?

Thank you very much,

Regards,

Fred

Error on 'fresh' Redmine

Hi, i have this error (reported below) when importing mantis data in a fresh install of redmine. A workaround is to simply create a fake project and a fake version on both mantis and redmine.

 *** Versions ***

Mantis: Version

Redmine: Version

Version translation
    Mantis               ->     Redmine             

Use of uninitialized value $last_mantis in concatenation (.) or string at ./mantis2redmine.pl line 1187, <STDIN> line 13.
Use of uninitialized value $last_mantis in hash element at ./mantis2redmine.pl line 1187, <STDIN> line 13.
Use of uninitialized value in concatenation (.) or string at ./mantis2redmine.pl line 1187, <STDIN> line 13.
Type 'ok' if you confirm or num:num  or num:-1 for create as new to change assignment
  eg :1 to change Version of '' to 'Test Version'
  type 'print' to show the Redmine/Mantis tabels again
(ok/num:num/print) > ok
Use of uninitialized value in numeric eq (==) at ./mantis2redmine.pl line 1113, <STDIN> line 14.
Can't use an undefined value as a HASH reference at ./mantis2redmine.pl line 1113, <STDIN> line 14.

How to set database port?

My database runs in a different port (8063). I've tried

redmine_db_host = localhost:8063

but your script doesn't work.

DBI connect('database=bitnami_redmine;host=localhost:8063','bitnami',...) failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) at ./mantis2redmine.pl line 207

I suspect that is only a simple problem with the dsn string for DBI, but I'm not used to Perl and I don't know how to fix it.

Thanks in advance.

Script failed with an error

I'm trying to migrate Mantis-1.2.14 to Redmine-2.3.0 using mantis2redmine perl script. The dry_run was successful and while running the final migration step(./mantis2redmine.pl -c config.file --load_maps), I got the following error:

Import Users
.............................................................................................OK
Import Projects
................................OK
Import Versions
..............................................OK
Import Categories
................................................................................................OK
Import Issues (. = Issue, - = Journal, + = Attachment)
.--.-.--.--.-.----------.--.---.--.-----------.--.-----.--.-----.--------DBD::mysql::st execute failed: Column 'user_id' cannot be null at ./mantis2redmine.pl line 913.

What's the root cause of this error and how can I fix this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.