Project

General

Profile

Trac migration script failing

Added by Over Kill almost 5 years ago

Hi all,

Just got handed a project and I'm a bit stuck. We're trying to migrate data from Trac into Redmine, but keep running into errors along the way. I've been able to solve most of them so far by looking them up, but I'm having trouble with the most recent iteration and have hit a brick wall. Attached the rake file I'm using at the bottom as well :)

Ruby 2.5
Rails 5.2.4.1
CentOS 7.7.1908

Whenever I run the import script, here's the output:

[redmine@redmine01 tasks]$ rake redmine:migrate_from_trac RAILS_ENV="production" --trace
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32`.
The dependency ffi (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32`.
(in /opt/redmine/redmine-4.1.0)
** 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 []: /path/to/project
Trac database adapter (sqlite3, mysql2, postgresql) [sqlite3]:
Trac database encoding [UTF-8]:
Target project identifier []: testproject

Trac database version is: 26
Migrating components............
Migrating milestones....
Migrating custom fields..........
Migrating tickets........................................................
Migrating wikirake aborted!
ActiveRecord::DangerousAttributeError: readonly? is defined by Active Record. Check to make sure that you don't have an attribute or method with the same name.
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/activerecord-5.2.4.1/lib/active_record/attribute_methods.rb:91:in `instance_method_already_implemented?'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/activerecord-5.2.4.1/lib/active_record/attribute_methods/primary_key.rb:64:in `instance_method_already_implemented?'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/activemodel-5.2.4.1/lib/active_model/attribute_methods.rb:288:in `block in define_attribute_method'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/activemodel-5.2.4.1/lib/active_model/attribute_methods.rb:285:in `each'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/activemodel-5.2.4.1/lib/active_model/attribute_methods.rb:285:in `define_attribute_method'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/activemodel-5.2.4.1/lib/active_model/attribute_methods.rb:252:in `block in define_attribute_methods'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/activemodel-5.2.4.1/lib/active_model/attribute_methods.rb:252:in `each'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/activemodel-5.2.4.1/lib/active_model/attribute_methods.rb:252:in `define_attribute_methods'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/activerecord-5.2.4.1/lib/active_record/attribute_methods.rb:63:in `block in define_attribute_methods'
/opt/redmine/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/mutex_m.rb:71:in `synchronize'
/opt/redmine/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/mutex_m.rb:71:in `mu_synchronize'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/activerecord-5.2.4.1/lib/active_record/attribute_methods.rb:60:in `define_attribute_methods'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/activerecord-5.2.4.1/lib/active_record/core.rb:143:in `allocate'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/activerecord-5.2.4.1/lib/active_record/persistence.rb:71:in `instantiate'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/activerecord-5.2.4.1/lib/active_record/querying.rb:52:in `block (2 levels) in find_by_sql'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/activerecord-5.2.4.1/lib/active_record/result.rb:57:in `block in each'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/activerecord-5.2.4.1/lib/active_record/result.rb:57:in `each'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/activerecord-5.2.4.1/lib/active_record/result.rb:57:in `each'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/activerecord-5.2.4.1/lib/active_record/querying.rb:52:in `map'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/activerecord-5.2.4.1/lib/active_record/querying.rb:52:in `block in find_by_sql'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/activesupport-5.2.4.1/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/activerecord-5.2.4.1/lib/active_record/querying.rb:51:in `find_by_sql'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/activerecord-5.2.4.1/lib/active_record/relation.rb:560:in `block in exec_queries'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/activerecord-5.2.4.1/lib/active_record/relation.rb:584:in `skip_query_cache_if_necessary'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/activerecord-5.2.4.1/lib/active_record/relation.rb:547:in `exec_queries'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/activerecord-5.2.4.1/lib/active_record/relation.rb:422:in `load'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/activerecord-5.2.4.1/lib/active_record/relation.rb:200:in `records'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/activerecord-5.2.4.1/lib/active_record/relation/delegation.rb:71:in `each'
/opt/redmine/redmine-4.1.0/lib/tasks/migrate_from_trac.rake:558:in `migrate'
/opt/redmine/redmine-4.1.0/lib/tasks/migrate_from_trac.rake:782:in `block (2 levels) in <top (required)>'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/rake-13.0.1/lib/rake/task.rb:281:in `block in execute'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/rake-13.0.1/lib/rake/task.rb:281:in `each'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/rake-13.0.1/lib/rake/task.rb:281:in `execute'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/rake-13.0.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/opt/redmine/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/rake-13.0.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/rake-13.0.1/lib/rake/task.rb:188:in `invoke'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/rake-13.0.1/lib/rake/application.rb:160:in `invoke_task'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/rake-13.0.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/rake-13.0.1/lib/rake/application.rb:116:in `each'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/rake-13.0.1/lib/rake/application.rb:116:in `block in top_level'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/rake-13.0.1/lib/rake/application.rb:125:in `run_with_threads'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/rake-13.0.1/lib/rake/application.rb:110:in `top_level'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/rake-13.0.1/lib/rake/application.rb:83:in `block in run'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/rake-13.0.1/lib/rake/application.rb:80:in `run'
/opt/redmine/.rvm/gems/ruby-2.5.5/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/opt/redmine/.rvm/gems/ruby-2.5.5/bin/rake:23:in `load'
/opt/redmine/.rvm/gems/ruby-2.5.5/bin/rake:23:in `<main>'
/opt/redmine/.rvm/gems/ruby-2.5.5/bin/ruby_executable_hooks:24:in `eval'
/opt/redmine/.rvm/gems/ruby-2.5.5/bin/ruby_executable_hooks:24:in `<main>'
Tasks: TOP => redmine:migrate_from_trac

I've already double checked and the fix for this is supposedly in there:

super.select {|column| column.name.to_s != 'readonly'}

Not sure what's wrong here and could really use a hand!
Thanks in advance!

migrate_from_trac.rake (29.6 KB) migrate_from_trac.rake rake file being used