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. Howto import and migrate 6.0.4 database in newly installed 7.3.2?

Howto import and migrate 6.0.4 database in newly installed 7.3.2?

Added by Frank Michler over 7 years ago

Hi,
I am trying to migrate an OpenProject 6.0.4 to a newly installed OpenProject 7.3.2.

My question is:
How do I successfully import and migrate the old database to a new Debian 8 based OpenProject installation?

  • The current system is running on OpenProject 6.0.4 (Ubuntu based Bitnami VM appliance)
  • The new system is OpenProject 7.3.2, Debian 8, installed according to https://www.openproject.org/download-and-installation/#installation
  • I have dumped the database using mysqldump
  • I made a copy of the files directory using tar

Some more specific questions regarding the debian based installation are:

  • How do I start/stop the openproject related services? In bitnami I would run for example /opt/bitnami/ctlscript.sh stop and /opt/bitnami/ctlscript.sh start mysql. How is this done in debian 8?
  • I know in /etc/init.d are scripts to start and stop services. Which ones should I stop before I pump my dump.sql file in the new mysql database? Just apache2 and memcached?

    • How do I apply database migrations? In Bitnami installation I would run
cd /opt/bitnami/apps/openproject/htdocs
ruby bin/rake db:migrate RAILS_ENV=production
  • How would I do that in the debian instalation? I found the /opt/openproject/bin directory with ruby and rake, but when I try to call it it gives me an error:

Any helpful hints are appreciated.

Thank you to to all who are improving OpenProject.

Frank Michler.


Replies (5)

RE: Howto import and migrate 6.0.4 database in newly installed 7.3.2? - Added by Oliver Günther over 7 years ago

Hi Frank,

generally, the packaged installer of OpenProject bundles ruby for the runuser openproject. Through the command openproject run, you execute commands within that context.

How do I start/stop the openproject related services? In bitnami I would run for example /opt/bitnami/ctlscript.sh stop and /opt/bitnami/ctlscript.sh start mysql. How is this done in debian 8?

service openproject stop

(systemctl restart openproject for systemd)

How do I apply database migrations? In Bitnami installation I would run

All you ever need to do is run openproject configure to perform the first-time initialization, and on upgrades, to perform migrations and potential additional features.

The configure step launches a wizard that runs you through the options the packaged installation has. In the first step, you can select an existing OpenProject bitnami MySQL database. Simply pass the existing user/dbname and the installer will re-use that database.

Of course you can also restore the dump on a fresh database and point the installer to that instead. By default, the wizard will create a new database openproject that it generates a password for.

Best,
Oliver

RE: Howto import and migrate 6.0.4 database in newly installed 7.3.2? - Added by Frank Michler over 7 years ago

Hi Oliver,

thank you for your quick response.

generally, the packaged installer of OpenProject bundles ruby for the runuser openproject. Through the command openproject run, you execute commands within that context.

That’s good to know. Thanks.

All you ever need to do is run openproject configure

I tried running openproject reconfigure and used the “reuse” option. But upon restart OpenProject wouldn’t start correctly. I get the following error:

Internal error
An error occured on the page you were trying to access. If you continue to experience problems please contact your OpenProject administrator for assistance. 

If you are the OpenProject administrator, check your log files for details about the error.

In the log obtained using openproject logs I see a fatal error regarding a missing table role_permissions

W, [2017-09-12T14:41:20.760147 #470]  WARN -- : Creating scope :open. Overwriting existing method WorkPackage.open.
W, [2017-09-12T14:41:21.102643 #468]  WARN -- : Creating scope :open. Overwriting existing method WorkPackage.open.
W, [2017-09-12T14:41:21.286680 #470]  WARN -- : [auth_saml] Missing settings from '/opt/openproject/config/plugins/auth_saml/settings.yml', skipping omniauth registration.
W, [2017-09-12T14:41:21.351235 #470]  WARN -- : Creating scope :like. Overwriting existing method Principal.like.
W, [2017-09-12T14:41:21.375142 #470]  WARN -- : Creating scope :not_builtin. Overwriting existing method User.not_builtin.
W, [2017-09-12T14:41:21.440366 #470]  WARN -- : hook registered
W, [2017-09-12T14:41:21.601391 #470]  WARN -- : Creating scope :givable. Overwriting existing method Role.givable.
W, [2017-09-12T14:41:21.674186 #468]  WARN -- : [auth_saml] Missing settings from '/opt/openproject/config/plugins/auth_saml/settings.yml', skipping omniauth registration.
W, [2017-09-12T14:41:21.735129 #468]  WARN -- : Creating scope :like. Overwriting existing method Principal.like.
W, [2017-09-12T14:41:21.753341 #468]  WARN -- : Creating scope :not_builtin. Overwriting existing method User.not_builtin.
W, [2017-09-12T14:41:21.788566 #470]  WARN -- : Creating scope :active. Overwriting existing method IssuePriority.active.
W, [2017-09-12T14:41:21.814280 #468]  WARN -- : hook registered
W, [2017-09-12T14:41:21.903766 #468]  WARN -- : Creating scope :givable. Overwriting existing method Role.givable.
W, [2017-09-12T14:41:22.025825 #470]  WARN -- : Creating scope :visible. Overwriting existing method TimeEntry.visible.
W, [2017-09-12T14:41:22.066253 #468]  WARN -- : Creating scope :active. Overwriting existing method IssuePriority.active.
W, [2017-09-12T14:41:22.253978 #468]  WARN -- : Creating scope :visible. Overwriting existing method TimeEntry.visible.
W, [2017-09-12T14:41:22.266569 #470]  WARN -- : Creating scope :open. Overwriting existing method Version.open.
W, [2017-09-12T14:41:22.496487 #468]  WARN -- : Creating scope :open. Overwriting existing method Version.open.
W, [2017-09-12T14:41:22.931974 #470]  WARN -- : Creating scope :order_by_name. Overwriting existing method Sprint.order_by_name.
W, [2017-09-12T14:41:23.067605 #468]  WARN -- : Creating scope :order_by_name. Overwriting existing method Sprint.order_by_name.
F, [2017-09-12T14:41:30.486722 #1273] FATAL -- :   
F, [2017-09-12T14:41:30.486807 #1273] FATAL -- : ActionView::Template::Error (Mysql2::Error: Table 'bitnami_openproject.role_permissions' doesn't exist: SHOW FULL FIELDS FROM `role_permissions`):
F, [2017-09-12T14:41:30.486969 #1273] FATAL -- :     16: <% end %>
    17: 
    18: <div class="widget-box--blocks--buttons">
    19:   <% if User.current.allowed_to?(:add_project, nil, global: true) %>
    20:     <%= link_to new_project_path,
    21:           { class: 'button -alt-highlight',
    22:             aria: {label: t(:label_project_new)},
F, [2017-09-12T14:41:30.486998 #1273] FATAL -- :   
F, [2017-09-12T14:41:30.487016 #1273] FATAL -- : app/services/authorization/user_allowed_service.rb:107:in `has_authorized_role?'
app/services/authorization/user_allowed_service.rb:101:in `allowed_to_globally?'
app/services/authorization/user_allowed_service.rb:66:in `allowed_to?'
app/services/authorization/user_allowed_service.rb:49:in `call'
app/models/user.rb:611:in `allowed_to?'
app/views/homescreen/blocks/_projects.html.erb:19:in `_app_views_homescreen_blocks__projects_html_erb___1604522043333281496_47190179507580'
app/views/homescreen/index.html.erb:44:in `block in _app_views_homescreen_index_html_erb___3323397428302345171_47190176933620'
app/views/homescreen/index.html.erb:41:in `each'
app/views/homescreen/index.html.erb:41:in `_app_views_homescreen_index_html_erb___3323397428302345171_47190176933620'
app/middleware/reset_current_user.rb:47:in `call'

Is there a migration missing? Or did I do something wrong?
Can I add the missing table manually?

When comparing the automatically created database with the migrated one I can see this table missing.

edit:
Could this be related to this problem described on stackoverflow?
https://stackoverflow.com/questions/44701680/mysql2error-table-table-name-doesnt-exist-show-full-fields-from-table-na

It is likely caused by ActiveRecord::Migration[5.1]. When you want to add foreign key to companies table, Migration read the tables first, but it doesn’t exist.

Changing Migration to 5.0 works for me.

Thanks again for your help.
Frank.

RE: Howto import and migrate 6.0.4 database in newly installed 7.3.2? - Added by Frank Michler over 7 years ago

Ok. I solved the problem. It’s working now.

I was running the openproject reconfigure without internet access, and it tried to fetch something (maybe apt-get or so), failed, and aborted. Therefore the migrations were not applied. When I did it again with the VM connected to the internet it worked.

My conclusion is: I always need to plug in internet access when I run openproject reconfigure. Is that correct? That would be good to know, since we want to run OpenProject in a separated network.

Thanks again,
Frank.

RE: Howto import and migrate 6.0.4 database in newly installed 7.3.2? - Added by Frank Michler over 7 years ago

One (hopefully last) problem: Where do I put the attachement files?
I copied them into the /opt/openproject/files/ folder. But they don’t show up. When I try to access them I get the Internal error again.
And when I attach a new file it will not be placed in /opt/openproject/files/

Has the attachement handling changed? Are they stored differently now?

RE: Howto import and migrate 6.0.4 database in newly installed 7.3.2? - Added by Frank Michler over 7 years ago

That’s also solved now. For everybody else who might run into the same problem: attachement storage is configured in /etc/openproject/conf.d/other which exports environment variable ATTACHEMENTS_STORAGE_PATH

Thanks again,
Frank.

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