プロジェクト

全般

プロフィール

Vote #68588

未完了

migrate_from_trac and trac 0.12

Admin Redmine さんが約2年前に追加. 約2年前に更新.

ステータス:
Reopend
優先度:
通常
担当者:
-
カテゴリ:
Importers_15
開始日:
2010/11/11
期日:
進捗率:

0%

予定工数:
category_id:
15
version_id:
33
issue_org_id:
6868
author_id:
23551
assigned_to_id:
0
comments:
13
status_id:
8
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Reopend]

説明

When I migrate from my Trac 0.12 database using sqlite3. I encounter this error :

Not knowing much about ruby I have some problems finding where it comes from

www-data@myserver:~/public/ruby/redmine-1.0.3$ rake redmine:migrate_from_trac RAILS_ENV="production" --trace
(in /home/www-data/public/ruby/redmine-1.0.3)
** 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 []: /home/www-data/public/python/trac/myproject/
Trac database adapter (sqlite, sqlite3, mysql, postgresql) [sqlite3]:
Trac database encoding [UTF-8]:
Target project identifier []: myproject

Migrating components..
Migrating milestones....
Migrating custom fields
Migrating tickets................
Migrating wiki...........................................................................................................rake aborted!

no implicit conversion to float from nil
/home/www-data/public/ruby/redmine-1.0.3/vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb:277:in `minus_without_duration'
/home/www-data/public/ruby/redmine-1.0.3/vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb:277:in `minus_without_coercion'
/home/www-data/public/ruby/redmine-1.0.3/vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb:286:in `-'
/home/www-data/public/ruby/redmine-1.0.3/lib/tasks/migrate_from_trac.rake:79:in `fake'
/home/www-data/public/ruby/redmine-1.0.3/lib/tasks/migrate_from_trac.rake:547:in `migrate'
/home/www-data/public/ruby/redmine-1.0.3/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:369:in `method_missing'
/home/www-data/public/ruby/redmine-1.0.3/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:215:in `method_missing'
/home/www-data/public/ruby/redmine-1.0.3/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:215:in `each'
/home/www-data/public/ruby/redmine-1.0.3/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:215:in `send'
/home/www-data/public/ruby/redmine-1.0.3/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:215:in `method_missing'
/home/www-data/public/ruby/redmine-1.0.3/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:369:in `method_missing'
/home/www-data/public/ruby/redmine-1.0.3/lib/tasks/migrate_from_trac.rake:545:in `migrate'
/home/www-data/public/ruby/redmine-1.0.3/lib/tasks/migrate_from_trac.rake:758
/usr/lib/ruby/1.8/rake.rb:636:in `call'
/usr/lib/ruby/1.8/rake.rb:636:in `execute'
/usr/lib/ruby/1.8/rake.rb:631:in `each'
/usr/lib/ruby/1.8/rake.rb:631:in `execute'
/usr/lib/ruby/1.8/rake.rb:597:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/1.8/rake.rb:590:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/rake.rb:583:in `invoke'
/usr/lib/ruby/1.8/rake.rb:2051:in `invoke_task'
/usr/lib/ruby/1.8/rake.rb:2029:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2029:in `each'
/usr/lib/ruby/1.8/rake.rb:2029:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:2023:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2001:in `run'
/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:1998:in `run'
/usr/bin/rake:28

journals

It looks like you're not using the migration script (lib/tasks/migrate_from_trac.rake) provided with 1.0.3.
Anything else to mention?
--------------------------------------------------------------------------------
I am using the migration script from the 1.0.3 version.

The problem seems to be that function Time.fake() has problem to handle when the given input is nil.

<pre> class ::Time
class << self
alias :real_now :now
def now
real_now - @fake_diff.to_i
end
def fake(time)
@fake_diff = real_now - time
res = yield
@fake_diff = 0
res
end
end
end</pre>

To solve that issue I modified this function in such way :
<pre> class ::Time
class << self
alias :real_now :now
def now
real_now - @fake_diff.to_i
end
def fake(time)
time = 0 if time.nil?
@fake_diff = real_now - time
res = yield
@fake_diff = 0
res
end
end
end</pre>

The migration works perfectly nows. I have a few other trac to migrate, I'll try this modification and if it work I'll add a patch file.
--------------------------------------------------------------------------------
This is a duplicate of #5764.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Why should this be a duplicate of the other issue?
The error is not even the same and the redmine versions are different!

I got the same error with trac 0.13.
The advice of Félix Delval helped me.
--------------------------------------------------------------------------------
Agreed, it's not a duplicate, it's a totally different issue. The fix that Felix did worked for me, it would be great to get it checked into trunk.
--------------------------------------------------------------------------------
Still exists in redmine 1.4.0. Felix fix is working indeed.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
#14567 is a more comprehensive fix
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------


related_issues

relates,New,5764,migrate_from_trac does not support trac 0.12
relates,Needs feedback,8690,User can't be displayed
relates,New,10738,trac import issue
relates,New,14567,migrate_from_trac.rake does not convert timestamps in Trac database version 23
duplicates,Closed,14843,Error in migrate_from_trac

Admin Redmine さんが約2年前に更新

  • カテゴリImporters_15 にセット
  • 対象バージョンCandidate for next minor release_33 にセット

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

いいね!0
いいね!0