Project

General

Profile

UpgradeRemineDebianSqueeze6 » History » Revision 3

Revision 2 (Maxim Volkov, 2014-05-13 09:07) → Revision 3/4 (Maxim Volkov, 2014-05-13 09:18)

h1. 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. 


 h2. Preparation 

 1. Dump redmine_default database: 

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

 2. Backup attachments folder: 

 <pre> 
 cp -R /var/lib/redmine/default/files /root/redmine/files 
 </pre> 

 3. Delete redmine: 

 <pre> 
 apt-get remove redmine 
 </pre> 

 During uninstall choose to keep old database. 

 h2. Setup 

 1. Required packages: 

 <pre> 
 apt-get install imagemagick libmagickcore-dev libmagickwand-dev libmysqlclient-dev 
 </pre> 

 _Without this bundler can't install all Redmine's requrements on Squeeze_ 

 2. Download Redmine: 

 <pre> 
 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 
 </pre> 

 3. Install bundler: 

 <pre> 
 gem install bundler 
 </pre> 

 4. Prepare environment: 

 <pre> 
 export PATH=$PATH:/var/lib/gems/1.8/bin 
 </pre> 

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

 5.Configure: 

 <pre> 
 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 
 </pre> 

 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: 

 <pre> 
 bundle install --without development test postgresql 
 </pre> 

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

 <pre> 
 gem "rake", "0.8.7" 
 </pre> 

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

 8. Reconfigure rake: 

 <pre> 
 bundle update rake 
 </pre> 

 9. Upgrade database and drop caches: 

 <pre> 
 rake generate_secret_token 
 rake db:migrate RAILS_ENV=production 
 rake tmp:cache:clear 
 rake tmp:sessions:clear 
 </pre>  

 10. Bring back the attachments: 

 <pre> 
 cp -R /root/redmine/files/* /usr/share/redmine/files/ 
 </pre> 

 _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: 

 <pre> 
 chown -R www-data /usr/share/redmine 
 </pre> 

 _Without this redmine will crash on /settings page. Some people say it's enough to @chmod -R 777 /usr/share/redmine/tmp@, but it didn't work for me_ page._ 

 12. Restart webserver and enjoy.