Project

General

Profile

Error occurs when migrating from Mantis to Redmine.

Added by Crocodile Rat about 2 years ago

I was executing migration script under 'lib/tasks/migrate_from_mantis.rake' to migrate data from Mantis to Redmine, but some errors occurred and the migrating process stopped immediately, here's are errors and my environment:

Errors:
.....................................................................................................................
Migrating news.
Migrating custom fieldsrake aborted!
ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed to locate the subclass: '3'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite MantisMigrate::MantisCustomField.inheritance_column to use another column for that information.
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/inheritance.rb:226:in `rescue in find_sti_class
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/inheritance.rb:219:in `find_sti_class'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/inheritance.rb:207:in `discriminate_class_for_record'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/persistence.rb:69:in `instantiate'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/querying.rb:52:in `block (2 levels) in find_by_sql'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/result.rb:57:in `block in each'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/result.rb:57:in `each'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/result.rb:57:in `each'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/querying.rb:52:in `map'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/querying.rb:52:in `block in find_by_sql'
/usr/share/gems/gems/activesupport-5.2.6/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/querying.rb:51:in `find_by_sql'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/relation.rb:560:in `block in exec_queries'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/relation.rb:584:in `skip_query_cache_if_necessary'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/relation.rb:547:in `exec_queries'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/relation.rb:422:in `load'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/relation.rb:200:in `records'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/relation/delegation.rb:71:in `each'
/home/user/redmine-4.1.5/lib/tasks/migrate_from_mantis.rake:397:in `migrate'
/home/user/redmine-4.1.5/lib/tasks/migrate_from_mantis.rake:508:in `block (2 levels) in <top (required)>'
/usr/share/gems/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/home/user/.gem/ruby/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:58:in `load'
/home/user/.gem/ruby/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:58:in `kernel_load'
/home/user/.gem/ruby/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:23:in `run'
/home/user/.gem/ruby/gems/bundler-2.3.7/lib/bundler/cli.rb:484:in `exec'
/home/user/.gem/ruby/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/user/.gem/ruby/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/home/user/.gem/ruby/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/home/user/.gem/ruby/gems/bundler-2.3.7/lib/bundler/cli.rb:31:in `dispatch'
/home/user/.gem/ruby/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/home/user/.gem/ruby/gems/bundler-2.3.7/lib/bundler/cli.rb:25:in `start'
/home/user/.gem/ruby/gems/bundler-2.3.7/exe/bundle:48:in `block in <top (required)>'
/home/user/.gem/ruby/gems/bundler-2.3.7/lib/bundler/friendly_errors.rb:103:in `with_friendly_errors'
/home/user/.gem/ruby/gems/bundler-2.3.7/exe/bundle:36:in `<top (required)>'
/home/user/bin/bundle:23:in `load'
/home/user/bin/bundle:23:in `<main>'

Caused by:
NoMethodError: undefined method `split' for 3:Integer
/usr/share/gems/gems/activesupport-5.2.6/lib/active_support/inflector/methods.rb:273:in `constantize'
/usr/share/gems/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:582:in `get'
/usr/share/gems/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:613:in `constantize'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/inheritance.rb:221:in `find_sti_class'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/inheritance.rb:207:in `discriminate_class_for_record'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/persistence.rb:69:in `instantiate'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/querying.rb:52:in `block (2 levels) in find_by_sql'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/result.rb:57:in `block in each'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/result.rb:57:in `each'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/result.rb:57:in `each'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/querying.rb:52:in `map'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/querying.rb:52:in `block in find_by_sql'
/usr/share/gems/gems/activesupport-5.2.6/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/querying.rb:51:in `find_by_sql'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/relation.rb:560:in `block in exec_queries'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/relation.rb:584:in `skip_query_cache_if_necessary'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/relation.rb:547:in `exec_queries'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/relation.rb:422:in `load'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/relation.rb:200:in `records'
/usr/share/gems/gems/activerecord-5.2.6/lib/active_record/relation/delegation.rb:71:in `each'
/home/user/redmine-4.1.5/lib/tasks/migrate_from_mantis.rake:397:in `migrate'
/home/user/redmine-4.1.5/lib/tasks/migrate_from_mantis.rake:508:in `block (2 levels) in <top (required)>'
/usr/share/gems/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/home/user/.gem/ruby/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:58:in `load'
/home/user/.gem/ruby/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:58:in `kernel_load'
/home/user/.gem/ruby/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:23:in `run'
/home/user/.gem/ruby/gems/bundler-2.3.7/lib/bundler/cli.rb:484:in `exec'
/home/user/.gem/ruby/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/user/.gem/ruby/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/home/user/.gem/ruby/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/home/user/.gem/ruby/gems/bundler-2.3.7/lib/bundler/cli.rb:31:in `dispatch'
/home/user/.gem/ruby/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/home/user/.gem/ruby/gems/bundler-2.3.7/lib/bundler/cli.rb:25:in `start'
/home/user/.gem/ruby/gems/bundler-2.3.7/exe/bundle:48:in `block in <top (required)>'
/home/user/.gem/ruby/gems/bundler-2.3.7/lib/bundler/friendly_errors.rb:103:in `with_friendly_errors'
/home/user/.gem/ruby/gems/bundler-2.3.7/exe/bundle:36:in `<top (required)>'
/home/user/bin/bundle:23:in `load'
/home/user/bin/bundle:23:in `<main>'
Tasks: TOP => redmine:migrate_from_mantis
(See full trace by running task with --trace)

My environment:
OS: Rocky Linux
Redmine version: Redmine 4.2.4.stable
Ruby version: ruby 2.6.9p207
Database: 10.3.34-MariaDB
Ruby-aware server used: Thin


Replies (1)

RE: Error occurs when migrating from Mantis to Redmine. - Added by Marius BĂLTEANU about 2 years ago

Unfortunately, those migration scripts are no longer maintained, there is an issue to delete them from the core (#32399).

    (1-1/1)