Project

General

Profile

Migration from mantis

Added by Demid Lupin about 13 years ago

I try to migrate from mantis to redmine, and use migrate_from_mantis.rake
All is ok except one thing
In all issues field "updated" is changed to timestamp of migration

When we create new issue from mantis bug we populate files with correct value

migrate_from_mantis.rake on near line 315

            i = Issue.new :project_id => projects_map[bug.project_id], 
                      :subject => encode(bug.summary),
                      :description => encode(bug.bug_text.full_description),
                      :priority => PRIORITY_MAPPING[bug.priority] || DEFAULT_PRIORITY,
                      :created_on => bug.date_submitted,
                      :updated_on => bug.last_updated

but some where in the next lines we update issue, so field is automatically changed to current time

So my question is
How i could disable this automatic handler for migration. Temporally change some code somewhere?

Thank's


Replies (5)

RE: Migration from mantis - Added by Charles Sporkman almost 13 years ago

I'm running into the same issue. I keep going over the migration script and the schema on both databases and I just can't figure out why the "updated on" data does not get inserted. Like the OP, all my updated dates are the date/time when the migration script was run. Also like him, I went through the migration script and landed in the same place.

Things I've looked at so far:

-In my mantis db, I see the column is of type "datetime", the table/column name matches (bug.last_updated) and the data appears normal.
-In the redmine db, I also verified that the table, column and type match what the import script has for names.
-The mantis "date_submitted" column is being properly imported.
-The script is reporting no errors and my first look through the imported data seems to indicate everything else imported correctly.
-I don't see any other part of the migrate task that might overwrite the "updated_on" value.

Is there any other info I can provide to help troubleshoot this? Losing the updated date is a tough one for us.

Thanks

RE: Migration from mantis - Added by adrian perez over 3 years ago

Hello community, has the problem been solved? Please share the solution. Thank you very much.

RE: Migration from mantis - Added by ken hsu 10 days ago

Hello Demid and Charles,

I am new to migrating from Mantis to Redmine. May I have the instruction guide or migration procedures if you don’t mind sharing? Any comments or suggestions are welcome. Thank you.

########
Environment:
Redmine version 5.1.2.stable
Ruby version 3.2.3-p157 (2024-01-18) [x86_64-linux]
Rails version 6.1.7.7
Environment production
Database adapter Mysql2
Mailer queue ActiveJob::QueueAdapters::AsyncAdapter
Mailer delivery smtp

RE: Migration from mantis - Added by Charles Sporkman 9 days ago

Wow! 2011!

So I have some notes that I'll include here, but I really don't remember much about this.

Migration

Bug in regex match for project identifiers, dist is:

read_attribute(:name).gsub(/[^a-z0-9\-]+/, '-').slice(0, Project::IDENTIFIER_MAX_LENGTH)

lowercase it before the gsub:

read_attribute(:name).downcase.gsub(/[^a-z0-9\-]+/, '-').slice(0, Project::IDENTIFIER_MAX_LENGTH)

Project membership does not seem to be imported.  The redmine table "members" 
seems to have the user/project mapping.  If you just want to add everyone, get
all user ids and all project ids and then do an insert:

INSERT INTO members values ('','$user_id','$project_id','','')

2, 18, 3 - proj already set
1, 12, 13, 14, 15, 16, 20 - active users
4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 26 - proj todo

I see I have a separate .sql file that only has updates for created date/time (this feels kind of dodgy, but maybe it's helpful):
UPDATE issues SET updated_on='2008-01-03 11:38:59' WHERE created_on='2007-11-30 14:40:05';
UPDATE issues SET updated_on='2007-12-03 14:18:22' WHERE created_on='2007-12-03 09:34:45';
UPDATE issues SET updated_on='2011-04-05 16:53:56' WHERE created_on='2007-12-03 11:28:58';
UPDATE issues SET updated_on='2007-12-10 11:37:12' WHERE created_on='2007-12-03 23:46:42';
UPDATE issues SET updated_on='2007-12-04 16:50:51' WHERE created_on='2007-12-04 15:41:59';
UPDATE issues SET updated_on='2011-04-05 16:53:44' WHERE created_on='2007-12-04 16:57:10';

Regardless, I know that we did quite a bit of massaging of data. Also, 11 years ago, so probably a very different version of both mantis and redmine...

RE: Migration from mantis - Added by ken hsu 9 days ago

Charles Sporkman wrote in RE: Migration from mantis:

Wow! 2011!

So I have some notes that I'll include here, but I really don't remember much about this.

[...]

I see I have a separate .sql file that only has updates for created date/time (this feels kind of dodgy, but maybe it's helpful):

[...]

Regardless, I know that we did quite a bit of massaging of data. Also, 11 years ago, so probably a very different version of both mantis and redmine...

Hello Charles, its so nice to receive your reply and my appreciation, will try later and thank you very much again.

    (1-5/5)