Project

General

Profile

Actions

Patch #18496

open

Migrate to Redmine 2.5.3 (or 2.6.0) from Mantis 1.2.17

Added by Gergely Révész almost 10 years ago. Updated almost 10 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Importers
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Migrate to Redmine 2.5.3 (or 2.6.0) from Mantis 1.2.17.

The original migrate script quits with errors when migrating from Mantis 1.2.17.
I'm attaching the patch to get it to work.
And the working full "migrate_from_mantis.rake" file if anyone finds it difficult to apply a patch.

You have to patch or replace the "%redmine%/lib/tasks/migrate_from_mantis.rake" file.


Files

migrate_mantis_1.2.17_to_redmine_2.5.3.patch (2.4 KB) migrate_mantis_1.2.17_to_redmine_2.5.3.patch Patch file Gergely Révész, 2014-11-28 15:00
migrate_from_mantis.rake (18.5 KB) migrate_from_mantis.rake Full file Gergely Révész, 2014-11-28 15:00
Actions #1

Updated by Gergely Révész almost 10 years ago

The changes in detail:

1. In the mantis 1.2.17 database, the category table is called "mantis_category_table".
- self.table_name = :mantis_project_category_table
+ self.table_name = :mantis_category_table

2. The Mantis note timestamp is an integer, it have to be converted with "Time.at().to_datetime".
- :created_on => note.date_submitted
+ :created_on => Time.at(note.date_submitted).to_datetime

3. The Mantis file attachment timestamp is an integer, it have to be converted with "Time.at().to_datetime".
- a = Attachment.new :created_on => file.date_added
+ a = Attachment.new :created_on => Time.at(file.date_added).to_datetime

4. The Redmine category column in the issues table is called "category_id".
- i.category = IssueCategory.find_by_project_id_and_name(i.project_id, bug.category[0,30]) unless bug.category.blank?
+ i.category = IssueCategory.find_by_project_id_and_name(i.project_id, bug.category_id0) unless bug.category_id.blank?

5. The Mantis bug create and update timestamp is an integer, it have to be converted with "Time.at().to_datetime". This doesn't work even with the converted dates, because Redmine doesn't let you set the created_on and updated_on values when creating a new issue. It will be the current date.
- :created_on => bug.date_submitted,
- :updated_on => bug.last_updated
+ :created_on => Time.at(bug.date_submitted).to_datetime,
+ :updated_on => Time.at(bug.last_updated).to_datetime

Actions #2

Updated by Gergely Révész almost 10 years ago

  • Status changed from New to Resolved
Actions #3

Updated by Andre Luiz almost 10 years ago

  • File total_5_6_7.jpg added
Actions #4

Updated by Jean-Philippe Lang almost 10 years ago

  • File deleted (total_5_6_7.jpg)
Actions #5

Updated by Toshi MARUYAMA almost 10 years ago

  • Category changed from Administration to Importers
Actions

Also available in: Atom PDF