Forum archive
[OLD] Guide: How to Upgrade Redmine to Latest Version (2.0.3+) Painlessly
Please see updated thread here
Intro
Here is a quick guide on upgrading the base TurnKey Redmine install to the latest version of Redmine (2.0.3 at this moment in time). I tried several methods including using the Redmine PPA but in the end couldn't get anything else to work and I don't have the knowledge (/patience) to fix it myself.
99% of this guide is from Adam Wu/babbomaria's posts, I'm just collating them to make it easier for everyone so pass the credit onto them :).
I was going to use the SVN Redmine version but it was giving me svn: REPORT of '/svn/!svn/vcc/default': Could not parse chunk size (http://redmine.rubyforge.org) errors during checkout so switched to Mercurial.
Go Go Go
Whatever you do, take a snapshot of your VM before you do this as I imagine it wouldn't be simple to revert back manually if it went wrong.
Update Rails
TurnKey Redmine ships with rails version 2.3.8, Redmine 2 needs 3.2.6 so update it with:
gem install rails
Test it worked with:
rails -v
Get Redmine
This is pretty much just a copy/paste of [1] mixed with some of the Redmine install notes for the later versions. Some commands will error but just ignore them. If you have rmagick installed remove it from step 11, I don't.
Copy/paste this into a script to make life easy:
- cd /var/www
- mv railsapp railsapp-old
- hg clone --updaterev 2.0-stable https://bitbucket.org/redmine/redmine-all railsapp
- cp railsapp-old/config/email.yml railsapp/config/configuration.yml
- cp railsapp-old/config/database.yml railsapp/config/database.yml
- cp -r railsapp-old/files/ railsapp/files/
- chown -R root:www-data /var/www/railsapp
- cd railsapp
- gem install bundler
- gem install test-unit
- bundle install --without development test rmagick
- mkdir public/plugin_assets
- rake generate_session_store
- rake db:migrate RAILS_ENV=production
- chown -R www-data:www-data files log tmp public/plugin_assets
- rake db:migrate:upgrade_plugin_migrations RAILS_ENV=production
- rake db:migrate_plugins RAILS_ENV=production
- chmod -R 755 files log/ tmp/ public/plugin_assets
- rake tmp:cache:clear
- rake tmp:sessions:clear
Make sure you go to Admin -> Roles & permissions and assign new permissions. Manage related issues was added since the base version at least if not more.
Check it works
Run:
/var/www/railsapp/script/about
Hopefully you'll see something like this:
| Environment | |
Redmine version | 2.0.3.stable |
Ruby version | 1.8.7 (i686-linux) |
Rails version | 3.2.6 |
Environment | production |
Database adapter | MySQL |
| Redmine plugins: | |
no plugin installed |
Upgrading In The Future
By switching to using the Redmine Mercurial repository upgrades in the future should just require the following steps [4]:
- cd /var/www/railsapp
- rake generate_session_store
- hg pull
- hg update
- bundle install --without development test rmagick
- rake db:migrate RAILS_ENV=production
- rake redmine:plugins:migrate RAILS_ENV=production
- rake tmp:cache:clear
- rake tmp:sessions:clear
References
- /forum/support/20100104/how-upgrade-redmine-0...
- /forum/support/20100104/how-upgrade-redmine-0...
- http://www.redmine.org/projects/redmine/wiki/RedmineInstall
- http://www.redmine.org/projects/redmine/wiki/RedmineUpgrade
Enjoy!
But some of your ideas sound interesting Mario. Perhaps flesh your ideas a bit more (with a few more specifics). Maybe lodge a Blueprint or start a new forum thread.