Redmine upgrade from 1.4 to 2.6.1


I have upgraded Redmine in our office from 1.4 to 2.6.1 recently.

The upgrade was not smooth as there were many plug-ins installed in our old version and many of them were not compatible with new version of Redmine.

First thing I did was to download a Bitnami Redmine VM from Bitnami website. This made my job really as it comes with everything pre-packaged. Then created a new database instead of using the default “redmine” DB and loaded it with the DB dump taken from our old Redmine DB. The upgrade steps are detailed in Redmine website.

Everything went fine till DB migration. In DB migration steps new Redmine version will be creating a new tables which are required and modifies any existing tables, as required. I faced couple of issues at this stage where it was trying to create some tables which was already existing or trying to add columns which was already existing.

Redmine upgrade error 1: Duplicate column/table

– add_column(:issues, :closed_on, :datetime, {:default=>nil})
rake aborted!
StandardError: An error has occurred, all later migrations canceled:

Mysql2::Error: Duplicate column name ‘closed_on’: ALTER TABLE `issues` ADD `closed_on` datetime DEFAULT NULL/opt/bitnami/apps/redmine/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in `query’
/opt/bitnami/apps/redmine/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in `block in execute’
/opt/bitnami/apps/redmine/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log’
/opt/bitnami/apps/redmine/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.21/lib/active_support/notifications/instrumenter.rb:20:in `instrument’

Here you can see it was trying to add a column which was already existing in the old DB. I found out the upgrade script which was doing this and moved it. Grep for the column name or table name its complaining under “migrate” directory.

root@linux: /opt/bitnami/apps/redmine/htdocs/db/migrate# grep issues * | grep closed_on
20130215111127_add_issues_closed_on.rb
root@linux:

root@linux: mv 20130215111127_add_issues_closed_on.rb /home/bitnami/scripts/

Similary there were many scripts which I had to move.

Redmine upgrade error 2: This was with the plug-in upgrade.

root@linux:/opt/bitnami/apps/redmine/htdocs# bundle exec rake db:migrate RAILS_ENV=production
rake aborted!
NameError: undefined local variable or method `config’ for main:Object
/opt/bitnami/apps/redmine/htdocs/plugins/open_id_authentication/init.rb:12:in `<t

I removed those plug-in and installed them later after the upgrade is completed.

To summarize the Redmine upgrade from a very old version to latest version may not be that straight forward but its doable. Most of the issue you would be facing due to plug-ins. In those cases better not to upgrade the plug-ins but install them later after the upgrade. If the plug-in has introduced any new columns/tables you need to take care of saving those date and updating it later. And more importantly try the upgrade on a different server couple of times & note down the steps.

Following three plug-ins are installed after the upgrade and found really useful:

  • Redmine Agile plugin – this gives us Agile scrum board and charts
  • Redmine Issue Templates – we can define templates for bugs, user stories etc. which will be auto-filled whenever we create new issues. Very handy
  • Redmine People plugin – more customization for user profile including profile picture, birth day, links to social network etc.

Also installed Redmine Circle Theme which is also very good and giving a new feeling. I have also installed Redmine A1 theme which is more famous, but there is a rendering issue with drop-downs so we prefer Circle theme.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s