Top Menu

Jump to content
Home
    • Projects
    • Work packages
    • News
    • Getting started
    • Introduction video

      Welcome to OpenProject Community

      Get an overview

      Get a quick overview of project management and team collaboration with OpenProject.
      You can restart this video from the help menu

    • Help and support
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Professional 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?
      Create a new account

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
  • Roadmap
  • Work packages
  • Calendars
  • Team planners
  • Boards
  • Forums
  • Wiki
    • Table of contents
      • Expanded. Click to collapseCollapsed. Click to showDeveloper
        • Hierarchy leafAccessibility Checklist
        • Hierarchy leafCode Review Guidelines
        • Expanded. Click to collapseCollapsed. Click to showContribution
          • Hierarchy leafGit Workflow
          • Hierarchy leafTranslations
        • Expanded. Click to collapseCollapsed. Click to showDeveloping Plugins
          • Hierarchy leafDeveloping an OmniAuth Authentication Plugin
        • Hierarchy leafRelease Process
        • Hierarchy leafReport a bug
        • Hierarchy leafSecurity
        • Hierarchy leafSetting up an OpenLDAP server for testing
        • Hierarchy leafTheme Features
      • Hierarchy leafDownload
      • Expanded. Click to collapseCollapsed. Click to showFeature tour
        • Hierarchy leafRelease Notes OpenProject 30
        • Expanded. Click to collapseCollapsed. Click to showRelease Notes OpenProject 30 - Overview
          • Hierarchy leafGlossary
          • Hierarchy leafRelease Notes - Accessibility
          • Hierarchy leafRelease Notes - Accessibility changes
          • Hierarchy leafRelease Notes - Add work package queries as menu items to sidebar
          • Hierarchy leafRelease Notes - Copy projects based on Templates
          • Hierarchy leafRelease Notes - Design changes
          • Hierarchy leafRelease Notes - Fixed Bugs
          • Hierarchy leafRelease Notes - Keyboard Shortcuts
          • Hierarchy leafRelease Notes - Project settings
          • Hierarchy leafRelease Notes - Ruby&Rails Update
          • Hierarchy leafRelease Notes - Security
          • Hierarchy leafRelease Notes - Timelines
          • Hierarchy leafRelease Notes - Work packages
      • Hierarchy leafHowto create animated gifs
      • Hierarchy leafMigration Squashing
      • Hierarchy leafMod security
      • Hierarchy leafNew work package page
      • Hierarchy leafOP3 to OP4 Debian upgrade
      • Hierarchy leafOP4 Ubuntu1404 Stable with MySQL in production
      • Hierarchy leafOpenProject 40 Development Setup
      • Expanded. Click to collapseCollapsed. Click to showOpenProject Foundation
        • Hierarchy leafBoards
        • Hierarchy leafMembers
        • Hierarchy leafOPF-Meetings
        • Hierarchy leafStatutes
      • Expanded. Click to collapseCollapsed. Click to showRelease Notes
        • Hierarchy leafOpenProject released on Bitnami
      • Expanded. Click to collapseCollapsed. Click to showRelease Notes OpenProject 40 - Overview
        • Hierarchy leafRelease Notes OpenProject 40 - Accessibility improvements
        • Hierarchy leafRelease Notes OpenProject 40 - Column header functions in work package table
        • Hierarchy leafRelease Notes OpenProject 40 - Improved Design
        • Hierarchy leafRelease Notes OpenProject 40 - Integrated query title on work package page
        • Hierarchy leafRelease Notes OpenProject 40 - Integrated toolbar on work package page
        • Hierarchy leafRelease Notes OpenProject 40 - OmniAuth integration for OpenProject
        • Hierarchy leafRelease Notes OpenProject 40 - Work package details pane
      • Expanded. Click to collapseCollapsed. Click to showSecurity and privacy
        • Hierarchy leafFAQ
      • Expanded. Click to collapseCollapsed. Click to showSupport
        • Expanded. Click to collapseCollapsed. Click to showDownload and Installation
          • Hierarchy leafInstallation MacOS
          • Expanded. Click to collapseCollapsed. Click to showInstallation OpenProject 3 0
            • Hierarchy leafDebian Stable with MySQL in production
            • Hierarchy leafInstallation Ubuntu
            • Hierarchy leafInstallation Windows
            • Hierarchy leafInstallation on Centos 65 x64 with Apache and PostgreSQL 93
          • Expanded. Click to collapseCollapsed. Click to showInstallation OpenProject 40
            • Hierarchy leafOP4 Debian Stable with MySQL in production
          • Expanded. Click to collapseCollapsed. Click to showMigration paths
            • Hierarchy leafFrom Chilliproject to OpenProject
            • Hierarchy leafMigration 15 to 30
            • Hierarchy leafMigration 24 to 30
            • Hierarchy leafMigration Redmine 2x › OpenProject 30
            • Hierarchy leafOpenProject 3 Migration
          • Hierarchy leafOpenProject 40
        • Expanded. Click to collapseCollapsed. Click to showNews
          • Hierarchy leafNew OpenProject Translations Plugin
          • Hierarchy leafNew Plugin on OpenProjectorg Local Avatars
          • Hierarchy leafNew design for OpenProject
          • Hierarchy leafNews Accessibility workshop for OpenProject
          • Hierarchy leafNews Glossary for OpenProject
          • Hierarchy leafNews Heartbleed fixed
          • Hierarchy leafNews Icon Fonts
          • Hierarchy leafNews OpenProject 30 Release
          • Hierarchy leafNews Release GitHub Integration Plugin
          • Hierarchy leafNews Success Story Deutsche Telekom
          • Hierarchy leafNews Timelines
          • Hierarchy leafOpenProject 3013 released
          • Hierarchy leafOpenProject 3017 released
          • Hierarchy leafOpenProject 40 released
          • Hierarchy leafOpenProject 40 will be coming soon
          • Hierarchy leafOpenProject 405 released
          • Hierarchy leafOpenProject and pkgrio
          • Hierarchy leafOpenProject news moved to a new blog
          • Hierarchy leafOpenProjectBitnami
          • Hierarchy leafPackager version with plugins released ("Community edition")
          • Hierarchy leafRegistration OpenProject-Foundation
          • Hierarchy leafRelease OpenProject AuthPlugins
          • Hierarchy leafUpdates on OpenProject
          • Hierarchy leafWe need your feedback for the the new fullscreen view for work packages
        • Hierarchy leafOpenProject Plug-Ins
      • Hierarchy leafWiki
You are here:
  • Forums
  • Support Installation & Updates

Content

Howto import and migrate 6.0.4 database in newly installed 7.3.2?

Added by Frank Michler almost 5 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 almost 5 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 almost 5 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 almost 5 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 almost 5 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 almost 5 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...