]> source.dussan.org Git - redmine.git/commitdiff
Makes migration scripts load tickets in batches (#4011).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 11 Oct 2009 10:12:07 +0000 (10:12 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 11 Oct 2009 10:12:07 +0000 (10:12 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2923 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/tasks/migrate_from_mantis.rake
lib/tasks/migrate_from_trac.rake

index d27ef77d3ac7fc8c219f4049c393470eb461e79c..a7582a38a442c16998fb3cb404c37c1039756946 100644 (file)
@@ -314,7 +314,7 @@ task :migrate_from_mantis => :environment do
       Issue.destroy_all\r
       issues_map = {}\r
       keep_bug_ids = (Issue.count == 0)\r
-      MantisBug.find(:all, :order => 'id ASC').each do |bug|\r
+      MantisBug.find_each(:batch_size => 200) do |bug|\r
         next unless projects_map[bug.project_id] && users_map[bug.reporter_id]\r
        i = Issue.new :project_id => projects_map[bug.project_id], \r
                       :subject => encode(bug.summary),\r
index 8640c93575d5427213876aaa4223724a8c399bf3..1902af8d0228d13f4a67f37bfc0bb6dbd2c034ea 100644 (file)
@@ -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,