|
|
|
@ -331,6 +331,7 @@ task :migrate_from_mantis => :environment do |
|
|
|
|
next unless i.save |
|
|
|
|
issues_map[bug.id] = i.id |
|
|
|
|
print '.' |
|
|
|
|
STDOUT.flush |
|
|
|
|
|
|
|
|
|
# Assignee |
|
|
|
|
# Redmine checks that the assignee is a project member |
|
|
|
@ -378,6 +379,7 @@ task :migrate_from_mantis => :environment do |
|
|
|
|
r.issue_to = Issue.find_by_id(issues_map[relation.destination_bug_id]) |
|
|
|
|
pp r unless r.save |
|
|
|
|
print '.' |
|
|
|
|
STDOUT.flush |
|
|
|
|
end |
|
|
|
|
puts |
|
|
|
|
|
|
|
|
@ -393,6 +395,7 @@ task :migrate_from_mantis => :environment do |
|
|
|
|
n.author = User.find_by_id(users_map[news.poster_id]) |
|
|
|
|
n.save |
|
|
|
|
print '.' |
|
|
|
|
STDOUT.flush |
|
|
|
|
end |
|
|
|
|
puts |
|
|
|
|
|
|
|
|
@ -409,7 +412,7 @@ task :migrate_from_mantis => :environment do |
|
|
|
|
:is_required => field.require_report? |
|
|
|
|
next unless f.save |
|
|
|
|
print '.' |
|
|
|
|
|
|
|
|
|
STDOUT.flush |
|
|
|
|
# Trackers association |
|
|
|
|
f.trackers = Tracker.find :all |
|
|
|
|
|
|
|
|
@ -475,6 +478,7 @@ task :migrate_from_mantis => :environment do |
|
|
|
|
|
|
|
|
|
puts "WARNING: Your Redmine data will be deleted during this process." |
|
|
|
|
print "Are you sure you want to continue ? [y/N] " |
|
|
|
|
STDOUT.flush |
|
|
|
|
break unless STDIN.gets.match(/^y$/i) |
|
|
|
|
|
|
|
|
|
# Default Mantis database settings |
|
|
|
@ -494,6 +498,7 @@ task :migrate_from_mantis => :environment do |
|
|
|
|
|
|
|
|
|
while true |
|
|
|
|
print "encoding [UTF-8]: " |
|
|
|
|
STDOUT.flush |
|
|
|
|
encoding = STDIN.gets.chomp! |
|
|
|
|
encoding = 'UTF-8' if encoding.blank? |
|
|
|
|
break if MantisMigrate.encoding encoding |
|
|
|
|