[NEW] Guide: Turnkey Redmine Upgrade

dsudo's picture

INTRODUCTION

This is a short tutorial of the Turnkey Redmine Update. It is probably not a perfect tutorial because it is my first one, so please excuse my errors or my bad grammar.

I'm not native english.

If you have any questions or suggestions, please let me now in the comment section below.

PRECONFIGURATION

First of all we need to make sure we have the newest version of the linux/debian machine to have a secure installation.

TIP: Make sure you reboot the system after each installation or update to make sure that the changes were made successfully.

apt-get update
  • downloads the package lists from the repositories and "updates" them to get information on the newest versions of packages and their dependencies. It will do this for all enabled repositories and PPAs.
apt-get upgrade
  • will fetch new versions of packages existing on the machine if APT knows about these new versions by way of apt-get update

Before I continued with the installation of Ruby and Ruby on Rails I first made a change tot he .bashrc file located in your root folder. I think the RVM (Ruby Version Manager) will have problems if you don’t change the path, so therefore I changed the following line in the .bashrc file:

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  • This is the original line that causes the error message when you install RVM.

Just write "$PATH:" after the equal sign, which will look something like this:

PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

You can also do this after the RVM installation, it will just warn you to do so.

RVM Installation

Ruby Version Manager is a very effective tool to install the latest versions of Ruby and Ruby on Rails and made my life a lot easier.

Follow these steps:

gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3
\curl -sSL https://get.rvm.io | bash -s stable

If your terminal doesn’t recognize the curl, then this means it’s not installed yet, just do gem install curl and run the command above again.

Now we have installed RVM successfully. Time to install the latest versions of Ruby and Ruby on Rails.

\curl -sSL https://get.rvm.io | bash -s stable --ruby
\curl -sSL https://get.rvm.io | bash -s stable –rails

If you want to see the version you have installed use ruby –v or rails –v.

In case you don’t want the latest version, maybe a specific version for ruby or rails, then just run the same command but append the version at the end. E.g.

\curl -sSL https://get.rvm.io | bash -s stable --ruby=1.9.3

To make sure we use this version just type

rvm use <ruby version>
  • E.g. to use v1.9.3:
rvm use 1.9.3
rvm --default use < ruby version>

Now you will use the selected version as default. I would suggest now to reboot the system.

Passenger and mysql2 installation

I am not exactly sure if you need to update passenger and mysql2 for your new Redmine, but in my case it was essential.

What you should also do is go into your public folder where your Redmine is installed.

cd var/www

gem install passenger

passenger-install-apache2-module

During this installation you will receive instructions in the terminal that tells you what to change in apache2 config file (path /etc/apache2/apache2.conf). In addition, you need to edit the given path in the passenger.config which you can find in /etc/apache2/config.d/passenger.config.

To finish the installation reload the apache server.

/etc/init.d/apache2 reload

Now we update the mysql to mysql2:

gem install mysql2

After this you need to open your database.yml in /var/www/redmine/config/database.yml and change every "mysql" to "mysql2".

Reboot the system.

REDMINE INSTALLATION

These steps will upgrade the redmine:

cd /var/www

mv railsapp railsapp-old

hg clone --updaterev 2.6-stable https://bitbucket.org/redmine/redmine-all railsapp

cp railsapp-old/config/configuration.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

chown -R www-data:www-data files log tmp public/plugin_assets

rake generate_secret_token
rake db:migrate RAILS_ENV=production
rake redmine:plugins:migrate RAILS_ENV=production

chmod -R 755 files log/ tmp/ public/plugin_assets

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

Check now if the version has been upgraded with:

/var/www/railsapp/script/about

Reboot the system and that’s it!

RESOURCES

http://www.turnkeylinux.org/forum/general/20120722/guide-how-upgrade-red...

https://www.phusionpassenger.com/documentation/Users%20guide%20Apache.html

http://www.redmine.org/projects/redmine/wiki/RedmineInstall

http://www.redmine.org/projects/redmine/wiki/RedmineUpgrade

Ken Robinson's picture

Just to be clear, what is the version of the TurnKey Redmine App you are upgradeing, and what version of Redmine are you upgrading to? It looks like your target is 2.0-stable. Current TKL version (v13) I think is 2.2.3 that is why I asked. 

Regards,

Ken  
":0)

http://www.github.com/DocCyblade

dsudo's picture

Well I upgraded from version 1.4.4 to 2.6.0 stable but it should work for any version above 2.0 

dsudo

DaddySmash's picture

I have two problems with the upgrade process so far, and they prevent me from continuing past the ruby and rails install.

  1. After I install Ruby and make the new version default, when I reboot, I get version 1.9.3p194, instead of version 2.2.0.  Do I need to do an apt-get remove ruby, and then reinstall ruby with \curl?
  2. I also get an error on ssh login: -bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin: No such file or directory.  I assume this has to do with the .bashrc path that we add $PATH: to.

Problem number two goes away when I subtract the space in the example, "PATH=$PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" to read "PATH=$PATH:/usr/local/..."

But I still have path problems when trying to run rvm use 2.2.0.  I get this error.

"Warning! PATH is not properly set up, '/usr/local/rvm/gems/ruby-2.2.0/bin' is not available,
         usually this is caused by shell initialization files - check them for 'PATH=...' entries,
         it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
         to fix temporarily in this shell session run: 'rvm use ruby-2.2.0'."

Is there an easy way to get around this?  Should this guide be edited to show how to make this work, or am I missing some basic ruby stuff?

Jeremy Davis's picture

I have to rush and I'm not in a position to give a proper answer ATM but it sounds like you have solved your point 2, although it sounds like you might need to make some more adjustments to PATH to get things working properly.

I have just edited the OP to tidy it up a little and I'm not totally convinced of the suggestions that is made re editing the PATH. I suspect that, that is not quite right and instead of adding PATH to itself that you may need to add the Ruby path (like it suggests in the error - perhaps try googling that?)...

When I get a chance I will sit down and run through this to make sure it works on a vanilla TKL Redmine v13.0 instance... In the meantime if you have any succes or even more progress, please post! It will also be a reminder to me to get back to this!

Payman's picture

hwy dont you just update the image to latest version with all the updates.

Jeremy Davis's picture

Whilst on face value it sounds simple; for us we have over 100 images in multiple formats to update and test... Believe you me that's a BIG job! And we are a small team with limited resources and a ton of other (behind the scenes) stuff to take care of.

But if that means that you're volunteering to help out that'd be super awesome! :p

You'll find the TurnKey Redmine appliance build code here and the TKLDev docs here.

I still won't be able to guarantee a release date, but I can guarantee it will be sooner if we get some help! :)

mcon's picture

For the record:

Just cloning tkldev, changing Redmine version (2.5.1 -> 2.6.1) and running "make" produced a .iso that is working for me.

Kudos!

Jeremy Davis's picture

It's good to know that the TKLDev build code for Redmine only needs a slight tweak to update.

Russ's picture

Hi!

I am trying to upgrade Redmine by following this post. I have not used TKL before, we are currently using a Bitnami Redmine VM but I would like to see if TKL is a better solution before we upgrade to the latest Redmine version.

I am following the first post in this thread and I am now struck here:

Passenger and mysql2 installation 

.....................

In addition, you need to edit the given path in the passenger.config which you can find in /etc/apache2/config.d/passenger.config.

This is the contents of /etc/apache2

 

root@redmine /etc/apache2# ls -a
. .. apache2.conf conf conf.d envvars magic mods-available mods-enabled ports.conf sites-available sites-enabled

 As you can see I dont have a config.d directory and I can't seem to find passenger.config anywhere.

I also don't know how to edit the file when I find it.

Thanks !

Gianluca's picture

I searched the turnkey vm with redmine 3.0.1 installed ... but i didn't find it :(

 

So thanks to this post I upgraded the redmine version (2.3 if I am not mistaken) to 3.0.1

following these steps. I hope it will help somebody

 

#http://www.turnkeylinux.org/forum/general/20141219/guide-turnkey-redmine...

#https://rvm.io/rvm/security

#-----------------UPGRADING RUBY and RAILS!---------------

# Install mpapis public key (might need `gpg2` and or `sudo`)
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3


\curl -sSL https://get.rvm.io | bash -s stable
\curl -sSL https://get.rvm.io | bash -s stable --ruby
\curl -sSL https://get.rvm.io | bash -s stable --rails


#-----------------UPGRADING REDMINE!---------------

cd /var/www

mv redmine redmine-old

hg clone --updaterev 3.0.1-stable https://bitbucket.org/redmine/redmine-all redmine

cp redmine-old/config/configuration.yml redmine/config/configuration.yml
cp redmine-old/config/database.yml redmine/config/database.yml
cp -r redmine-old/files/ redmine/files/

chown -R root:www-data /var/www/redmine

cd redmine

gem install bundler
gem install test-unit
bundle install --without development test rmagick

mkdir public/plugin_assets

chown -R www-data:www-data files log tmp public/plugin_assets

rake generate_secret_token
rake db:migrate RAILS_ENV=production
rake redmine:plugins:migrate RAILS_ENV=production

chmod -R 755 files log/ tmp/ public/plugin_assets

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

Jeremy Davis's picture

We will have an updated Redmine appliance within the next month or 2; but thanks for sharing. :)
Nono's picture

It's a great news Jeremy, thank you.

Mahfud's picture

Please see my writing in Bahasa, please use google translate to see in your lang :)

http://alifia.co.id/upgrade-turnkey-redmine-appliance/

balenbalen's picture

that is very difficult....i don't know how to do it

 

Graduated from [url=http://www.soran.edu.iq/] Soran [/url] University with First Class Degree with Honours in Computer Science.

Post new comment