ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Trac migration doesn't work with current CP release (Bug #627)


Added by Chris Dähn at 2011-09-15 07:21 pm. Updated at 2011-12-09 02:48 pm.


Status:Open Start date:2011-09-15
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:-
Target version:-
Remote issue URL: Affected version:

Description

Due to changes in the model- and data-wise way the issue histories are stored, the trac migration script is currently unusable.

Running the current trac migration script causes it to abort during the ticket import when building the issue history - see discussion https://www.chiliproject.org/boards/1/topics/556.

Here a dump of the migration script:

Migrating components........
Migrating milestones...........................
Migrating custom fields...........
Migrating tickets.rake aborted!
unknown attribute: created_on
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/base.rb:2918:in `assign_attributes'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/base.rb:2914:in `each'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/base.rb:2914:in `assign_attributes'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/base.rb:2787:in `attributes='
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/base.rb:2477:in `initialize'
/opt/chiliproject/lib/tasks/migrate_from_trac.rake:488:in `new'
/opt/chiliproject/lib/tasks/migrate_from_trac.rake:488:in `migrate'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.12/lib/active_support/ordered_hash.rb:115:in `each'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.12/lib/active_support/ordered_hash.rb:115:in `each'
/opt/chiliproject/lib/tasks/migrate_from_trac.rake:483:in `migrate'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/batches.rb:26:in `find_each'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/batches.rb:26:in `each'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/batches.rb:26:in `find_each'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/batches.rb:66:in `find_in_batches'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/batches.rb:25:in `find_each'
/opt/chiliproject/lib/tasks/migrate_from_trac.rake:458:in `migrate'
/opt/chiliproject/lib/tasks/migrate_from_trac.rake:762
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:62:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/bin/rake:32
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
Tasks: TOP => redmine:migrate_from_trac

A Trac db dump will be provided within the next days.


Related issues

related to Bug #516: Issue with Trac migration: "TracMigrate is not missing co... Open 2011-07-08

Associated revisions

Revision 1c8cf4ef
Added by Jean-Philippe Lang at 2008-02-16 02:19 pm

Added the following permissions (#527, #585, #627):
  • edit_issue_notes: let user edit any notes
  • edit_own_issue_notes: let user edit his own notes only

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1152 e93f8b46-1217-0410-a6f0-8f06a7374b81

History

Updated by Chris Dähn at 2011-09-16 09:24 pm

Besides:
If this bug is worked around by using an old CP 1.5.2 release and then upgrading to CP 2.1.1, the database migration - in my case - failed with this error:

(currently I don't know where to place this problem, so this can/should be move accordingly)

chiliproject:/opt/chiliproject # rake --trace db:migrate RAILS_ENV=production
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
==  MergeWikiVersionsWithJournals: migrating ==================================
rake aborted!
An error has occurred, all later migrations canceled:

Mysql::Error: Column 'user_id' cannot be null: INSERT INTO `journals` (`created_at`, `notes`, `journaled_id`, `user_id`, `version`, `type`, `changes`, `activity_type`) VALUES('2007-08-07 17:29:48', NULL, 114, NULL, 0, 'WikiContentJournal', NULL, 'wiki_edits')
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `log'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/mysql_adapter.rb:324:in `execute'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/abstract/database_statements.rb:259:in `insert_sql'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/mysql_adapter.rb:334:in `insert_sql'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/abstract/database_statements.rb:44:in `insert_without_query_dirty'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/abstract/query_cache.rb:19:in `insert'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/base.rb:2961:in `create_without_timestamps'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/timestamp.rb:53:in `create_without_callbacks'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/callbacks.rb:266:in `create'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/base.rb:2927:in `create_or_update_without_callbacks'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/callbacks.rb:250:in `create_or_update'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/base.rb:2594:in `save_without_validation!'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/validations.rb:1100:in `save_without_dirty!'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/dirty.rb:87:in `save_without_transactions!'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:200:in `save!'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:182:in `transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:200:in `save!'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:200:in `save!'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/validations.rb:1071:in `create!'
./db/migrate//20100804112053_merge_wiki_versions_with_journals.rb:28:in `up_without_benchmarks'
./db/migrate//20100804112053_merge_wiki_versions_with_journals.rb:27:in `each'
./db/migrate//20100804112053_merge_wiki_versions_with_journals.rb:27:in `up_without_benchmarks'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `send'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `migrate'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `migrate'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:365:in `__send__'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:365:in `migrate'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:491
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:567:in `call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:567:in `ddl_transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:490:in `migrate'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:477:in `each'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:477:in `migrate'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:401:in `up'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.12/lib/active_record/migration.rb:383:in `migrate'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.12/lib/tasks/databases.rake:112
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:62:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/bin/rake:32
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
Tasks: TOP => db:migrate

Updated by Felix Schäfer at 2011-09-17 12:49 pm

This is strange. Do you have wiki pages that were created by subsequently deleted users on the trac instance? Can you confirm that you have wiki_versions in the imported DB before the migration that have an empty user_id field?

Updated by Chris Dähn at 2011-09-18 07:24 pm

You're right: One entry had a NULL value for author_id - thanks to an old Trac plugin which used a non existent user name as author. If fixed that entry and rerun the migration successful.

Thanks again Felix!

Updated by Guillaume Bourque at 2011-12-07 03:22 am

Hi all,

since the migration is not working well, what is the best way to import from old trac ?

Here is my setup, I have a chiliproject installation 2.4 running with multiple project fine.

I have ~5 trac to migrate to this setup, what is the simplest way to go there ?

Pop in a new Chiliproject install v. 1.5 on some other server migrate the trac there and then import those project from my chiliproject 1.4 to my production chiliproject 2.4 ?

If that make sense how to I move a project from CP 1.4 to CP 2.4 ? I can plys with mysqldump no problem but would need some help.

Thanks for any recommendations.

Guillaume

Updated by Felix Schäfer at 2011-12-09 02:48 pm

Salut Guillaume,

Guillaume Bourque wrote:

since the migration is not working well, what is the best way to import from old trac ?

The best way would be to fix the importer :-) There are some starting points in #516, see if you can help there, biggest help would be a Trac DB I could use to test the importer.

If that make sense how to I move a project from CP 1.4 to CP 2.4 ?

That won't work as there currently is no easy or predictably working well way to merge 2 ChiliProjects, even less import only one project from one to the other :-/

Also available in: Atom PDF