プロジェクト

全般

プロフィール

Vote #63152

完了

Import Trac Data

Admin Redmine さんが4年以上前に追加. 4年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Importers_15
対象バージョン:
開始日:
2008/05/02
期日:
進捗率:

0%

予定工数:
category_id:
15
version_id:
3
issue_org_id:
1164
author_id:
936
assigned_to_id:
0
comments:
3
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

When doing an import of Trac data, I get the following errors. The problem line is 95 from redmine/lib/tasks/migrate_from_trac, a subset of which I included here:
91 class TracMilestone < ActiveRecord::Base
92 set_table_name :milestone
93
94 def due
95 if read_attribute(:due) > 0
96 Time.at(read_attribute(:due)).to_date
97 else
98 nil
99 end

I think the code needs to evaluate null values as well. I don't know Ruby syntax well enough to tackle this, but the logic should be something like "IF :due is not NULL and if due > 0 THEN ... else nil." Alternatively, could it be a sqlite version mismatch, which I have seen in other forums? It seems if this were the case, I would not have even gotten as far as I did in the import.

Can anyone verify if my approach is correct, and then perhaps help me with getting the syntax correct in the import code? Trace is included as well. Thanks in advance.

rake --trace redmine:migrate_from_trac RAILS_ENV="production"
(in /root/redmine)
** Invoke redmine:migrate_from_trac (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:migrate_from_trac

WARNING: a new project will be added to Redmine during this process.
Are you sure you want to continue ? [y/N] y

Trac directory []: /mnt/atkins/m4l
Trac database adapter (sqlite, sqlite3, mysql, postgresql) [sqlite]: sqlite3
Trac database encoding [UTF-8]:
Target project identifier []: m4l

Migrating components...........
Migrating milestones.......rake aborted!
undefined method >' for nil:NilClass
/root/redmine/lib/tasks/migrate_from_trac.rake:95:in
due'
/root/redmine/lib/tasks/migrate_from_trac.rake:309:in migrate'
/root/redmine/lib/tasks/migrate_from_trac.rake:303:in
each'
/root/redmine/lib/tasks/migrate_from_trac.rake:303:in migrate'
/root/redmine/lib/tasks/migrate_from_trac.rake:643
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in
call'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in
each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in
invoke_with_call_chain'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in synchronize'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in
invoke_with_call_chain'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in invoke'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1931:in
invoke_task'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in
each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in
standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1903:in top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1881:in
run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1878:in
run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/bin/rake:31
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19


journals

> the logic should be something like "IF :due is not NULL and if due > 0 THEN ... else nil."

You can try to replace line 95 with:

if read_attribute(:due) && read_attribute(:due) > 0

Please, let me know if it fixes your problem.
--------------------------------------------------------------------------------
Worked like a champ. Here are the results. We are just now evaluating Redmine to replace PVCS Tracker and Trac. So far, it has been a great experience. Thanks for doing so much work on it. Now we just need to figure out now how to convert data from PVCS. Perhaps we will go from PVCS csv files to Trac to Redmine. If you have any ideas, we'd love to hear them. Thanks again.

Migrating components...........
Migrating milestones.........
Migrating custom fields
Migrating tickets..................................................................................................................................................................................................................
Migrating wiki...........

Components: 0/11
Milestones: 3/9
Tickets: 210/210
Ticket files: 1/1
Custom values: 0/0
Wiki edits: 11/11
Wiki files: 0/0

--------------------------------------------------------------------------------
Fix applied in r1406. Thanks for the feedback.
Don't have much idea for your PVCS data, sorry.
--------------------------------------------------------------------------------

Admin Redmine さんが4年以上前に更新

  • カテゴリImporters_15 にセット
  • 対象バージョン0.7.1_3 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0