UpgradeRemineDebianSqueeze6 » History » Version 2

« Previous - Version 2/4 (diff) - Next » - Current version
Maxim Volkov, 2014-05-13 09:07


Upgrading Redmine 1.0.1 to 2.5.1 on Debian Squeeze (from repo to standalone mode)

Debain Squeeze has Redmine 1.0.1 in it's repositories. If you want to install latest 2.x branch, you need to switch from package to standalone setup. Here is a step-by-step howto guide.

Preparation

1. Dump redmine_default database:

mysqldump -u redmine -p redmine_default > /root/redmine/db.sql

2. Backup attachments folder:

cp -R /var/lib/redmine/default/files /root/redmine/files

3. Delete redmine:

apt-get remove redmine

During uninstall choose to keep old database.

Setup

1. Required packages:

apt-get install imagemagick libmagickcore-dev libmagickwand-dev libmysqlclient-dev

2. Download Redmine:

rm -R /usr/share/redmine
cd /usr/share
wget http://www.redmine.org/releases/redmine-2.5.1.tar.gz
tar -xvf redmine-2.5.1.tar.gz
ln -s /usr/share/redmine-2.5.1 /usr/share/redmine

3. Install bundler:

gem install bundler

4. Prepare environment:

export PATH=$PATH:/var/lib/gems/1.8/bin

Without this you'll get "command not found" for bundle command.

5.Configure:

cp /usr/share/redmine/config/configuration.yml.example /usr/share/redmine/config/configuration.yml
cp /etc/redmine/default/database.yml /usr/share/redmine/config/database.yml

Edit /usr/share/redmine/config/database.yml and change adapter from mysql to mysql2.

Edit /usr/share/redmine/config/configuration.yml and setup the secret_token. Email config is also here now, so you can copy old settings from /etc/redmine/default/email.yml here by hand.

You'll need to add enable_starttls_auto: false to smtp_settings group for this delivery method to work on Squeeze:

6. Install:

bundle install --without development test postgresql

7. Edit /usr/share/redmine/Gemfile, change rake version in it to:

gem "rake", "0.8.7" 

Without this rake will crash on startup. 0.8.7 is the latest compatible version.

8. Reconfigure rake:

bundle update rake

9. Upgrade database and drop caches:

rake generate_secret_token
rake db:migrate RAILS_ENV=production
rake tmp:cache:clear
rake tmp:sessions:clear

10. Bring back the attachments:

cp -R /root/redmine/files/* /usr/share/redmine/files/

There are other ways to do this. For example, you can create a symlink from /usr/share/redmine/files to /var/lib/redmine/default/files and keep using previous location

11. Change directory owner:

chown -R www-data /usr/share/redmine

Without this redmine will crash on /settings page.

12. Restart webserver and enjoy.