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.

Issue with Trac migration: "TracMigrate is not missing constant TracTicketChange!" (Bug #516)


Added by Scott Bigelo at 2011-07-08 11:39 pm. Updated at 2012-04-28 05:39 pm.


Status:Open Start date:2011-07-08
Priority:Normal Due date:
Assignee:Felix Schäfer % Done:

0%

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

Description

I have successfully installed ChiliProject on CentOS using the provided instructions, but when I attempt to convert my trac installation (which I've converted using redmine earlier today), I get this error (from `rake redmine:migrate_from_trac RAILS_ENV="development"`):

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

TracMigrate is not missing constant TracTicketChange!
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activesupport-2.3.12/lib/active_support/dependencies.rb:443:in `load_missing_constant'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activesupport-2.3.12/lib/active_support/dependencies.rb:106:in `const_missing'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activesupport-2.3.12/lib/active_support/dependencies.rb:124:in `send'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activesupport-2.3.12/lib/active_support/dependencies.rb:124:in `const_missing'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activerecord-2.3.12/lib/active_record/base.rb:1:in `compute_type'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activesupport-2.3.12/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activerecord-2.3.12/lib/active_record/base.rb:2234:in `compute_type'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activerecord-2.3.12/lib/active_record/reflection.rb:156:in `send'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activerecord-2.3.12/lib/active_record/reflection.rb:156:in `klass'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activerecord-2.3.12/lib/active_record/reflection.rb:187:in `quoted_table_name'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activerecord-2.3.12/lib/active_record/associations/has_many_association.rb:97:in `construct_sql'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activerecord-2.3.12/lib/active_record/associations/association_collection.rb:21:in `initialize'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activerecord-2.3.12/lib/active_record/associations.rb:1306:in `new'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activerecord-2.3.12/lib/active_record/associations.rb:1306:in `changes'
/root/chiliproject-2.0.0/lib/tasks/migrate_from_trac.rake:483:in `migrate'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activerecord-2.3.12/lib/active_record/batches.rb:26:in `find_each'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activerecord-2.3.12/lib/active_record/batches.rb:26:in `each'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activerecord-2.3.12/lib/active_record/batches.rb:26:in `find_each'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activerecord-2.3.12/lib/active_record/batches.rb:66:in `find_in_batches'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activerecord-2.3.12/lib/active_record/batches.rb:25:in `find_each'
/root/chiliproject-2.0.0/lib/tasks/migrate_from_trac.rake:458:in `migrate'
/root/chiliproject-2.0.0/lib/tasks/migrate_from_trac.rake:762
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/rake-0.9.2/lib/rake/application.rb:62:in `run'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/rake-0.9.2/bin/rake:32
/usr/local/rvm/gems/ree-1.8.7-2011.03/bin/rake:19:in `load'
/usr/local/rvm/gems/ree-1.8.7-2011.03/bin/rake:19
Tasks: TOP => redmine:migrate_from_trac

Versions:
$ rvm list

rvm rubies

=> ree-1.8.7-2011.03 [ i386 ]

$ ruby -v
ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-linux], MBARI 0x8770, Ruby Enterprise Edition 2011.03

$ gem search rack

  • LOCAL GEMS ***

rack (1.1.2, 1.0.1)

$ gem search rake

  • LOCAL GEMS ***

rake (0.9.2, 0.8.7)

$ rake --version
rake, version 0.9.2

$ gem -v
1.6.2

Steps taken to reproduce:
On db server:
$ mysqladmin create chiliproject_dev # with correct credentials in config/database.yml

On web server:
$ cd chiliproject-2.0.0
$ rake generate_session_store
$ RAILS_ENV=development rake db:migrate
$ RAILS_ENV="development" rake redmine:migrate_from_trac
Migrating components....................
Migrating milestones........................................
Migrating custom fields
Migrating tickets.rake aborted!
TracMigrate is not missing constant TracTicketChange!

Tasks: TOP => redmine:migrate_from_trac
(See full trace by running task with --trace)

Unfortunately, there is private data in our Trac dump, and I can't easily create a new one to test, since it is a hosted service.


migrate_from_trac.rake.diff - Patch for trac migration script of ChiliProject 2.1.1 (release) to fix missing module scope (1.6 kB) Chris Dähn, 2011-09-12 07:51 pm

migrate_from_trac.rake.diff (6.1 kB) Mike Pestorich, 2011-11-25 06:01 am

smARTtrack.tar.xz (138.7 kB) Matthias Scholz, 2012-01-11 04:06 pm

migrate_from_trac12.rake (51.2 kB) Matthias Scholz, 2012-01-26 01:28 pm

migrate_from_trac.rake.patch (54.2 kB) Matthias Scholz, 2012-01-26 01:28 pm


Related issues

related to Bug #627: Trac migration doesn't work with current CP release Open 2011-09-15

History

Updated by Chris Dähn at 2011-09-12 07:51 pm

Hi,

I had the same problem with:


ruby 1.8.7 (2010-01-10 patchlevel 249) [i586-linux]
rake, version 0.9.2
chiliproject 2.1.1

running a migration from Trac 0.11.7 with PostgreSQL.

I fixed that by the following patch which just added the module scope "TracMigrate::" to the TracTicketChange calls.

But now the migration stops after processing the first few tickets (2-5 issues are imported correctly) with the error:

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

I checked all tables and the Issue class for the attribute created_on, but it's not missing :(

Does anyone know more? Any hints?

  • File migrate_from_trac.rake.diff added

Updated by Mike Pestorich at 2011-11-25 12:03 am

I've been trying to update from Trac as well.

Specifically, Trac 0.12dev (which had been previously upgraded from Trac 0.11). In addition to the TracMigrate:: additions in the attached patch, I also had to change all the Time.at(some_datetime) calls to Time.at(some_datetime/1000000.0) - see http://trac.edgewall.org/ticket/9377 to handle differences in the way timestamps were stored prior to 0.12.

Then I ended up with the same :created_on error mentioned above. To get past that one, I had to change :created_on on line 489 to :created_at when creating a new Journal.

Now I'm struggling with JournalDetail being replaced by acts_as_journalized (see https://www.chiliproject.org/projects/chiliproject/wiki/Acts_as_journalized). Apparently this change in behavior in ChiliProject 2.0 and beyond breaks this script and quite frankly I am lost with regard to what needs to be done to fix this code.

Updated by Mike Pestorich at 2011-11-25 06:01 am

Ok.... so I think I have it sort of working. I had to modify the way that changes were being accounted for within the Journal (as mentioned in my prior post due to the acts_as_journalized changes to ChiliProject 2.0). I am not sure that whatever I did here is right as I am not 100% on what the code was doing in the first place.

I attached the diff against migrate_from_trac.rake to make it all run without errors. The modifications in the diff related to the microsecond timestamps might not be necessary. From reading the earlier posts here, it appears that this maybe specific to my environment.

Nonetheless, I have semi-successfully migrated my Trac 0.12dev project to a new ChiliProject.


Components:      0/19
Milestones:      0/4
Tickets:         123/123
Ticket files:    1/1
Custom values:   0/0
Wiki edits:      1062/1062
Wiki files:      3/5
  • File migrate_from_trac.rake.diff added

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

Hello Mike,

thanks, with your patch apply I was able to migrate one of my old trac v 0.10.4-2 to chiliproject 2.4 but when I tried to migrate one that have ticket in then it does not work.

I had been able to migrate some other old trac v0.10 to chiliprojetct 1.2 but this seem to be a difficult job !

As some other have pointed out maybe it,s easier to migrate from trac to chiliproject 1.5.

Also, in your migration have you seen that the tables of content don't get migrate automaticly, and that tables have double | for each row separator ?

Thanks

Updated by Mike Pestorich at 2011-12-07 04:36 am

I did notice that the table content and row separators didn't get migrated correctly as well as a lot of other wiki content but haven't had the time to look into it. In addition, I don't believe that the comments on the tickets are coming across correctly either.

I apologize for the incompletness of the patch but I was mainly concerned about getting open tickets migrated so that my group could continue development on our open projects. I have since taken to manually editing my wiki pages to correct them (I didn't have many) as I am not framilier with many of the differences between the wiki formatting in Trac vs Chiliproject. I'm still learning much about chiliproject as I was a long time Trac user. Once I get up to speed on some of those things and find a little bit of time, I'd be happy to look into all this a bit further. It would be nice to have a robust process to migrate from Trac to ChilProject.

Updated by Felix Schäfer at 2011-12-09 01:35 pm

Hi guys,

I had planned to watch/respond to this issue when it first popped up but it seems I missed it later on, sorry about that.

I haven't looked hard at the patches or anything yet, but in order to be able to integrate them into core I'd need some sample data I can use to test the migration, what would be even better is if someone was somewhat versed in what changes went into Trac (specifically the DB format) since the version the importer is compatible with.

If anyone of you could provide me with this data, I'd try to fix the importer between Christmas and new year.

Updated by Matthias Scholz at 2012-01-11 04:06 pm

Hello everyone,

I also just tried to convert our trac installation to chiliproject using the provided patch by Mike.

But I get a different error message:

Migrating tickets..rake aborted!
You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.touch
/var/www/chiliproject3_trac/app/models/journal.rb:46:in `touch_journaled_after_creation'
/var/lib/gems/1.8/gems/activesupport-2.3.14/lib/active_support/callbacks.rb:178:in `send'
/var/lib/gems/1.8/gems/activesupport-2.3.14/lib/active_support/callbacks.rb:178:in `evaluate_method'
/var/lib/gems/1.8/gems/activesupport-2.3.14/lib/active_support/callbacks.rb:166:in `call'
/var/lib/gems/1.8/gems/activesupport-2.3.14/lib/active_support/callbacks.rb:93:in `run'
/var/lib/gems/1.8/gems/activesupport-2.3.14/lib/active_support/callbacks.rb:92:in `each'
/var/lib/gems/1.8/gems/activesupport-2.3.14/lib/active_support/callbacks.rb:92:in `send'
/var/lib/gems/1.8/gems/activesupport-2.3.14/lib/active_support/callbacks.rb:92:in `run'
/var/lib/gems/1.8/gems/activesupport-2.3.14/lib/active_support/callbacks.rb:276:in `run_callbacks'
/var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/callbacks.rb:344:in `callback'
/var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/callbacks.rb:267:in `create'
/var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/base.rb:2927:in `create_or_update_without_callbacks'
/var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/callbacks.rb:250:in `create_or_update'
/var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/base.rb:2577:in `save_without_validation'
/var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/validations.rb:1089:in `save_without_dirty'
/var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/dirty.rb:79:in `save_without_transactions'
/var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/transactions.rb:229:in `send'
/var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/transactions.rb:229:in `with_transaction_returning_status'
/var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/transactions.rb:182:in `transaction'
/var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/transactions.rb:228:in `with_transaction_returning_status'
/var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/transactions.rb:196:in `save'
/var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
/var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/transactions.rb:196:in `save'
/var/www/chiliproject3_trac/lib/tasks/migrate_from_trac.rake:521:in `migrate'
/var/lib/gems/1.8/gems/activesupport-2.3.14/lib/active_support/ordered_hash.rb:115:in `each'
/var/lib/gems/1.8/gems/activesupport-2.3.14/lib/active_support/ordered_hash.rb:115:in `each'
/var/www/chiliproject3_trac/lib/tasks/migrate_from_trac.rake:491:in `migrate'
/var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/batches.rb:26:in `find_each'
/var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/batches.rb:26:in `each'
/var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/batches.rb:26:in `find_each'
/var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/batches.rb:66:in `find_in_batches'
/var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/batches.rb:25:in `find_each'
/var/www/chiliproject3_trac/lib/tasks/migrate_from_trac.rake:466:in `migrate'
/var/www/chiliproject3_trac/lib/tasks/migrate_from_trac.rake:779
/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

I have only little experience with ruby and I do not know where to start debugging.

I can also provide a testing trac environment. It contains just seven tickets.
Trac version: 0.12.2

By the way I think this bug is very related to ticket #484.

Updated by Chris Dähn at 2012-01-12 09:07 am

Hi,

i got this error because I deleted some of my Trac users and the migration script seached for them while building the wiki and ticket journal.

We found a solution for that inside a Forum / Discussion thread:
https://www.chiliproject.org/boards/1/topics/556

ciao,
Chris

Updated by Matthias Scholz at 2012-01-12 10:18 am

Hello,

We found a solution for that inside a Forum / Discussion thread:
https://www.chiliproject.org/boards/1/topics/556

installing an older ChiliProject version is not an option for me.

I am not sure if the migration script provided in #484 gets any steps further.
It already provides some trac 0.12 adjustments.

Updated by Chris Dähn at 2012-01-12 11:24 am

...but only the old ChiliProject (< 2.0) can currently import Wikis etc. correctly.

But you're right that importing Trac 12.x data only works with the patch for the new time format...

Relying on the patch for CP 2.x could be more time intensive and may require much more coding+debugging.

So: If you need a fast way, patching the CP 1.5 for the new time format will enable you to run the migration with acceptable results (as I and others already did).

Would that be a way for you?

ciao,
Chris

Updated by Guillaume Bourque at 2012-01-12 02:16 pm

Hi chris,

I hava q question on this.

We have already ~ 20 projets in our productions ChiliProject v2.5 install. We can create an V1.5 CP install to migrate our trac info into the this transtion CP.

But then How to we import those Project into our production CP ?

If we could dump a project from ChiliProject V 1.5 into a tgz file and then import it into our production install it would be great...

Thanks for any input on this.

Guillaume

So: If you need a fast way, patching the CP 1.5 for the new time format will enable you to run the migration with acceptable results (as I and others already did).

Would that be a way for you?

ciao,
Chris

Updated by Chris Dähn at 2012-01-12 02:47 pm

...just follow these steps:

- install CP 1.5.x and run the Trac migration on it (patch for new time format of Trac 12.x needed)
- update CP to 2.x and follow the upgrade documentation - which includes to run "rake db:migrate..."
...during the upgrade to a CP 2.x version all your data are converted into the new CP database format
- now you have a new CP 2.x system

There are only these problems:
- your Trac MUST be original with all users, wikis etc. and without someone doing write requests on it during migration
> a deleted Trac user would stop the migration with "nil pointer " errors
CP 1.5 currently can't handle the Trac 12.x issue timestamps, so CP 1.5 must be patched for that
- wiki syntax - especially tables - could be broken or a little bit distorted, which can be fixed later manually (linebreaks etc.)

So if you need help applying the patch for Trac 12.x timestamps, we need someone who could write that... otherwise (with Trac 11.x) you can start your migration immediately.

If you have further questions, just ask :) ...or look into the migration discussion linked in my former reply.

ciao,
Chris

Updated by Guillaume Bourque at 2012-01-12 04:58 pm

This is all fine,

but how do you move or copy your trac project that is in you transition Chiliproct database to your production ChiliProject whe you already have ~ 20 projetc running.

Thanks,

Chris Dähn wrote:

...just follow these steps:

- install CP 1.5.x and run the Trac migration on it (patch for new time format of Trac 12.x needed)
- update CP to 2.x and follow the upgrade documentation - which includes to run "rake db:migrate..."
...during the upgrade to a CP 2.x version all your data are converted into the new CP database format
- now you have a new CP 2.x system

Updated by Chris Dähn at 2012-01-12 06:33 pm

Hi,

the biggest problem is that dumping and importing a project isn't simple.

All projects have an incrementing numerical id -> see table "chiliproject.projects" (where "chiliproject" is your CP database).
This id is used in many other tables as "project_id", like in "wikis" and "issues".

So before you can migrate you must ensure that your newly migrated project gets a project_id, which isn't already in use inside your production environment.

Therefore just try to add as much empty projects as needed to ensure that the hightest project_id would be equal or higher, than the highest project_id in your production environment - e.g. with 20 projects your hightest id should be "20".

Check this by:
SELCT ID FROM chiliproject.projects;

Now grab a separate (testing) machine and start migrating based on a CP 1.5 and updating it to CP 2.x.

Then do full backup of target production environment (copy MySQL and CiliProject dirs).

Now add an empty Project with identical name of your migrated one - and check it's project_id which should be equal to the migrated one, e.g. here it could be "21" for your 21. project.

Shut down your production ChiliProject/Apache + Database/MySQL.

And now - that's much work - grab all entries for your migrated project, e.g. project_id 21.

I don't know all tables having a relation to the table "projects" (tables having the field "project_id"),
but you can easily determine that with the EXPLAIN sql command.

Then dump all tables with for "project_id=21" and insert them back into your production sql server.

That's so far as my simple understanding as user goes... maybe the developers have better/more infos or can correct me...

Hope that helps a little bit...

ciao,
Chris

Updated by Guillaume Bourque at 2012-01-12 07:02 pm

Just brillant the idea to create empty project in the transition ChiliProject.

I was thinking of updating the project_id=21 manually but I can avoid that step using your trick.

Thanks again.

I was tinking of using the archiving utility in the project page but I have no idea how to import them back in a new server ;-) That woulb be a lot easier to move project from 1 server to another.

Bye

Updated by Matthias Scholz at 2012-01-26 01:28 pm

Hello,

after two weeks of heavy debugging and using the script proposed by Pedro [[https://www.chiliproject.org/users/414]] in Ticket [[https://www.chiliproject.org/issues/484]] I got a working migration script.

I put both files as attachment to this issue. My original file and the patch to the current migrate_from_trac.rake for version 3.0.0. There might not be a difference to the current v2 code.

The script is registered using a different name, see line 33: :migrate_from_trac12. 12 stands for trac version 0.12.
So you have to call: RAILS_ENV="<what ever>" rake --trace redmine:migrate_from_trac12

I tested it with every trac repository of our company ( 1615 issues ) and was able to combine them to one chiliproject project.

There are still some minor issues in the script. You can easily find them by searching for HACK or TODO.

One major thing you have to keep in mind is the attachment migration. The script generates dummy data in the <chiliproject>/files directory. So better you are using this folder, there are no checks for exists nor configuration.
After running the migration script you have to manually copy/replace the dummy files with the trac attachments.
Maybe somebody knows how to do this in the script directly.

Please feel free to test it and give me your thoughts.

Greetings,
Matthias

Updated by Holger Just at 2012-01-29 06:36 pm

Thanks for your patch. I will have a look at it as soon as possible.

As we are currently rushing to get 3.0 out of the door, I have to pull it out of this release however. I'm trying to have it included in 3.1. Thanks again.

  • Target version deleted (3.0.0)

Updated by Matthias Scholz at 2012-01-31 02:05 pm

One thing I have to admit, after checking all my debug entries, is that I had to edit the app/models/journal.rb as well.

I do not really know why and what the consequences are but doing the following before "touching" check did the trick:

def touch_journaled_after_creation
+ journaled.touch unless journaled == nil ## HACK !!!
- journaled.touch
end

Updated by Kris Lou at 2012-02-21 11:55 pm

Is this going to make 3.1?

Updated by Felix Schäfer at 2012-02-29 10:25 pm

Matthias Scholz wrote:

One thing I have to admit, after checking all my debug entries, is that I had to edit the app/models/journal.rb as well.

I do not really know why and what the consequences are but doing the following before "touching" check did the trick:

def touch_journaled_after_creation
+ journaled.touch unless journaled == nil ## HACK !!!
- journaled.touch
end

That is indeed a dirty hack, each journal should only be created by the journaled object and thus be able to reference it :-)

Kris: I'll try to review this for 3.1.

  • Target version set to 3.1.0
  • Assignee set to Felix Schäfer

Updated by Felix Schäfer at 2012-03-10 09:47 am

Working on this now. Is it reasonable to assume that anyone that has trac will be on 0.12 by now?

Updated by Matthias Scholz at 2012-03-12 08:33 am

Felix Schäfer wrote:

Working on this now. Is it reasonable to assume that anyone that has trac will be on 0.12 by now?

I would say yes, because the migration for versions below Trac 0.12 is quiet easy.
As far as I experienced with our former Trac projects.

Updated by Guillaume Bourque at 2012-03-12 01:04 pm

Hi,

I'm not sure, I have 4-5 trac running trac v0.11 and I can't migrate them now that I'm with chili ver 1.5 or higher. That used to be fine with older version of Chiliproject. I did not try you latest patch yet.

Has anobody been able to migrate trac into an old chiliproject installation and copy this chiliprojet projet to a newer chliproject where you already have other projetct running ( Chris Dähn has given some way to do it in note 14 #516note-14 ) ?

Thanks
Matthias Scholz wrote:

I would say yes, because the migration for versions below Trac 0.12 is quiet easy.
As far as I experienced with our former Trac projects.

Updated by Guillaume Bourque at 2012-03-16 08:01 pm

Felix Schäfer wrote:

Working on this now. Is it reasonable to assume that anyone that has trac will be on 0.12 by now?

Bonjour Felix,

Any news on this ?

should I migrate my chiliproject install to 3.0.0 to test this out ?

note: an export / import project utility would be fanstastic to help us move chiliproject from server a to server b, anything plan

Thanks
Thanks

Updated by Guillaume Bourque at 2012-03-20 01:53 pm

Felix Schäfer wrote:

Working on this now. Is it reasonable to assume that anyone that has trac will be on 0.12 by now?

Would a test trac help you working on this ? I could send you one of our test trac but I would prefer to do that in private.

Let me know, Guillaume

Updated by Radim Kolář at 2012-03-20 03:20 pm

Working on this now. Is it reasonable to assume that anyone that has trac will be on 0.12 by now?

yes. Please make your migration code to work with 0.12 Trac. If user is on previous version he can download Trac and run trac update to 0.12.

I am also highly interested in Trac migration.

Updated by Felix Schäfer at 2012-03-20 03:59 pm

Guillaume Bourque wrote:

Felix Schäfer wrote:

Working on this now. Is it reasonable to assume that anyone that has trac will be on 0.12 by now?

Any news on this ?

Sorry for the slow updates, it's taking more time than I thought it was, but it's definitely high on my list. I'll try to at least throw in what I have already on github (this IS a work in progress though, so probably non-working often-rebased-and-force-pushed might-claim-the-soul-of-your-first-born type of thing…) if you're interested in trying it out.

should I migrate my chiliproject install to 3.0.0 to test this out ?

3.0.0 is released, so it will never be in there, hopefully in 3.1.0 though :-) (What I'd really really like is to make this an independent gem/executable though, but that's for later I guess…)

note: an export / import project utility would be fanstastic to help us move chiliproject from server a to server b, anything plan

That's not the scope of this issue, but if by "is there anything planned?" you meant "did anyone ever think this is a cool feature that could be added someday?": yes, if you meant "will this feature materialize in the near future?": it's not on our immediate roadmap and I can't even get my mind around the complexity of exporting plugins correctly and stuff that I'm not even sure it's gonna be doable in a "sufficient" scope.

Updated by Guillaume Bourque at 2012-03-20 04:19 pm

Felix Schäfer wrote:

That's not the scope of this issue, but if by "is there anything planned?" you meant "did anyone ever think this is a cool feature that could be added someday?": yes, if you meant "will this feature materialize in the near future?": it's not on our immediate roadmap and I can't even get my mind around the complexity of exporting plugins correctly and stuff that I'm not even sure it's gonna be doable in a "sufficient" scope.

Hi Felix,

just having and export all issue and wiki and document with no pluging that could be imported in another chiliproject with the same version would be a very good start. We are free to reinstall all the plugins and adjust on the new server afterward !

Yes, I'm willing to test the trac patch on my current git clone if you tell me where to find the patch and how to apply it, I will do this in 1 hour.

Thanks,

Bye

Updated by Felix Schäfer at 2012-03-20 04:22 pm

Guillaume Bourque wrote:

Yes, I'm willing to test the trac patch on my current git clone if you tell me where to find the patch and how to apply it, I will do this in 1 hour.

I won't have the time to upload it until then, sorry, I'll make sure to update this issue when I do!

Updated by Felix Schäfer at 2012-03-23 08:44 pm

OK, my current working branch for this is https://github.com/thegcat/chiliproject/tree/bug/516-trac_migration, known problems:

  • Issue history not migrated
  • Status changed from Ready for review to Open

Updated by Holger Just at 2012-04-04 09:26 am

Pulling out of 3.1.0

  • Target version deleted (3.1.0)

Updated by Guillaume Bourque at 2012-04-04 03:24 pm

Holger Just wrote:

Pulling out of 3.1.0

Can you give information as to why ? This is a great feature having the ability ti migrate from trac !

Thanks

Updated by Holger Just at 2012-04-04 04:17 pm

Guillaume Bourque wrote:

Can you give information as to why ? This is a great feature having the ability ti migrate from trac !

Simply because it wasn't ready on release day. This features continues to get developed. Once it's ready, it gets merged. You can help Felix by fixing the remaining issues on his branch.

Updated by Guillaume Bourque at 2012-04-04 06:49 pm

Holger Just wrote:

Guillaume Bourque wrote:

Can you give information as to why ? This is a great feature having the ability ti migrate from trac !

Simply because it wasn't ready on release day. This features continues to get developed. Once it's ready, it gets merged. You can help Felix by fixing the remaining issues on his branch.

Ha thanks.

I would love to help Felix but I'm no developper at all, just an open source fan who knows linux and load balancer among other things !

Keep up the good work !

Updated by Radim Kolář at 2012-04-05 11:43 am

I tried your branch and got this error

fbsd8:~/chiliproject> bundle exec rake redmine:migrate_from_trac RAILS_ENV="production" --trace
  • 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/hsn/trac/filezcom
Trac database adapter (sqlite, sqlite3, mysql, postgresql) [sqlite]: postgresql
Trac database host [localhost]: localhost
Trac database port [5432]:
Trac database name []: trac
Trac database schema [public]: filezcom
Trac database username []: trac
Trac database password []: melemekavu
Trac database encoding [UTF-8]:
Target project identifier []: FilezCOM
Unable to create a project with identifier 'FilezCOM'!
rake aborted!
undefined method `reload' for nil:NilClass
/home/hsn/chiliproject/lib/tasks/migrate_from_trac.rake:697:in `target_project_identifier'
/home/hsn/chiliproject/lib/tasks/migrate_from_trac.rake:771
/home/hsn/chiliproject/lib/tasks/migrate_from_trac.rake:754:in `prompt'
/home/hsn/chiliproject/lib/tasks/migrate_from_trac.rake:771
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.9.2.2/bin/rake:33
/usr/local/lib/ruby/gems/1.8/bin/rake:19:in `load'
/usr/local/lib/ruby/gems/1.8/bin/rake:19
Tasks: TOP => redmine:migrate_from_trac

Updated by Felix Schäfer at 2012-04-12 06:55 pm

Radim Kolář wrote:

I tried your branch and got this error

Radim, thanks for testing, the error you get is actually here:

Target project identifier []: FilezCOM
Unable to create a project with identifier 'FilezCOM'!

The identifier must be lowercase (this should get tested/normalized but is not the current scope of this ticket).

Thanks for trying out though!

Updated by Guillaume Bourque at 2012-04-26 01:06 am

Has anybody had succes with the latest patch ?

would it be done via redmine ?

1) import trac to redmine

2) then import redmine to chiliproject 2.x or 3.x ?

Thanks

Updated by Matthias Scholz at 2012-04-26 06:52 am

Guillaume Bourque wrote:

Has anybody had succes with the latest patch ?

would it be done via redmine ?

1) import trac to redmine

2) then import redmine to chiliproject 2.x or 3.x ?

As fare as I know and how I used the migration script, you do not need to convert you trac to redmine first. It should work directly.
I used trac 0.12 and converted to chiliproject 3.x, see post #16

Thanks

Updated by Radim Kolář at 2012-04-28 05:39 pm

I had success with latest patch from this ticket. There are few minor things in markup which are not migrated correctly, but it worked for all my projects. I will open another ticket with converted wiki markup errors, but i think its in good shape to be committed into project.

Also available in: Atom PDF