Friday, February 26, 2016

Upgrade from Redmine 2.x to Redmine 3.x on a Windows server

Today I want to give a summary of the painful steps I came through to install Redmine on a windows server (sometimes, you can't chose).
I assume that you have a backup of your database.

Install Rails

Pick the last installer on http://railsinstaller.org/fr-FR

(take a look at the requirements here)

Extract Redmine

Download the package 3.x from here.
Extract it to server's hardrive (in C:\ for example).

Optional : Recover the password of the database

Get into the previsous redmine installation directory.
Open config/database.yml and note the password.

production:
  adapter: mysql
  database: redmine
  host: localhost
  username: redmine
  password: my_password

Copy your old confiuration files

Go to your old redmine install directory and copy :
  • config/configuration.yml 
  • config/database.yml
to the same location in your new redmine install directory.

Install Dependencies

Open a cmd and type :

gem install bundler
gem install thin
gem install thin_service

Open GemFile at the root of your new redmine install directory and add the following lines;

gem "thin"gem "i18n"

Proceed to Redmine installation

Still from cmd, go to your new redmine install directory (say C:\redmine3.2.0) and type:
bundle install --without development test rmagick

Session store secret generation

Still in the redmine install directory, run:
bundle exec rake generate_secrete_store

Database object creation/migration

Still in the redmine install directory, run:

set RAILS_ENV=production# For french peopleset REDMINE_LANG=fr# Use your own language code otherwisebundle exec rake db:createbundle exec rake db:migratebundle exec rake redmine:load_default_data

Test the installation

Simply run 

rail s

from the install directory. A few seconds later, you should be able to access your redmine at http://localhost:3000

Install redmine as a service

If you already have a Redmine service, delete it first:

sc delete RedmineThin

Optional : Add the following line at the end of your config/environment.rb file if you want to access redmine with a prefix (http://localhost:3000/redmine instead of http://localhost:3000):

Redmine::Utils::relative_url_root = "/redmine"

Finally, run

thin_service install -N RedmineThin -e production -p 3000 --chdir C:\redmine3.2.0 --prefix /redmine

Redmine is now installed as a service. Go in your service configuration panel, and configure it to run automatically on windows start.

Reboot your server.


Cem SOYDING

Author & Editor

Senior software engineer with 12 years of experience in both embedded systems and C# .NET

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.

 
biz.