UpgradeRemineDebianSqueeze6 » History » Version 1

Version 1/4 - Next ยป - Current version
Maxim Volkov, 2014-05-13 09:04


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/redmine
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 now is here also, so you can copy old settings from /etc/redmine/default/email.yml.

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

enable_starttls_auto: false

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 clean cache:

rake generate_secret_token
rake db:migrate RAILS_ENV=production

10. Drop caches:

rake tmp:cache:clear
rake tmp:sessions:clear

11. Bring back the attachments:

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

12. Change directory owner:

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

Without this redmine will crash on /settings page.

13. Restart webserver and enjoy.