You are here
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
- http://www.turnkeylinux.org/forum/support/20100104/how-upgrade-redmine-0...
- http://www.turnkeylinux.org/forum/support/20100104/how-upgrade-redmine-0...
- http://www.redmine.org/projects/redmine/wiki/RedmineInstall
- http://www.redmine.org/projects/redmine/wiki/RedmineUpgrade
Enjoy!
Thanks! I will try to follow
Thanks! I will try to follow it.
But I think that in the future, TKL Redmine should be updated and add more features. In Redmine there are lots of features that also need work in the distro (as the version control with login.. auto checkout out version folders.. make an easy upgradable plugins and redmine build.. ) may here the community should help to make a good featured distribution.
Redmine will be updated when new appliance released
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.
I followed your steps, but
I followed your steps, but the railsapps folders have question marks at the end of the folder name and the system reports "No such file or directory" Any ideas what I may have done wrong?
-Todd Forsberg
Hi Todd, Can you post the
Hi Todd,
Can you post the output from:
ls -l /var/www/
I have no idea where the question marks came from unless it's some odd character encoding problem if you copied/pasted the steps from the forums.
See image link
http://www.flickr.com/photos/vdfd/7687574536/
-Todd Forsberg
Strange. Can you rename it by
Strange. Can you rename it by running:
mv /var/www/railsapp? /var/www/railsapp
You should then be able to carry on if that works.
Yes, I can rename it.
Yes, I can rename it. I didn't think of trying that before. I think you were correct about the chacter encoding. I did copy/paste from the website. I'm going to retype it and try again.
-Todd Forsberg
Re:
Redmine insatllation Ubuntu 12.10, Nginx, php-fpm, MySQL, thin
It sounds like you have a
It sounds like you have a later version of the Redmine TurnKey release than what I used.
Could you try all the steps within the redmine folder instead?
No problem; glad you got it
No problem; glad you got it working :). I'm sure it wouldn't be too difficult to get it to work on the latest version of TurnKey if you needed any of the new things it has - now's the time before you start using it!
With a couple of people having the MySQL problem recently I wonder if there's been an update to one of the apt packages or something which is causing the new MySQL version to be installed.
Though saying that, my own install hasn't installed the other MySQL version. I've just pulled the latest Redmine version using my update script (see the commands in Upgrading In The Future) and it's still not installed.
Very odd!
I suspect that the new v12 appliance
Uses a package from the repo (rather than upstream). But I'm only guessing....
Still no luck with the script.
I retyped the whole thing. Same results.
But, but just typing each line manually in the "Shell-in-box" console, it worked fine. There are some depricated items in above listing (script), but Ruby provided the new methods to use.
-Todd Forsberg
Hi John, That's odd. I ran
Hi John,
That's odd. I ran the whole upgrade procedure a couple of times on different VMs and never saw that error, maybe it was because I was upgrading from the stock version not 1.3.
The Redmine upgrade docs do list a different command to upgrade the plugins database, this may be worth a try instead:
If you look at the Upgrading In The Future part of my original post that's actually the one I used in there. Try running the upgrade commands from there and see if it works too - I dropped them into a script which I can periodically run to kee it up to date.
Failing that, I would say as long as everything appears to work then just ignore it, it sounds like it's working fine!
Cheers,
Andrew.
Hmm I'm not too sure. Did you
Hmm I'm not too sure. Did you definately run the below command with RAILS_ENV=production at the end?
rake db:migrate_plugins RAILS_ENV=production
Faililng that http://projects.andriylesyuk.com/issues/2056 seems to have a similar problem to you - look through the comments.
Apart from that I'd look to post on the official Redmine support forums - I don't know Ruby personally so wouldn't know where to begin.
Wanting to upgrade TKL Tracks which also runs on Rails
I posted separately on TKL Forums a request for guidance on upgrading the Tracks Appliance which also runs on Rails:
http://www.turnkeylinux.org/forum/support/20120731/upgrading-tracks
It seems the subject is quite similar to this. The new Debian Tracks will not upgrade with a simply TKLBAM-RESTORE so I assume I need to get my Tracks intsall up to 2.1 and then run a TKLBAM-RESTORE to jump into v 12 TKL (this was my method for Magento anyway).
I am completely ohterwise out of my element with RAILS and would love some guidance. These links tell me what to do, but I want to contextualize to a TKL install.
http://getontracks.org/manual/upgrading.html
http://getontracks.org/downloads/comments/tracks-21/
Any guidance someone could offer?
Thank you.
Mine only shows as having
Mine only shows as having mysql 2.8.1 installed so personally I'd try removing one of those versions and see what happens:
gem uninstall mysql --version 2.8.1
(and if that fails try 2.9.0 I guess)
Good luck!
Glad you got it
Glad you got it sorted!
Cheers for posting the solution. There's nothing worse than finding your exact problem from a Google search and someone doesn't tell you how they fixed it.
I'm getting another error
Any ideas what this error is? I can't seem to track it down. Here is the full backtrace.
Looks like you're missing a
Looks like you're missing a config.ru file.
Have a look at https://github.com/37signals/pow/issues/98 which should get you going again.
I was hoping it would be that easy ...
But it wasn't.
Copied the config.ru from /var/www/railsapp/vendor/rails/railties/dispatches/config.ru as listed in your link above.
root@redmine www/redmine-2.2.2# locate config.ru
/usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.14/test/stub/rack/config.ru
/usr/local/lib/ruby/gems/1.8/gems/rack-1.4.4/test/rackup/config.ru
/usr/local/lib/ruby/gems/1.8/gems/rack-test-0.6.2/spec/fixtures/config.ru
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.14/dispatches/config.ru
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.8/dispatches/config.ru
/usr/local/lib/ruby/gems/1.8/gems/railties-3.2.11/guides/code/getting_started/config.ru
/usr/local/lib/ruby/gems/1.8/gems/railties-3.2.11/lib/rails/generators/rails/app/templates/config.ru
/var/www/railsapp/vendor/rails/railties/dispatches/config.ru
/var/www/redmine-2.2.2/config.ru
Contents of the config.ru file looks like the one in the link.
# Rack Dispatcher
# Require your environment file to bootstrap Rails
require File.dirname(__FILE__) + '/config/environment'
# Dispatch the request
run ActionController::Dispatcher.new
Still get the same error message.
The only other thing I've noticed ... when editing the files in vi, seems the EOL is showing as ^M - which from previous experince doesn't usually end well. Might it be worth my time to strip those out?
I'm sure removing ^M wouldn't
I'm sure removing ^M wouldn't hurt it (apparently it's a DOS/Windows leftover).
I wonder, on my install my plugins directory is empty (bar the README file).
What happens if you clear out your plugins directory? Looking at it in a bit more detail it's throwing the exception trying to read from the plugin folder so that should be a good start.
Thank you ...
I've got to learn how to dechiper those error messages better.
That was the issue. Up and running now. Odd part is I knew not to have plugins there, but I guess I never went back to make sure it was 100% cleared.
Glad it's working :). It's
Glad it's working :).
It's not the easiest stacktrace to read to be honest, but then again I don't know Ruby or how it works.
any ideas on how to upgrade from 2.2.3 to 2.5.2?
I tried following the instructions for option 2 here:
http://www.redmine.org/projects/redmine/wiki/RedmineUpgrade
and running
but it doesn't seem to do anything. just says
Bundle update runs and seems to do something, but I'm still on version 2.2.3
Trying 'option 1' in the guide gives me a 500 error page.
Thanks
Is your current Redmine copy
Is your current Redmine copy checked out from SVN? It sounds like it's not.
Option 1 from that guide may be better for you in that case.
not sure. whatever was
not sure. whatever was included in the Turnkey 13.0 version.
I tried option 1 after trying option 2, so maybe that's what broke it.
I've not updated it for a
I've not updated it for a long time but it should still mostly work.
The only caveat is that you can't checkout past revision f0d7c701cd6f0e9e7bcdf021607c0445a158d13f (13102) without gettings lots of errors due to incorrect rails/rake versions (I forget which). These versions weren't available via apt so I gave up :).
Replacing the update command with hg update -r 13102 should work.
https://bitbucket.org/redmine/redmine-all/commits/f0d7c701cd6f0e9e7bcdf0...
If you have to change any of
If you have to change any of the steps it would be worth posting what they were here so others may benefit.
We're still running this VM for all our source without issues though :).
Redmine Upgrade/Update
Hey,
after 2 days of researching and error solving I finally updated the redmine from v1.4.4 to 2.6.0.
It took me a while to figure out what was missing and what needs to be updated in order to make it work.
I will work now on a detailled documentation including ruby/rails update with rvm, installing passenger and mysql2 and also editing files which essential to have a full working redmine. Once I finish the docu I will post it here.
Thanks for this guide though, it helped me out a lot.
With best regards
Dom
dsudo
Great work! :)
Add new comment