Project

General

Profile

Actions

Defect #25177

closed

Upgrading Redmin 2.5.2-devel to 3.2-stable => db:migrate fails

Added by Martin Chalot over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

Hello,
I am trying to upgrade redmine version 2.5.2-devel to 3.2-stable. For not destroying my database in production i've installed the version 2.5.2-stable of redmine in my server test. Everything is working correctly (except mail I haven't configured).
In this version (2.5.2-devel) there is two things different from 2.5.2-stable :
- demandes_st_load_test : i don't know what kind of table it is
- is_public field is added that doesn't exist in the table of the version 2.5.2-stable (table queries)

I dump the sql file from the production and imported it in the database of my test server.
Then i downloaded the version of redmine 3.2-stable, I configured it etc.. But when I try this command line :

bundle exec rake db:migrate RAILS_ENV=production

It fails saying this :
bundle exec rake db:migrate RAILS_ENV=production
20130602092539 CreateQueriesRoles: migrating =============================
-- create_table(:queries_roles, {:id=>false})
rake aborted!
StandardError: An error has occurred, all later migrations canceled:

Mysql2::Error: Table 'queries_roles' already exists: CREATE TABLE `queries_roles` (`query_id` int(11) NOT NULL, `role_id` int(11) NOT NULL) ENGINE=InnoDB
/var/lib/gems/2.1.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:80:in `_query'
/var/lib/gems/2.1.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:80:in `block in query'
/var/lib/gems/2.1.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:79:in `handle_interrupt'
/var/lib/gems/2.1.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:79:in `query'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:309:in `block in execute'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_adapter.rb:484:in `block in log'
/var/lib/gems/2.1.0/gems/activesupport-4.2.7.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_adapter.rb:478:in `log'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:309:in `execute'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/mysql2_adapter.rb:231:in `execute'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:222:in `create_table'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:474:in `create_table'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:665:in `block in method_missing'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:634:in `block in say_with_time'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:634:in `say_with_time'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:654:in `method_missing'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:416:in `method_missing'
/usr/share/redmine3/db/migrate/20130602092539_create_queries_roles.rb:3:in `up'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:571:in `up'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:611:in `exec_migration'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:592:in `block (2 levels) in migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:591:in `block in migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:590:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:768:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:998:in `block in execute_migration_in_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:1046:in `ddl_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:997:in `execute_migration_in_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:959:in `block in migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:955:in `each'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:955:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:823:in `up'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:801:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
/var/lib/gems/2.1.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/usr/local/bin/ruby_executable_hooks2.1:15:in `eval'
/usr/local/bin/ruby_executable_hooks2.1:15:in `<main>'
ActiveRecord::StatementInvalid: Mysql2::Error: Table 'queries_roles' already exists: CREATE TABLE `queries_roles` (`query_id` int(11) NOT NULL, `role_id` int(11) NOT NULL) ENGINE=InnoDB
/var/lib/gems/2.1.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:80:in `_query'
/var/lib/gems/2.1.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:80:in `block in query'
/var/lib/gems/2.1.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:79:in `handle_interrupt'
/var/lib/gems/2.1.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:79:in `query'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:309:in `block in execute'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_adapter.rb:484:in `block in log'
/var/lib/gems/2.1.0/gems/activesupport-4.2.7.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_adapter.rb:478:in `log'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:309:in `execute'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/mysql2_adapter.rb:231:in `execute'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:222:in `create_table'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:474:in `create_table'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:665:in `block in method_missing'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:634:in `block in say_with_time'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:634:in `say_with_time'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:654:in `method_missing'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:416:in `method_missing'
/usr/share/redmine3/db/migrate/20130602092539_create_queries_roles.rb:3:in `up'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:571:in `up'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:611:in `exec_migration'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:592:in `block (2 levels) in migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:591:in `block in migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:590:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:768:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:998:in `block in execute_migration_in_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:1046:in `ddl_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:997:in `execute_migration_in_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:959:in `block in migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:955:in `each'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:955:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:823:in `up'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:801:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
/var/lib/gems/2.1.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/usr/local/bin/ruby_executable_hooks2.1:15:in `eval'
/usr/local/bin/ruby_executable_hooks2.1:15:in `<main>'
Mysql2::Error: Table 'queries_roles' already exists
/var/lib/gems/2.1.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:80:in `_query'
/var/lib/gems/2.1.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:80:in `block in query'
/var/lib/gems/2.1.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:79:in `handle_interrupt'
/var/lib/gems/2.1.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:79:in `query'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:309:in `block in execute'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_adapter.rb:484:in `block in log'
/var/lib/gems/2.1.0/gems/activesupport-4.2.7.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_adapter.rb:478:in `log'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:309:in `execute'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/mysql2_adapter.rb:231:in `execute'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:222:in `create_table'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:474:in `create_table'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:665:in `block in method_missing'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:634:in `block in say_with_time'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:634:in `say_with_time'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:654:in `method_missing'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:416:in `method_missing'
/usr/share/redmine3/db/migrate/20130602092539_create_queries_roles.rb:3:in `up'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:571:in `up'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:611:in `exec_migration'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:592:in `block (2 levels) in migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:591:in `block in migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:590:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:768:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:998:in `block in execute_migration_in_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:1046:in `ddl_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:997:in `execute_migration_in_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:959:in `block in migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:955:in `each'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:955:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:823:in `up'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:801:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
/var/lib/gems/2.1.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/usr/local/bin/ruby_executable_hooks2.1:15:in `eval'
/usr/local/bin/ruby_executable_hooks2.1:15:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

I have also tried to create a fresh new database and the command line is working, but when i try to import the data of the database of course there is a lot of rename field and it fails.
I've been trying for quite a while now and i don't get it. Do you know where the problem is ?

Thanks,
Best Regards,
Martin C.

Actions

Also available in: Atom PDF