Upgrade Redmine from 3.4.6.stable to 6.0.3.stable on Debian
Added by Yarr Yarrkin 14 days ago
Hello.
Old installation (Debian9):
Environment:
Redmine version 3.4.6.stable
Ruby version 2.3.3-p222 (2016-11-21) [x86_64-linux-gnu]
Rails version 4.2.8
Environment production
Database adapter Mysql2
SCM:
Git 2.20.1
Filesystem
Redmine plugins:
a_common_libs 2.4.9
global_roles 2.2.3
progressive_projects_list 3.0.1
redmine_auto_percent 0.0.1
redmine_drafts 0.2.0
redmine_preview_office 1.0.3
redmine_preview_pdf 1.0.3
usability 2.3.6
Make new zero installation on Debian12 from this instruction https://www.redmine.org/projects/redmine/wiki/How_to_Install_Redmine_603_on_Debian_124_(MySQL):
Environment:
Redmine version 6.0.3.stable
Ruby version 3.1.2-p20 (2022-04-12) [i386-linux-gnu]
Rails version 7.2.2.1
Environment production
Database adapter Mysql2
Mailer queue ActiveJob::QueueAdapters::AsyncAdapter
Mailer delivery smtp
Redmine settings:
Redmine theme Classic
SCM:
Subversion 1.14.2
Bazaar 3.3.2
Filesystem
Redmine plugins:
no plugin installed
Than do https://www.redmine.org/projects/redmine/wiki/RedmineBackupRestore:
- in old server mysqldump u <username> -p<password> <redmine_database> in new server mysql u <username> -p<password> <redmine_database> copy contents of directory 'Files'
- bundle update
- bundle exec rake db:migrate RAILS_ENV=production
- bundle exec rake redmine:plugins:migrate RAILS_ENV=production
- bundle exec rake tmp:cache:clear RAILS_ENV=production
- sudo systemctl restart apache2
Go to Redmine in new server.
authorization, ./, ./admin, ./groups, ./roles, ./trackers... etc - is OK
./my/page, ./projects, ./admin/projects, ./users... - Internal error 500.
In redmine/log/production.log I see:
[485a4a17-42d4-4fce-8b20-449fc91e29cd]
[485a4a17-42d4-4fce-8b20-449fc91e29cd] app/controllers/users_controller.rb:58:in `index'
[485a4a17-42d4-4fce-8b20-449fc91e29cd] lib/redmine/sudo_mode.rb:78:in `sudo_mode'
I, [2025-04-03T10:51:49.090382 #18525] INFO -- : [62e14e8b-5548-40ff-ae98-9066a9995208] Started GET "/users" for 192.168.0.33 at 2025-04-03 10:51:49 +0300
I, [2025-04-03T10:51:49.090919 #18525] INFO -- : [62e14e8b-5548-40ff-ae98-9066a9995208] Processing by UsersController#index as HTML
I, [2025-04-03T10:51:49.094048 #18525] INFO -- : [62e14e8b-5548-40ff-ae98-9066a9995208] Current user: User (id=5)
I, [2025-04-03T10:51:49.115967 #18525] INFO -- : [62e14e8b-5548-40ff-ae98-9066a9995208] Completed 500 Internal Server Error in 25ms (ActiveRecord: 1.0ms (4 queries, 0 cached) | GC: 1.9ms)
F, [2025-04-03T10:51:49.118737 #18525] FATAL -- : [62e14e8b-5548-40ff-ae98-9066a9995208]
[62e14e8b-5548-40ff-ae98-9066a9995208] NoMethodError (undefined method `description' for #<UserQuery id: nil, project_id: nil, name: "_", filters: {"status"=>{:operator=>"=", :values=>[1]}}, user_id>
Did you mean? decrypt):
[62e14e8b-5548-40ff-ae98-9066a9995208]
[62e14e8b-5548-40ff-ae98-9066a9995208] app/controllers/users_controller.rb:58:in `index'
[62e14e8b-5548-40ff-ae98-9066a9995208] lib/redmine/sudo_mode.rb:78:in `sudo_mode'
Replies (4)
RE: Upgrade Redmine from 3.4.6.stable to 6.0.3.stable on Debian
-
Added by Holger Just 13 days ago
The description
column was added to the queries table with a new migration in Redmine 6.0.0. Given your error, it appears that you did not successfully run all required migrations on your updated database.
To fix this, make sure that the rake db:migrate
tasks succeeds without any error. Also, make sure that you start your server using the right RAILS_ENV
environment and that you have configured the correct database in your config/database.yml
.
RE: Upgrade Redmine from 3.4.6.stable to 6.0.3.stable on Debian
-
Added by Yarr Yarrkin 13 days ago
Holger Just, thanks!
When update the database (bundle exec rake db:migrate RAILS_ENV=production), I see:
20220714093000 AddJournalUpdatedOn: migrating ============================-- add_column(:journals, :updated_on, :datetime, {:after=>:created_on, :precision=>nil})
rake aborted!
StandardError: An error has occurred, all later migrations canceled:
Mysql2::Error: Duplicate column name 'updated_on'
Any hint?
RE: Upgrade Redmine from 3.4.6.stable to 6.0.3.stable on Debian
-
Added by Holger Just 13 days ago
Well, as it says:
An error has occurred, all later migrations canceled
Your database is not fully migrated and is thus not ready to be used with your updated Redmine version.
As for the failing migration, it appears that the schema of your database was change without applying the actual migrations (e.g. by manually adding the updated_on
column to the journals
table). If you do not need the data which is stored there currently you could try to remove the column from the table and try the migration again. Always make sure to get a full backup of your database before editing it or running any migrations to ensure that you can go back if anything goes wrong.
RE: Upgrade Redmine from 3.4.6.stable to 6.0.3.stable on Debian
-
Added by Yarr Yarrkin 13 days ago
Holger Just, Thanks a lot!
"to remove the column from the table" - it's work.
Do I understand correctly that in this "-- add_column(: journals, :updated_on, :datetime, {:after=>:created_on, :precision=>nil})" entry, the table is listed in the first position?