Content
Upgrading old Openproject mysql installation
Added by Steven Schveighoffer over 4 years ago
I have an old installation of openproject (v. 6.1.6) that I want to upgrade to the latest version, but I am running on a MySQL database.
My understanding from reading this page: https://docs.openproject.org/installation-and-operations/misc/upgrading-older-openproject-versions/
is that I can run the script and it should migrate everything automatically using temporary docker containers for everything and spits out a postgres file I can import. I've gotten it to proceed all the way to step 1.7 (Migrating database from 7 to 8).
I get the following errors. What do I need to do? I'm not a ruby guy or a docker guy, I just want to use OpenProject.
I enabled the 1.6.1 step, it doesn't help. I'm really confused about this because the previous steps talk to mysql just fine.
I should note that I am on a new Ubuntu 18.04 system. I installed mysql server and postgres server.
rake aborted!
LoadError: Error loading the 'mysql2' Active Record adapter. Missing a gem it depends on? mysql2 is not part of the bundle. Add it to your Gemfile.
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/rubygems_integration.rb:408:in `block (2 levels) in replace_gem'
/app/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/mysql2_adapter.rb:6:in `<top (required)>'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:291:in `require'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:291:in `block in require'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:257:in `load_dependency'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:291:in `require'
/app/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/connection_specification.rb:191:in `spec'
/app/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:952:in `establish_connection'
/app/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2.1/lib/active_record/connection_handling.rb:60:in `establish_connection'
/app/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2.1/lib/active_record/railtie.rb:136:in `block (2 levels) in <class:Railtie>'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/lazy_load_hooks.rb:71:in `instance_eval'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/lazy_load_hooks.rb:62:in `with_execution_control'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/lazy_load_hooks.rb:67:in `execute_hook'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/lazy_load_hooks.rb:43:in `block in on_load'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/lazy_load_hooks.rb:42:in `each'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/lazy_load_hooks.rb:42:in `on_load'
/app/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2.1/lib/active_record/railtie.rb:132:in `block in <class:Railtie>'
/app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2.1/lib/rails/initializable.rb:32:in `instance_exec'
/app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2.1/lib/rails/initializable.rb:32:in `run'
/app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2.1/lib/rails/initializable.rb:61:in `block in run_initializers'
/app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2.1/lib/rails/initializable.rb:60:in `run_initializers'
/app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2.1/lib/rails/application.rb:361:in `initialize!'
/app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2.1/lib/rails/railtie.rb:190:in `public_send'
/app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2.1/lib/rails/railtie.rb:190:in `method_missing'
/app/config/environment.rb:34:in `<top (required)>'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:291:in `require'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:291:in `block in require'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:257:in `load_dependency'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:291:in `require'
/app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2.1/lib/rails/application.rb:337:in `require_environment!'
/app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2.1/lib/rails/application.rb:520:in `block in run_tasks_blocks'
/app/vendor/bundle/ruby/2.6.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/cli/exec.rb:74:in `load'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/cli/exec.rb:74:in `kernel_load'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/cli/exec.rb:28:in `run'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/cli.rb:463:in `exec'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/cli.rb:27:in `dispatch'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/cli.rb:18:in `start'
/usr/local/bundle/gems/bundler-2.0.1/exe/bundle:30:in `block in <top (required)>'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/usr/local/bundle/gems/bundler-2.0.1/exe/bundle:22:in `<top (required)>'
/usr/local/bundle/bin/bundle:23:in `load'
/usr/local/bundle/bin/bundle:23:in `<main>'
Caused by:
Gem::LoadError: mysql2 is not part of the bundle. Add it to your Gemfile.
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/rubygems_integration.rb:408:in `block (2 levels) in replace_gem'
/app/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/mysql2_adapter.rb:6:in `<top (required)>'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:291:in `require'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:291:in `block in require'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:257:in `load_dependency'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:291:in `require'
/app/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/connection_specification.rb:191:in `spec'
/app/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:952:in `establish_connection'
/app/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2.1/lib/active_record/connection_handling.rb:60:in `establish_connection'
/app/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2.1/lib/active_record/railtie.rb:136:in `block (2 levels) in <class:Railtie>'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/lazy_load_hooks.rb:71:in `instance_eval'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/lazy_load_hooks.rb:62:in `with_execution_control'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/lazy_load_hooks.rb:67:in `execute_hook'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/lazy_load_hooks.rb:43:in `block in on_load'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/lazy_load_hooks.rb:42:in `each'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/lazy_load_hooks.rb:42:in `on_load'
/app/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2.1/lib/active_record/railtie.rb:132:in `block in <class:Railtie>'
/app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2.1/lib/rails/initializable.rb:32:in `instance_exec'
/app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2.1/lib/rails/initializable.rb:32:in `run'
/app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2.1/lib/rails/initializable.rb:61:in `block in run_initializers'
/app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2.1/lib/rails/initializable.rb:60:in `run_initializers'
/app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2.1/lib/rails/application.rb:361:in `initialize!'
/app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2.1/lib/rails/railtie.rb:190:in `public_send'
/app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2.1/lib/rails/railtie.rb:190:in `method_missing'
/app/config/environment.rb:34:in `<top (required)>'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:291:in `require'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:291:in `block in require'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:257:in `load_dependency'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:291:in `require'
/app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2.1/lib/rails/application.rb:337:in `require_environment!'
/app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2.1/lib/rails/application.rb:520:in `block in run_tasks_blocks'
/app/vendor/bundle/ruby/2.6.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/cli/exec.rb:74:in `load'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/cli/exec.rb:74:in `kernel_load'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/cli/exec.rb:28:in `run'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/cli.rb:463:in `exec'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/cli.rb:27:in `dispatch'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/cli.rb:18:in `start'
/usr/local/bundle/gems/bundler-2.0.1/exe/bundle:30:in `block in <top (required)>'
/usr/local/bundle/gems/bundler-2.0.1/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/usr/local/bundle/gems/bundler-2.0.1/exe/bundle:22:in `<top (required)>'
/usr/local/bundle/bin/bundle:23:in `load'
/usr/local/bundle/bin/bundle:23:in `<main>'
Tasks: TOP => db:migrate => db:load_config => environment
(See full trace by running task with --trace)
Could not migrate database
Replies (1)
OK, so I have solved my own problem. For anyone else who gets here, edit your migration script to use the
openproject/community:8.3.0
docker container instead ofopenproject/community:8
. The docker containers for 8, 8.3, 8.3.1, and 8.3.2 do not support mysql, and so you get this error!On top of that, after I got that working, there was an error in migrations. This is somewhat detailed in the script as step 1.6.1, but is not exactly clear that you have to actually copy and add your own list of migrations! In my case, I had to do this MySQL command:
Do this before you do the backup. Don't use my list, you have to read what the error is on your output and use those migration items.
I'm going to submit a PR for the script, as this cost me probably 2 days of searching and figuring.
EDIT: this was ALREADY FIXED Grrrr.... But the link on openproject's site goes to the unfixed version. You should update that as soon as you can so people don't waste lots of time..
Use this script instead: https://github.com/opf/openproject/blob/6420dc1b853b5b944c3f4cb1c29a71dd27b8d1dc/script/migration/migrate-from-pre-8.sh