Top Menu

Jump to content
Home
    • Projects
    • Work packages
    • 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
    • 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:
  • Support
  • Download and Installation
  • Migration paths
  • Migration Redmine 2x › OpenProject 30

Content

Migration Redmine 2x › OpenProject 30

  • More
    • Print
    • Table of contents

Migration Redmine 2.x › OpenProject 3.0

Disclaimer

My experience with Ruby applications is rather limited. Please feel free to suggest improvements to this process.

I ran through the process many times to refine it and it is possible that I have missed a step or that others will encounter different problems.

Environment setup

Install three new environments:

  • Redmine (I was using 2.3.1.stable) - Create a duplicate of your existing Redmine installation, perhaps on a VM, with a copy of your data (make sure it is a new database with a COPY of your data)
  • OpenProject 2.4 - Perhaps in another VM, or the same VM as your Redmine copy.
  • OpenProject 3.0 - On your new host - I followed https://www.openproject.org/projects/openproject/wiki/Debian_Stable_with_MySQL_in_production

In each case, make sure the production environment works correctly with the sample data.

Migration Process

The basic principle is to

  • Take a copy of the Redmine data
  • Wind back the migrations on the Redmine data to a point that matches in the list of OpenProject 2.4 migrations
  • Apply the OpenProject 2.4 migrations
  • Copy the data to the new OpenProject 3.0 installation
  • Apply the OpenProject 3.0 migrations

In practice there were a few wrinkles.

Migration Steps

1. Make sure your Redmine copy is up and running with the correct data

On existing Redmine production host

    # mysqldump -p redmine > rm-20140311.sql

Copy the sql file to the new Redmine VM

Import the data to the new Redmine database

    # mysql -p redmine < rm-20140311.sql

2. Find a common point in the list of mirations (in db/migrate) between Redmine and OpenProject 2.4

Each migration is a separate file and on close inspection you will find that

In my case this was 20110401192910_add_index_to_users_type.rb

3. Migrate down in redmine to the common point

In the redmine root directory (on the new redmine VM)

There were 34 subsequent migrations so

    # RAILS_ENV=production rake db:rollback STEP=34

4. Copy the data to the new openproject 2.4 database

    # mysqldump -p redmine > rm-migrate.sql

    # mysqladmin -p drop openproject24
    # mysqladmin -p create openproject24

    # mysql -p openproject24 < rm-migrate.sql

5. Run all migrations to bring it up to 2.4 level

In the new openproject 2.4 root directory

    # RAILS_ENV=production rake db:migrate

I ran into a problem with some “NULL” values in the “possible_values” field of the custom_fields table. Fixed this by hand in mysql workbench on openproject24 and re-ran the migration.

6. Copy the data to the openproject 3.0 database

    # mysqldump -p openproject24 > op24-migrate.sql

copy the sql file to the openproject 3 server, then, on the new openproject 3.0 server

    # mysqladmin -p drop openproject     (clear away any old data)

    # mysql -p -u root

    mysql> CREATE DATABASE openproject CHARACTER SET utf8;  (did it this way because otherwise I got locale/collation issues)
    mysql> \q

    # mysql -p openproject < op24-migrate.sql

7. Run all migrations to bring it up to 3.0 level

In openproject 3.0 root directory, as the openproject user:

    $ RAILS_ENV="production" bundle exec rake db:migrate

This ran until it complained about attachments.

I manually (using Mysql Workbench) removed 4 bad attachments, the coresponding legacy journal entries, one other bad legacy journal entry, and the one and only document from the database.

I also changed the locale field in custom_field_translations to en (was en-GB).

Again I ran

    $ RAILS_ENV="production" bundle exec rake db:migrate

This then ran until I got

==  MigrateQueryTrackerReferencesToType: migrating ============================
-- Update tracker references in queries
rake aborted!
An error has occurred, all later migrations canceled:

undefined class/module Syck::/usr/local/rvm/gems/ruby-2.1.1/gems/delayed_job-3.0.5/lib/delayed/psych_ext.rb:135:in `rescue in resolve_class_with_constantize'

On investigation, I found I had to edit /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/psych/class_loader.rb by adding:

require 'yaml'
YAML::ENGINE.yamler = 'syck'
require 'syck'

Again I ran

    $ RAILS_ENV="production" bundle exec rake db:migrate

This then ran to completion

I examined the work packages in the web interface and all looks good.

(I had to manually fix sone hardcoded URL references in Wiki pages that included the IP address of the old redmine server - removing “http://aa.bb.cc.dd”)

8. Copy the “files” directory over and flatten the structure

The files in redmine are organised hierarchically into years and months but openproject used a flat directory. The file names are however the same so just moving all the files from the subdirectories to the files directory itself is sufficient.

Hope this helps.

John Parker

Loading...