Good day, we are running an extremly old version of Zammad (2.5), because we had some issues updating, we never continued to other versions.
With a new server in our hands we wanted to move everything and upgrade to the (near) latest versions of all software.
i’ve started building Zammad 2.5 on the 22.04 machine (its still in testing phase), and it runs, the basic functions work. Because the upgrade notes suggest a Major version step-by-step upgrade. We’ve folled all steps, from 2.5 to 3.0, from 3.0 to 4.1.1, and now from 4.1.1 to 5.x.x.
note: Ubuntu 22.04 comes with an other openssl version, all rvm builds are done with openssl1.1.1n via: rvm install ruby-2.x.x --with-openssl-dir=/opt/openssl
i’ve managed to succesfully update to zammad 4.1.1, with ruby 2.6.8 and elasticsearch 6.5.4.
When i want to upgrade zammad from 4.1.1 to 5.x.x (tried 5.0.0 / 5.0.2 / 5.1.1) i’m not able to get past the ‘rake db:migrate’ command.
i’ve take notice that Ubuntu22.04 is not yet on the supported platforms list, but since it runs 2.5 → 4.1.1 i couldn’t realy see why this error is related to that. (correct me if i’m wrong).
Used Zammad version: 5.x.x
Used Zammad installation type: Source (MySQL)
Operating system: Ubuntu Server 22.04 LTS
Browser + version: Edge v101
Expected behavior:
DB:Migrate should succesfully finish after the update
Actual behavior:
$ rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
nil versions are discouraged and will be deprecated in Rubygems 4
** Execute db:load_config
** Execute db:migrate
rake aborted!
ActiveRecord::DuplicateMigrationNameError:
Multiple migrations have the name SettingAddInternalArticleCheck.
/usr/share/rvm/gems/ruby-2.7.4/gems/activerecord-6.0.4.1/lib/active_record/migration.rb:1334:in 'validate'
/usr/share/rvm/gems/ruby-2.7.4/gems/activerecord-6.0.4.1/lib/active_record/migration.rb:1204:in 'initialize'
/usr/share/rvm/gems/ruby-2.7.4/gems/activerecord-6.0.4.1/lib/active_record/migration.rb:1061:in 'new'
/usr/share/rvm/gems/ruby-2.7.4/gems/activerecord-6.0.4.1/lib/active_record/migration.rb:1061:in 'up'
/usr/share/rvm/gems/ruby-2.7.4/gems/activerecord-6.0.4.1/lib/active_record/migration.rb:1036:in 'migrate'
/usr/share/rvm/gems/ruby-2.7.4/gems/activerecord-6.0.4.1/lib/active_record/tasks/database_tasks.rb:238:in 'migrate'
/usr/share/rvm/gems/ruby-2.7.4/gems/activerecord-6.0.4.1/lib/active_record/railties/databases.rake:86:in 'block (3 levels) in <main>'
/usr/share/rvm/gems/ruby-2.7.4/gems/activerecord-6.0.4.1/lib/active_record/railties/databases.rake:84:in 'each'
/usr/share/rvm/gems/ruby-2.7.4/gems/activerecord-6.0.4.1/lib/active_record/railties/databases.rake:84:in 'block (2 levels) in <main>'
/usr/share/rvm/gems/ruby-2.7.4/gems/rake-13.0.6/lib/rake/task.rb:281:in 'block in execute'
/usr/share/rvm/gems/ruby-2.7.4/gems/rake-13.0.6/lib/rake/task.rb:281:in 'each'
/usr/share/rvm/gems/ruby-2.7.4/gems/rake-13.0.6/lib/rake/task.rb:281:in 'execute'
/usr/share/rvm/gems/ruby-2.7.4/gems/rake-13.0.6/lib/rake/task.rb:219:in 'block in invoke_with_call_chain'
/usr/share/rvm/gems/ruby-2.7.4/gems/rake-13.0.6/lib/rake/task.rb:199:in 'synchronize'
/usr/share/rvm/gems/ruby-2.7.4/gems/rake-13.0.6/lib/rake/task.rb:199:in 'invoke_with_call_chain'
/usr/share/rvm/gems/ruby-2.7.4/gems/rake-13.0.6/lib/rake/task.rb:188:in 'invoke'
/usr/share/rvm/gems/ruby-2.7.4/gems/rake-13.0.6/lib/rake/application.rb:160:in 'invoke_task'
/usr/share/rvm/gems/ruby-2.7.4/gems/rake-13.0.6/lib/rake/application.rb:116:in 'block (2 levels) in top_level'
/usr/share/rvm/gems/ruby-2.7.4/gems/rake-13.0.6/lib/rake/application.rb:116:in 'each'
/usr/share/rvm/gems/ruby-2.7.4/gems/rake-13.0.6/lib/rake/application.rb:116:in 'block in top_level'
/usr/share/rvm/gems/ruby-2.7.4/gems/rake-13.0.6/lib/rake/application.rb:125:in 'run_with_threads'
/usr/share/rvm/gems/ruby-2.7.4/gems/rake-13.0.6/lib/rake/application.rb:110:in 'top_level'
/usr/share/rvm/gems/ruby-2.7.4/gems/rake-13.0.6/lib/rake/application.rb:83:in 'block in run'
/usr/share/rvm/gems/ruby-2.7.4/gems/rake-13.0.6/lib/rake/application.rb:186:in 'standard_exception_handling'
/usr/share/rvm/gems/ruby-2.7.4/gems/rake-13.0.6/lib/rake/application.rb:80:in 'run'
/usr/share/rvm/gems/ruby-2.7.4/gems/rake-13.0.6/exe/rake:27:in '<top (required)>'
/usr/share/rvm/gems/ruby-2.7.4/bin/rake:23:in 'load'
/usr/share/rvm/gems/ruby-2.7.4/bin/rake:23:in '<main>'
/usr/share/rvm/gems/ruby-2.7.4/bin/ruby_executable_hooks:22:in 'eval'
/usr/share/rvm/gems/ruby-2.7.4/bin/ruby_executable_hooks:22:in '<main>'
Tasks: TOP => db:migrate
Steps to reproduce the behavior:
Because i’ve updated multiple versions i’ve used this routine
$ systemctl stop zammad
$ cp -r zammad zammad-4.1.1
$ su zammad
$ cd /opt/zammad
$ rails r "Cache.clear"
$ exit
$ apt install nodejs
$ echo "rvm --default use 2.7.4" >> /opt/zammad/.bashrc
$ cd /opt
$ wget https://ftp.zammad.com/zammad-5.0.2.tar.gz
$ tar -xzf zammad-5.0.2.tar.gz --strip-components 1 -C zammad
$ chown -R zammad:zammad zammad
$ su zammad
$ cd /opt/zammad
$ rvm install ruby-2.7.4 --with-openssl-dir=/opt/openssl ## Success
$ gem install bundler ## Success
$ bundle install --without test development postgres ## Success
$ rake db:migrate --trace ## Error```
investigating the database itself, changed every table and colum to utf8_general_ci.
Still got the error.
did an ‘search’ on the function called in the error, found that there where 2 migration files with nearly identical names.
After removing one of the files (oldest ) the DB:migrate seems to work correctly.