armchair dot tech
Upgrade Redmine | ABOUT | TAGS

August 9, 2012 | TAGS:

Currently, I have Redmine version redmine 1.3.3 installed via the ondrej/redmine PPA. I have been wanting to upgrade to the 2.x series of redmine, but no PPA currently exists for it. Redmine is officially provided by Ubuntu, but the version for Precise is 1.3.2, and Ondřej’s PPA is on 1.4.3. While I usually prefer to have my software installation and updates handled by packages, it looks like to get to the 2.x series, I’ll have to go back to source.

I will be following the official upgrade guide closely, but with a few variations.

My ruby version is 1.8.7 (1.8.7 min), rails 2.3.14 (2.3.6 min) and gem 1.8.15 (1.8 min. Already having the minimum requirements makes this a bit easier.

After performing a mysql backup (hint: database.yml is in /etc/redmine/default), I downloaded redmine to /usr/local/redmine-2.0. I also decided to stop Apache so that Passenger wouldn’t be running the existing redmine instance. If I had other sites running on this server, I would have disabled this virtual host or put up a maintenance page.

I didn’t have any plugins, but if I did they would either be in /usr/share/redmine/vendor/plugins or /usr/share/redmine/lib/plugins. I do intend to install a couple plugins when I get into 2.x though.

I found in step 3 that the rake commands didn’t work. This is probably because I wasn’t working from an existing rails directory. I went to the Redmine Installer page, which gave me the answer. “Since 1.4.0, Redmine uses Bundler to manage gems dependencies. You need to install Bundler first.”.

I ran into an error when bundle was installing json 1.7.4.

According to an page, I need build-essentials, libopenssl-ruby, and ruby1.8-dev installed. The one I was missing was ruby1.8-dev. This is easily fixed with an apt-get install ruby1.8-dev.

I had to install the following other packages for certain gems. The Gemfile includes items for postgresql and sqlite, even if you don’t use it. The install guide lets you know that you can skip these with the –without option. You would just add “pg sqlite rmagick” to the end of your bundle install line (above).

Once we got Bundler installed and all the required gems, we switch back to the Upgrade Guide to update our session store and migrate the database. I had no plugins, so I’m skipping that step.

Let’s start this locally before we mess with passenger or apache (be sure to allow port 3000 via iptables or ufw).

This worked without a hitch for me. Now on to my passenger setup. I already has this configured and installed previously, so all I have to do is change my VirtualHost directory.

I did have to change a few permisssions (all files installed as owned by root)