Project

General

Profile

Actions

Support #1550

closed

Migration from v 0.1.5 to lastest 0.4 fails

Added by Ky Zh over 12 years ago. Updated about 12 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Triaged:
Fixed in Releases:
Found in Releases:

Description

We are running an antic version of Foreman (0.1.5 ?).
I'm now trying to my historical data from it into a newly installed 0.4

So far i exported my data [1] , imported it back [2] on an other box
Then i run the with the instruction [4].

On the "RAILS_ENV=production rake db:migrate" step, the rake job failed [4]
I also included the tables [5] diff existing between 0.1.5 and 0.4.0 (from our testing environment)

I will try to reproduce once again to catch the --trace the first time around

Other relevant informations:
ruby -v ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2011.03

[1] mysqldump -u root -p puppet > /var/satellite/puppetdb.sql
[2] mysql -u root -p puppet < /home/florentin.raud/puppet.sql
[3] http://theforeman.org/projects/foreman/wiki/Upgrade_instructions

[4] RAILS_ENV=production rake db:migrate
WARNING: 'require 'rake/rdoctask'' is deprecated. Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
at /opt/ruby-enterprise-1.8.7/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
SimplifyParameters: migrating ===========================================
-- remove_index(:parameters, [:host_id, :type])
> 0.0569s
-
remove_index(:parameters, [:hostgroup_id, :type])
> 0.0080s
-
remove_index(:parameters, [:domain_id, :type])
> 0.0026s
-
rename_column(:parameters, :host_id, :reference_id)
> 0.0741s
-
add_index(:parameters, [:reference_id, :type])
-> 0.0028s
rake aborted!
An error has occurred, all later migrations canceled:

undefined method `priority=' for #<GroupParameter:0x1c9cc2e8>

Tasks: TOP => db:migrate
(See full trace by running task with --trace)
  1. Yet another run
    [foreman@host /opt/foreman]$ RAILS_ENV=production rake db:migrate --trace
    WARNING: 'require 'rake/rdoctask'' is deprecated. Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
    at /opt/ruby-enterprise-1.8.7/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
    • Invoke db:migrate (first_time)
    • Invoke environment (first_time)
    • Execute environment
    • Execute db:migrate
      SimplifyParameters: migrating ===========================================
      -- remove_index(:parameters, [:host_id, :type])
      > 0.0004s
      -
      remove_index(:parameters, [:hostgroup_id, :type])
      > 0.0002s
      -
      remove_index(:parameters, [:domain_id, :type])
      > 0.0002s
      -
      rename_column(:parameters, :host_id, :reference_id)
      rake aborted!
      An error has occurred, all later migrations canceled:

No such column: parameters.host_id
/opt/foreman/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:530:in `rename_column'
/opt/foreman/vendor/rails/activerecord/lib/active_record/migration.rb:352:in `send'
/opt/foreman/vendor/rails/activerecord/lib/active_record/migration.rb:352:in `method_missing'
/opt/foreman/vendor/rails/activerecord/lib/active_record/migration.rb:328:in `say_with_time'
/opt/ruby-enterprise-1.8.7/lib/ruby/1.8/benchmark.rb:293:in `measure'
/opt/foreman/vendor/rails/activerecord/lib/active_record/migration.rb:328:in `say_with_time'
/opt/foreman/vendor/rails/activerecord/lib/active_record/migration.rb:348:in `method_missing'
./db/migrate//20100525094200_simplify_parameters.rb:7:in `up_without_benchmarks'
/opt/foreman/vendor/rails/activerecord/lib/active_record/migration.rb:282:in `send'
/opt/foreman/vendor/rails/activerecord/lib/active_record/migration.rb:282:in `migrate'
/opt/ruby-enterprise-1.8.7/lib/ruby/1.8/benchmark.rb:293:in `measure'
/opt/foreman/vendor/rails/activerecord/lib/active_record/migration.rb:282:in `migrate'
/opt/foreman/vendor/rails/activerecord/lib/active_record/migration.rb:365:in `__send__'
/opt/foreman/vendor/rails/activerecord/lib/active_record/migration.rb:365:in `migrate'
/opt/foreman/vendor/rails/activerecord/lib/active_record/migration.rb:491:in `migrate'
/opt/foreman/vendor/rails/activerecord/lib/active_record/migration.rb:567:in `call'
/opt/foreman/vendor/rails/activerecord/lib/active_record/migration.rb:567:in `ddl_transaction'
/opt/foreman/vendor/rails/activerecord/lib/active_record/migration.rb:490:in `migrate'
/opt/foreman/vendor/rails/activerecord/lib/active_record/migration.rb:477:in `each'
/opt/foreman/vendor/rails/activerecord/lib/active_record/migration.rb:477:in `migrate'
/opt/foreman/vendor/rails/activerecord/lib/active_record/migration.rb:401:in `up'
/opt/foreman/vendor/rails/activerecord/lib/active_record/migration.rb:383:in `migrate'
/opt/foreman/vendor/rails/railties/lib/tasks/databases.rake:112
/opt/ruby-enterprise-1.8.7/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/opt/ruby-enterprise-1.8.7/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `execute'
/opt/ruby-enterprise-1.8.7/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/opt/ruby-enterprise-1.8.7/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/opt/ruby-enterprise-1.8.7/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/opt/ruby-enterprise-1.8.7/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/opt/ruby-enterprise-1.8.7/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/opt/ruby-enterprise-1.8.7/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/opt/ruby-enterprise-1.8.7/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/opt/ruby-enterprise-1.8.7/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/opt/ruby-enterprise-1.8.7/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/opt/ruby-enterprise-1.8.7/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/opt/ruby-enterprise-1.8.7/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/opt/ruby-enterprise-1.8.7/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/opt/ruby-enterprise-1.8.7/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `run'
/opt/ruby-enterprise-1.8.7/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/opt/ruby-enterprise-1.8.7/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/opt/ruby-enterprise-1.8.7/lib/ruby/gems/1.8/gems/rake-0.9.2.2/bin/rake:33
/opt/ruby-enterprise-1.8.7/bin/rake:19:in `load'
/opt/ruby-enterprise-1.8.7/bin/rake:19
Tasks: TOP => db:migrate

[5] mysqldump --no-data --tables --create-options -u root --databases puppet


Files

Actions

Also available in: Atom PDF