Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

Support Installation & Updates
  1. OpenProject
  2. Forums
  3. Support Installation & Updates
  4. Upgrading old Openproject mysql installation

Upgrading old Openproject mysql installation

Added by Steven Schveighoffer about 5 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)

RE: Upgrading old Openproject mysql installation - Added by Steven Schveighoffer about 5 years ago

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 of openproject/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:

insert into schema_migrations VALUES ('1'), (' 2'), (' 3'), (' 4'), (' 5'), (' 6'), (' 7'), (' 8'), (' 9'), (' 10'), (' 11'), (' 12'), (' 13'), (' 14'), (' 15'), (' 16'), (' 17'), (' 18'), (' 19'), (' 20'), (' 21'), (' 22'), (' 23'), (' 24'), (' 25'), (' 26'), (' 27'), (' 28'), (' 29'), (' 30'), (' 31'), (' 32'), (' 33'), (' 34'), (' 35'), (' 36'), (' 37'), (' 38'), (' 39'), (' 40'), (' 41'), (' 42'), (' 43'), (' 44'), (' 45'), (' 46'), (' 47'), (' 48'), (' 49'), (' 50'), (' 51'), (' 52'), (' 53'), (' 54'), (' 55'), (' 56'), (' 57'), (' 58'), (' 59'), (' 60'), (' 61'), (' 62'), (' 63'), (' 64'), (' 65'), (' 66'), (' 67'), (' 68'), (' 69'), (' 70'), (' 71'), (' 72'), (' 73'), (' 74'), (' 75'), (' 76'), (' 77'), (' 78'), (' 79'), (' 80'), (' 81'), (' 82'), (' 83'), (' 84'), (' 85'), (' 86'), (' 87'), (' 88'), (' 89'), (' 90'), (' 91'), (' 92'), (' 93'), (' 94'), (' 95'), (' 96'), (' 97'), (' 98'), (' 99'), (' 100'), (' 101'), (' 102'), (' 103'), (' 104'), (' 105'), (' 106'), (' 107'), (' 108'), (' 20090214190337'), (' 20090312172426'), (' 20090312194159'), (' 20090318181151'), (' 20090323224724'), (' 20090401221305'), (' 20090401231134'), (' 20090403001910'), (' 20090406161854'), (' 20090425161243'), (' 20090503121501'), (' 20090503121505'), (' 20090503121510'), (' 20090614091200'), (' 20090704172350'), (' 20090704172355'), (' 20090704172358'), (' 20091010093521'), (' 20091017212227'), (' 20091017212457'), (' 20091017212644'), (' 20091017212938'), (' 20091017213027'), (' 20091017213113'), (' 20091017213151'), (' 20091017213228'), (' 20091017213257'), (' 20091017213332'), (' 20091017213444'), (' 20091017213536'), (' 20091017213642'), (' 20091017213716'), (' 20091017213757'), (' 20091017213835'), (' 20091017213910'), (' 20091017214015'), (' 20091017214107'), (' 20091017214136'), (' 20091017214236'), (' 20091017214308'), (' 20091017214336'), (' 20091017214406'), (' 20091017214440'), (' 20091017214519'), (' 20091017214611'), (' 20091017214644'), (' 20091017214720'), (' 20091017214750'), (' 20091025163651'), (' 20091108092559'), (' 20091114105931'), (' 20091123212029'), (' 20091205124427'), (' 20091220183509'), (' 20091220183727'), (' 20091220184736'), (' 20091225164732'), (' 20091227112908'), (' 20100129193402'), (' 20100129193813'), (' 20100221100219'), (' 20100313132032'), (' 20100313171051'), (' 20100705164950'), (' 20100714111651'), (' 20100714111652'), (' 20100714111653'), (' 20100714111654'), (' 20100804112053'), (' 20100819172912'), (' 20101104182107'), (' 20101107130441'), (' 20101114115114'), (' 20101114115359'), (' 20110220160626'), (' 20110223180944'), (' 20110223180953'), (' 20110226120132'), (' 20110227125750'), (' 20110228000000'), (' 20110228000100'), (' 20110314014400'), (' 20110401192910'), (' 20110519194936'), (' 20110729125454');

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

  • (1 - 1/1)
Loading...