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.

Migrating from redmine 1.2 -> ChilliProject 2.7 error

Added by james meyer at 2012-02-08 03:11 pm

Hello,
When attempting to migrate from redmine 1.2 to chilliprojct 2.7 an error occurs during the process.
This is with ruby 1.8.7, please advise.

[root@ace chiliproject-2.7.0]# bundle exec rake db:migrate RAILS_ENV=production --trace
  • Invoke db:migrate (first_time)
  • Invoke environment (first_time)
  • Execute environment
  • Execute db:migrate
    BuildInitialJournalsForActsAsJournalized: migrating =====================
    -- Building initial journals for Message
    > 1.4397s
    -
    Building initial journals for Attachment
    > 67.5156s
    -
    Building initial journals for Document
    > 0.3758s
    -
    Building initial journals for Changeset
    > 822.8926s
    -
    Building initial journals for Issue
    rake aborted!
    An error has occurred, all later migrations canceled:

changes was supposed to be a Hash, but was a String
/opt/ruby1.8/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/attribute_methods.rb:299:in `unserialize_attribute'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/attribute_methods.rb:271:in `read_attribute'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/base.rb:3193:in `send'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/base.rb:3193:in `clone_attribute_value'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/dirty.rb:134:in `write_attribute'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/attribute_methods.rb:1:in `changes='
/srv/chiliproject-2.7.0/vendor/plugins/acts_as_journalized/lib/redmine/acts/journalized/creation.rb:92:in `recreate_initial_journal!'
./db/migrate//20100714111653_build_initial_journals_for_acts_as_journalized.rb:45:in `up_without_benchmarks'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/batches.rb:26:in `find_each'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/batches.rb:26:in `each'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/batches.rb:26:in `find_each'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/batches.rb:66:in `find_in_batches'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/batches.rb:25:in `find_each'
./db/migrate//20100714111653_build_initial_journals_for_acts_as_journalized.rb:41:in `up_without_benchmarks'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:328:in `say_with_time'
/opt/ruby1.8/lib/ruby/1.8/benchmark.rb:293:in `measure'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:328:in `say_with_time'
./db/migrate//20100714111653_build_initial_journals_for_acts_as_journalized.rb:30:in `up_without_benchmarks'
./db/migrate//20100714111653_build_initial_journals_for_acts_as_journalized.rb:29:in `each'
./db/migrate//20100714111653_build_initial_journals_for_acts_as_journalized.rb:29:in `up_without_benchmarks'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:282:in `send'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:282:in `migrate'
/opt/ruby1.8/lib/ruby/1.8/benchmark.rb:293:in `measure'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:282:in `migrate'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:365:in `__send__'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:365:in `migrate'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:491:in `migrate'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:567:in `call'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:567:in `ddl_transaction'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:490:in `migrate'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:477:in `each'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:477:in `migrate'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:401:in `up'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/migration.rb:383:in `migrate'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/tasks/databases.rake:112
/opt/ruby1.8/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `execute'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/opt/ruby1.8/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `run'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/opt/ruby1.8/lib/ruby/gems/1.8/gems/rake-0.9.2.2/bin/rake:33
/opt/ruby1.8/lib/ruby/gems/1.8/bin/rake:19:in `load'
/opt/ruby1.8/lib/ruby/gems/1.8/bin/rake:19
Tasks: TOP => db:migrate


Replies (4)

RE: Migrating from redmine 1.2 -> ChilliProject 2.7 error - Added by Felix Schäfer at 2012-02-11 08:31 pm

#737 shows a similar issue, the migration error is probably do to faulty data/the yaml dumper and parser not handling the data correctly.

Could you have a look at the description fields of your issues and see if any of those starts off with spaces, probably 2? Note the ID of the issue and remove those spaces in Redmine, if the problem is the same, that should correct it.

RE: Migrating from redmine 1.2 -> ChilliProject 2.7 error - Added by james meyer at 2012-02-11 09:48 pm

I did have three records where either the description or subject started off with at least one space. After correcting those it still fails with the same error. Is it possible to see which record is causing the error? I don't mind adding code, just don't know where to start.

RE: Migrating from redmine 1.2 -> ChilliProject 2.7 error - Added by Felix Schäfer at 2012-02-11 09:59 pm

You could add something like puts "Migrating object: #{o.inspect}" after the begin line in source:db/migrate/20100714111653_build_initial_journals_for_acts_as_journalized.rb#L44, that should tell you which object it's trying to migrate before failing.

RE: Migrating from redmine 1.2 -> ChilliProject 2.7 error - Added by james meyer at 2012-02-12 03:25 am

Thanks Felix.
I had some entries with spaces like you described, and some others that the migration process didn't like but I don't know why.
Thanks to the debug code above the invalid records were identified and taken care of accordingly.

There where so many records that began with a space, it was quicker to write a python program to fix all the records vs manually adjusting them.

Again thank you for your help, I was really starting to get frustrated.
-jm

(1-4/4)