You are here:Home»KB»Programming»General»Redmine»Upgrading Redmine
Sunday, 01 February 2015 20:02

Upgrading Redmine

Written by

These are my instructions to upgrade your Redmine install on windows and also assumes you have used my instructions for installing redmine, however this is not mandatory but will explain where the filepaths come from.

I will be upgrading Redmine 2.6.1 to Redmine 3.0.0 but i am sure they will be almost the same for other version.

Notes

  • These instructions are based on the official instructions from RedmineUpgrade - Official Instructions.
  • Redmine 3.0.0 now uses mysql 6.1.5
  • the gems are installed to the RubyInstallere and not Redmine

Instructions

Step 1 - Check Requirements

The first step to upgrading Redmine is to check that you meet the requirements for the version you're about to install.

You can easily check what version of Redmine, Ruby and Rails by browsing to Administration/Information and you will see the following information.

Environment:
  Redmine version                2.6.1.stable
  Ruby version                   2.1.5-p273 (2014-11-13) [i386-mingw32]
  Rails version                  3.2.21
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.8.11
  Filesystem                     
Redmine plugins:
  no plugin installed

Redmine 3.0.0 requires, Ruby 1.9.3 or higher (and now supports ruby 2.2).

Step 2 - Backup

  1. Backup your redmine database via phpmyadmin (or any other method you prefer)
  2. make a full backup of your redmine directory (ie D:\Documents\Developer\RubyRoot\redmine\)

Step 3 - Perform the upgrade

    1. If Redmine is running, gracefully stop redmine, the redmine service if running and any related xampp installation (ie D:\Documents\Developer\xampp)
    2. Download the following software
    3. Rename
      D:\Documents\Developer\RubyRoot\redmine\
      to
      D:\Documents\Developer\RubyRoot\old-redmine\
    4. Extract redmine-3.0.0.zip to D:\Documents\Developer\RubyRoot\redmine
    5. From the '.../old-redmine/' directory, copy the following files to the same location in the new redmine installation '.../redmine/'
      • {redmine}/config/database.yml
      • {redmine}config/configuration.yml
      • {redmine}/files/ directory content (this directory contains all your uploaded files so you might not have any).
      • The folders of your custom plugins from your plugins directory (or vendor/plugins directory if upgrading from a 1.x version) into new installation plugins directory. Make sure that you copy only plugins that are were not initially bundled with your previous Redmine setup. My installation does not have any plugins so this step is not needed.
      • If you are running Redmine in a subfolder
        • {redmine}/config/environment.rb (this might require merging rather than copying)
        • {redmine}/config.ru (this might require merging rather than copying)
      • If you have the redmine service copy the following files
        • redmine_service_ctl.rb
        • redmine_service.rb
    6. Open up a command prompt as an administrator and navigate to D:\Documents\Developer\RubyRoot\redmine
    7. Install the required gems by running the following command:
      bundle install --without development test
      • this installs all the required gems
      • this brings up the following message about the new version of the MySQL connector that has been installed
        ================================================================================
        
          You've installed the binary version of mysql2.
          It was built using MySQL Connector/C version 6.1.5.
          It's recommended to use the exact same version to avoid potential issues.
        
          At the time of building this gem, the necessary DLL files were retrieved from:
        
          http://cdn.mysql.com/Downloads/Connector-C/mysql-connector-c-6.1.5-win32.zip
        
          This gem *includes* vendor/libmysql.dll with redistribution notice in vendor/README.
        
        ================================================================================
      • You need to extract  libmysql.dll from mysql-connector-c-6.1.5-win32.zip. The file is located in the archive at ...\mysql-connector-c-6.1.5-win32\bin
      • Replace D:\Documents\Developer\RailsInstaller\mysql\lib\libmysql.dll with the new version of libmysql.dll
      • you might need to reboot windows for the new version of libmysql.dll to be loaded
    8. Run the following command from your new Redmine root directory:
      bundle exec rake generate_secret_token
    9. Check for any themes that you may have installed in the public/themes directory. You can copy them over but checking for updated version is ideal.

Step 4 - Update the database

  1. Start your xampp install apache and mysql
  2. This step is the one that could change the contents of your database. Go to your new redmine directory, then migrate your database:
    bundle exec rake db:migrate RAILS_ENV=production
  3. If you have installed any plugins, you should also run their database migrations:
    bundle exec rake redmine:plugins:migrate RAILS_ENV=production

Step 5 - Clean Up

  1. Clear the cache and the existing sessions:
    bundle exec rake tmp:cache:clear tmp:sessions:clear RAILS_ENV=production
  2. Restart the application server (e.g. puma, thin, passenger)
  3. Finally go to "Admin -> Roles & permissions" to check/set permissions for the new features, if any.

Links

Read 1066 times Last modified on Tuesday, 03 March 2015 20:36