Migrating Mantis Bugtracker data to Redmine in Linux

Publish date: Oct 15, 2017
Tags: linux, redmine, mantis bugtracker, ruby

So you have decided to migrate your data from Mantis to Redmine, and after hitting the migrate_from_mantis rake file, an error occurred. No worries, this article will step you through most of the issues which can arise as problematic during the migration.


I suppose you use Mysql for Mantis and anything Mysql or SQLite for Redmine. Now lets hear it for some common errors you might encounter.

Ruby Version Manager

To make sure that you can change and update ruby version at will, install RVM. Then just run:

/bin/bash –login
rvm install 2.4.2 (or whatever the latest version is)
rvm use 2.4.2


When you try to run the migration script(rake file: …/redmine/lib/tasks/migrate_from_mantis.rake) you may get the:

NoMethodError, custom field doesn't exist

This one is easy, just edit the ‘migrate_from_mantis.rake’ and change:


line to:

inheritance\_column = :none

Mysql adapter 0.4.9 missing

Make sure to run:

apt install libmysql-dev 
gem install mysql2

Red carpet error

For issues with red carpet run following commands:

gem update
gem install redcarpet rmagick
apt install imagemagick libmagickcore-dev libmagickwand-dev
gem install sqlite3 (if needed)
gem install nokogiri
bundle update
gem pristine -all

Psych error

If bundle update throws error that has to do with psych, just remove the reference:

rm -rf /usr/local/rvm/gems/ruby-2.4.2/gems/psych-2.2.4

If bundle install stops working, run:

gem install bundler

If mysql still throws an error, go to …/redmine/Gemfile and add:

gem “mysql2”, “~>0.4.9”

After that run bundle install.

At this point rake file should work, however there still might be an issue or two. If it fails at ‘migrating projects..’ and it has to do with bugtracker.mantis_project_category_table error, just go in to rake file and modify it like this:

vim /usr/share/redmine/lib/tasks/migrate\_from\_mantis
  1. Rename the mantis_project_category_table to mantis_category_table if needed.
  2. Comment out the code with ‘category’

And lastly, if you get the ‘Migrating users aborted! ActiveRecord::RecordInvalid: Validation failed: Email has already been taken’ kind of error for SQLite3, go ahead and remove those emails from the db this way:

.open /var/lib/dbconfig-common/sqlite3/redmine/instances/default/redmine_default (if thats where its located) 
DELETE FROM email_addresses;

After that the migration should work! Enjoy your new Redmine!