Skip to content

Commit 48c7fef

Browse files
author
Tom Copeland
committed
Added some environment variables to skip various parts of the migration. Working on migrating files to attachments.
1 parent b176609 commit 48c7fef

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

README.rdoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ I found it helpful to add this to my <tt>~/.railsrc</tt>:
4949

5050
That way I don't have to type that <tt>require</tt> every time I get into <tt>script/console</tt> to troubleshoot a migration failure.
5151

52+
You can set various environment variables to skip parts of the migration: DONT_MIGRATE_DOCUMENTS, DONT_MIGRATE_TRACKERS, DONT_MIGRATE_FORUMS
53+
5254
Some notes on the differences between the GForge and the Redmine object models:
5355

5456
* GForge stores the user language setting as a foreign key into the <tt>supported_languages</tt> table. Redmine stores it as a two letter string (e.g., 'en') in <tt>users.language</tt>.

lib/tasks/migrate_from_gforge.rake

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ namespace :redmine do
7777
document_group.documents.each do |gforge_document|
7878
showing_migrated_ids(gforge_document) { gforge_document.convert_to_redmine_document_in(document_category) }
7979
end
80-
end
80+
end unless ENV['DONT_MIGRATE_DOCUMENTS']
8181
gforge_group.artifact_group_lists.each do |artifact_group_list|
8282
project.trackers << Tracker.find_by_name(artifact_group_list.corresponding_redmine_tracker_name) unless project.trackers.find_by_name(artifact_group_list.corresponding_redmine_tracker_name)
8383
artifact_group_list.artifacts.each do |artifact|
@@ -95,7 +95,7 @@ namespace :redmine do
9595
showing_migrated_ids(artifact_history) { artifact_history.convert_to_redmine_journal_on(issue) }
9696
end
9797
end
98-
end
98+
end unless ENV['DONT_MIGRATE_TRACKERS']
9999
gforge_group.forum_groups.active.each do |forum_group|
100100
board = forum_group.convert_to_redmine_board_in(project)
101101
board_threads = {}
@@ -118,6 +118,13 @@ namespace :redmine do
118118
forum_group.monitors.each do |monitor|
119119
showing_migrated_ids(monitor) { monitor.convert_to_redmine_watcher_on(board) }
120120
end
121+
end unless ENV['DONT_MIGRATE_FORUMS']
122+
gforge_group.packages.each do |package|
123+
package.releases.each do |release|
124+
release.files.each do |file|
125+
126+
end
127+
end
121128
end
122129
#end
123130
end

0 commit comments

Comments
 (0)