diff --git a/lib/tasks/migrate_from_mantis.rake b/lib/tasks/migrate_from_mantis.rake index d27ef77d..a7582a38 100644 --- a/lib/tasks/migrate_from_mantis.rake +++ b/lib/tasks/migrate_from_mantis.rake @@ -314,7 +314,7 @@ task :migrate_from_mantis => :environment do Issue.destroy_all issues_map = {} keep_bug_ids = (Issue.count == 0) - MantisBug.find(:all, :order => 'id ASC').each do |bug| + MantisBug.find_each(:batch_size => 200) do |bug| next unless projects_map[bug.project_id] && users_map[bug.reporter_id] i = Issue.new :project_id => projects_map[bug.project_id], :subject => encode(bug.summary), diff --git a/lib/tasks/migrate_from_trac.rake b/lib/tasks/migrate_from_trac.rake index 8640c935..1902af8d 100644 --- a/lib/tasks/migrate_from_trac.rake +++ b/lib/tasks/migrate_from_trac.rake @@ -458,7 +458,7 @@ namespace :redmine do # Tickets print "Migrating tickets" - TracTicket.find(:all, :order => 'id ASC').each do |ticket| + TracTicket.find_each(:batch_size => 200) do |ticket| print '.' STDOUT.flush i = Issue.new :project => @target_project,