プロジェクト

全般

プロフィール

Vote #67498

未完了

migrate_from_trac does not support trac 0.12

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

ステータス:
New
優先度:
高め
担当者:
-
カテゴリ:
Importers_15
開始日:
2010/06/27
期日:
進捗率:

0%

予定工数:
category_id:
15
version_id:
33
issue_org_id:
5764
author_id:
17117
assigned_to_id:
0
comments:
7
status_id:
1
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

I attempted to migrate a trac 0.12 project to Redmine 0.9.4 and encountered the following two errors:

  1. I had no clue that the project ID should be given in lowercase:

...
Target project identifier []: ETrackProject
Unable to create a project with identifier 'ETrackProject'!
rake aborted!
undefined method reload' for nil:NilClass
C:/redmine-0.9.4/lib/tasks/migrate_from_trac.rake:685:in
target_project_identifier'
...

  1. Importer was not able to handle time format of trac 0.12 database. Trac seems to keep times as Epoch at fixed length adding trailing '0's.

...
Migrating components................................
Migrating milestones.rake aborted!
bignum too big to convert into long'
C:/redmine-0.9.4/lib/tasks/migrate_from_trac.rake:104:in
at'
...

I attach a patch that resolved for me the above. I am not sure if it remains compatible with trac 0.11


journals

The problem results from the timestamps' format change from "seconds since epoch" to "microseconds since epoch" in "Trac 0.12":http://trac.edgewall.org/wiki/TracDev/ReleaseNotes/0.12

While trying to migrate my Trac environments I got straight down to the code and reinvented the wheel by making "a similar patch":https://github.com/xmxwx/redmine/commit/5428853f7f4984ded4ab3ec669c50d8c76026c81

I am pretty sure that neither mine nor Michalis' one do not remain compatible with trac 0.11, since they neither check the version of trac database schema nor perform any heurestics on the timestamps themselves. Before merging into mainstream, of course this needs to be done.
--------------------------------------------------------------------------------
If someone can send me a trac-0.12 database containing some sample data, I can try to fix it.
--------------------------------------------------------------------------------
The trac migration script also does not handle the new trac 0.12 syntax for commit messages via the commit hook scripts. Pre 0.12, commit messages were of the form
<pre>
{{{
(In [\d+]) Commit message.
}}}
</pre>
With the multi-repository support in version 0.12 the message changed to:
<pre>
In [(\d+)/(\S+)]:
{{{
#!CommitTicketReference repository="\S+" revision="\d+"
Commit message
}}}
</pre>

The following replacement addresses this issue while maintaining revision links (place before the "# Revision links" comment):
<pre>
commit_re = /^In \[(\d+)\/\S+\]:[\r\n]+\{\{\{[\r\n]+#!CommitTicketReference repository="\S+" revision="\d+"[\r\n]+(.*)[\r\n]*\}\}\}[\r\n]*/m
text = text.gsub(commit_re, '(In [\1]) \2')
</pre>
This just basically converts the new commit message style to the old one.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
This problem exists since trac database version 23 (see http://trac.edgewall.org/attachment/ticket/6466/6466-microsecond-times-r8770.patch ).
"trac.system" table should be checked; when "database_version" has an "value" > 22, all time-values should be divided by 1000000, as they have been converted to microseconds.
--------------------------------------------------------------------------------
Can you try this patch:
http://www.redmine.org/issues/14567
--------------------------------------------------------------------------------

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


related_issues

relates,Reopened,6868,migrate_from_trac and trac 0.12
relates,New,14567,migrate_from_trac.rake does not convert timestamps in Trac database version 23

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

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

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

いいね!0
いいね!0