プロジェクト

全般

プロフィール

Vote #66901

完了

Migrate from Trac with postgresql and more.

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

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

0%

予定工数:
category_id:
21
version_id:
0
issue_org_id:
5154
author_id:
11915
assigned_to_id:
0
comments:
7
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

When trying to migrate from Trac to Redmine with postgresql database, I received an error:

# rake --trace redmine:migrate_from_trac RAILS_ENV="production"
(in /home/redmine-trunk)
** 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/mike/colstat
Trac database adapter (sqlite, sqlite3, mysql, postgresql) [sqlite3]: 
Trac database encoding [UTF-8]: 
Target project identifier []: devel

Migrating components....rake aborted!
incomplete multibyte character
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/postgresql_adapter.rb:400:in `escape'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/postgresql_adapter.rb:400:in `quote_string'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/quoting.rb:19:in `quote'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/postgresql_adapter.rb:391:in `quote'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2392:in `quote_bound_value'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2352:in `replace_bind_variables'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2352:in `gsub'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2352:in `replace_bind_variables'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2341:in `sanitize_sql_array'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2230:in `sanitize_sql'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1494:in `merge_conditions'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1492:in `each'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1492:in `merge_conditions'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1804:in `add_conditions!'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1687:in `construct_finder_sql'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1548:in `find_every'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1505:in `find_initial'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:692:in `exists?'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/validations.rb:827:in `validates_uniqueness_of'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2143:in `with_scope'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2151:in `with_exclusive_scope'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/validations.rb:826:in `validates_uniqueness_of'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/validations.rb:468:in `validates_each'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/validations.rb:465:in `each'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/validations.rb:465:in `validates_each'
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:182:in `call'
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:182:in `evaluate_method'
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:166:in `call'
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:90:in `run'
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:90:in `each'
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:90:in `send'
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:90:in `run'
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:276:in `run_callbacks'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/validations.rb:1098:in `valid_without_callbacks?'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:315:in `valid?'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/validations.rb:1077:in `save_without_dirty'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/dirty.rb:79:in `save_without_transactions'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:229:in `send'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:229:in `with_transaction_returning_status'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:182:in `transaction'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:228:in `with_transaction_returning_status'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:196:in `save'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:196:in `save'
/home/redmine-trunk/lib/tasks/migrate_from_trac.rake:311:in `migrate'
/home/redmine-trunk/lib/tasks/migrate_from_trac.rake:306:in `each'
/home/redmine-trunk/lib/tasks/migrate_from_trac.rake:306:in `migrate'
/home/redmine-trunk/lib/tasks/migrate_from_trac.rake:778
/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

After studying the issue, I found the cause of the error. It arises from the table "issue_categories".
In our Trac database contains long names for the components, more than 15 characters in the utf8 encoding. And in the database "Redmine" a limit on the size of the column "name" in table "issue_categories" equal to 30 (corresponds to 15 characters in the encoding utf8).

I increased the limit for the column "name" to 255. This immediately decided how this issue, and the problems mentioned earlier: #3392, #4990, maybe #1008.

Potentially, the same problem can arise in the tables: auth_sources, custom_fields, enumerations, issue_statuses, projects, roles, trackers. All these column "name" has a limit of 30.

I propose to make changes in database schema and increase the limit for column "name" to 255.

file migration: attachment:20100323105501_change_name_limit.rb
(put in the directory: db/migrate/)


journals

course to update the current database, run:
<pre>
rake db:migrate RAILS_ENV=production
</pre>
--------------------------------------------------------------------------------
Full patch: attachment:change_name_limit.patch

(also closes: #1791 and #3573)
--------------------------------------------------------------------------------
Eric, look please at the specified bug.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Duplicate of #3392.
--------------------------------------------------------------------------------

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


related_issues

relates,Closed,1791,Raise issue-categories name length-limit from 30 to 40 characters
relates,Closed,3573,longer issue category names
duplicates,Closed,3392,Issue categories length and utf-8 problem

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

  • カテゴリDatabase_21 にセット

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

いいね!0
いいね!0