@@ -503,10 +503,20 task :migrate_from_mantis => :environment do | |||||
503 | # Make sure bugs can refer bugs in other projects |
|
503 | # Make sure bugs can refer bugs in other projects | |
504 | Setting.cross_project_issue_relations = 1 if Setting.respond_to? 'cross_project_issue_relations' |
|
504 | Setting.cross_project_issue_relations = 1 if Setting.respond_to? 'cross_project_issue_relations' | |
505 |
|
505 | |||
506 | # Turn off email notifications |
|
506 | old_notified_events = Setting.notified_events | |
507 | Setting.notified_events = [] |
|
507 | old_password_min_length = Setting.password_min_length | |
|
508 | begin | |||
|
509 | # Turn off email notifications temporarily | |||
|
510 | Setting.notified_events = [] | |||
|
511 | Setting.password_min_length = 4 | |||
|
512 | # Run the migration | |||
|
513 | MantisMigrate.establish_connection db_params | |||
|
514 | MantisMigrate.migrate | |||
|
515 | ensure | |||
|
516 | # Restore previous settings | |||
|
517 | Setting.notified_events = old_notified_events | |||
|
518 | Setting.password_min_length = old_password_min_length | |||
|
519 | end | |||
508 |
|
520 | |||
509 | MantisMigrate.establish_connection db_params |
|
|||
510 | MantisMigrate.migrate |
|
|||
511 | end |
|
521 | end | |
512 | end |
|
522 | end |
@@ -762,10 +762,19 namespace :redmine do | |||||
762 | prompt('Target project identifier') {|identifier| TracMigrate.target_project_identifier identifier} |
|
762 | prompt('Target project identifier') {|identifier| TracMigrate.target_project_identifier identifier} | |
763 | puts |
|
763 | puts | |
764 |
|
764 | |||
765 | # Turn off email notifications |
|
765 | old_notified_events = Setting.notified_events | |
766 | Setting.notified_events = [] |
|
766 | old_password_min_length = Setting.password_min_length | |
767 |
|
767 | begin | ||
768 | TracMigrate.migrate |
|
768 | # Turn off email notifications temporarily | |
|
769 | Setting.notified_events = [] | |||
|
770 | Setting.password_min_length = 4 | |||
|
771 | # Run the migration | |||
|
772 | TracMigrate.migrate | |||
|
773 | ensure | |||
|
774 | # Restore previous settings | |||
|
775 | Setting.notified_events = old_notified_events | |||
|
776 | Setting.password_min_length = old_password_min_length | |||
|
777 | end | |||
769 | end |
|
778 | end | |
770 | end |
|
779 | end | |
771 |
|
780 |
General Comments 0
You need to be logged in to leave comments.
Login now