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. MySql DB Migration Failure (Mayor Release Upgrade: 6.1.5 to 7.0.0)

MySql DB Migration Failure (Mayor Release Upgrade: 6.1.5 to 7.0.0)

Added by Rafael Medina almost 8 years ago

Upgrading from 6.1.5 to release 7.0.0 from a deb package, after “openproject configure” or “openproject reconfigure” is executed, the migration returns the following error:

20161102160032 CreateEnterpriseToken: migrating ==
— create_table(:enterprise_tokens)
rake aborted!
StandardError: An error has occurred, all later migrations canceled:

Mysql2::Error: Table ‘enterprise_tokens’ already exists: CREATE TABLE `enterprise_tokens` (`id` int AUTO_INCREMENT PRIMARY KEY, `encoded_token` text, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB

I’m following the procedure as is described from:

https://www.openproject.org/operations/upgrading/upgrade-guide-packaged-installation/
Section: Upgrading between major releases (DEB/RPM packages).

Ubuntu Server: 16.04.2
MySql: mysql Ver 14.14 Distrib 5.7.18, for Linux (x86_64) using EditLine wrapper
Package: openproject_7.0.0-1496397818.c893b74.xenial_amd64.deb
Source: https://packager.io/gh/opf/openproject-ce/install?bid=362#ubuntu-16-04-openproject

Any suggestion / Workarround / solution will be welcome.

Thanks.


Replies (4)

RE: MySql DB Migration Failure (Mayor Release Upgrade: 6.1.5 to 7.0.0) - Added by Oliver Günther almost 8 years ago

Hi Rafael,

as your cited output from the migrations describe, one of the tables added in 7.0. already exists in the database you use for OpenProject. That may either be due

1. to other data residing in this database,
2. a previous migration that did not correctly persist to the database,
3. a previous upgrade to some early version of OpenProject 7.0. that may had another migration for the same table

To remove the existing table, connect to your mysql database:

mysql -u<username> -p <database> 

and remove the table manually:

DROP TABLE enterprise_tokens;

Best,
Oliver

RE: MySql DB Migration Failure (Mayor Release Upgrade: 6.1.5 to 7.0.0) - Added by Rafael Medina almost 8 years ago

Thank you Oliver for your quick response,

It’s seems that “db:migrate” needs more than only “enterprise_tokens” table to be deleted. I’ve deleted the following 4 tables from my current openproject database:

  1. enterprise_tokens
  2. custom_styles
  3. custom_options
  4. design_colors

By doing that, I’m now able to finish “db:migrate” and “db:seed” successfully , the bad news are that now, “enterprise_tokens” table is needed by openproject service to start, and a fatal error happens.

This is the error message found into “/opt/openproject/log/production.log”

[2017-06-06T01:11:36.623635 #3369] FATAL — : ActionView::Template::Error (Mysql2::Error: Table ‘openproject.enterprise_tokens’ doesn’t exist: SELECT `enterprise_tokens`.* FROM `enterprise_tokens` ORDER BY created_at DESC LIMIT 1):

The main openproject page shows a HTTP 500 Internal Server Error because this.

What do you think?

RE: MySql DB Migration Failure (Mayor Release Upgrade: 6.1.5 to 7.0.0) - Added by Oliver Günther almost 8 years ago

Could you post the complete output of the migration log that ran successfully after you removed the mentioned tables?

Best,
Oliver

RE: MySql DB Migration Failure (Mayor Release Upgrade: 6.1.5 to 7.0.0) - Added by Rafael Medina almost 8 years ago

Hi Oliver. Finally this migration was successful.

As a Summary, what I did was:

————

1.- Drop 4 Tables:

enterprise_tokens
custom_styles
custom_options
design_colors

2.- Rebuild 2 Tables using:

rake db:migrate:redo VERSION=20161116130657 —> “custom_styles”
rake db:migrate:redo VERSION=20161102160032 ——> “enterprise_tokens”
————

Thanks for your guidance.

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