Skip to main content

How to Upgrade Redmine to 2.3


Step 1 - Check requirements

The first step to upgrading Redmine is to check that you meet
the requirements for the version you're about to install.

Ruby Version: ruby -v
Rails Version : rails -v
Rubygems Version : gem -v

* Ruby should be 1.8.7 or higher.
* Rails should be 3.2.13
* Gems should be 1.8 or higher.

If rails are not uptodate, you can install the rails with
version specific, using the below command:

# gem install rails -v=3.2.13 --no-ri --no-rdoc


Step 2 - Backup

It is recommended that you backup your database and file
uploads. Most upgrades are safe but it never hurts to have a
backup just in case.

A. Backup the files.

All file uploads are stored to the files/ directory. You can
copy the contents of this directory to another location to
easily back it up.

B. Backup the database.

mysqldump -u redmine_user -predmine123# redmine | gzip > /var/www/redmine_`date +%y_%m_%d`.gz

Step 3 - Download the 2.3 stable version

# cd /var/www/
# mv railsapp railsapp-old
# svn co http://svn.redmine.org/redmine/branches/2.3-stable railsapp

OR

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


Step 4 - Copy the database settings-file config/database.yml into the new config directory

# cp /var/www/railsapp_old/config/database.yml /usr/share/railsapp/config/

Step 5 - Copy the base configuration settings-file config/configuration.yml into the new config directory.

# cp /var/www/railsapp_old/config/configuration.yml /var/www/railsapp/config/

Step 6 - Copy the files directory content into your new installation (this directory contains all your uploaded files).

# cp -r /var/www/railsapp_old/files/* /var/www/railsapp/files/

Step 7 - Copy the folders of the custom installed plugins from the vendor/plugins directory

# cp -r /var/www/railsapp_old/vendor/plugins/* /var/www/railsapp/plugins/

Step 8 - Run the following commands from your new Redmine root directory:

# chown -R root:www-data /var/www/railsapp
# cd railsapp
# gem install bundler
# gem install test-unit
# bundle install --without development test
# rake generate_secret_token

This will generate a file
(/var/www/railsapp/config/initializers/secret_token.rb) with a random secret used to secure session data.

Step 9 - Migrate the database using the command:

# rake db:migrate RAILS_ENV=production

If you have installed any plugins, you should also run their database migrations:

# rake redmine:plugins:migrate RAILS_ENV=production

# rake db:migrate:upgrade_plugin_migrations RAILS_ENV=production

(Optional) # rake db:migrate_plugins RAILS_ENV=production (Optional)


Step 10 - Clean Up

You should clear the cache and the existing sessions:

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

Step 11 - Restart the application servers(Puma, thin, passenger etc.)

Done.

Step 12 - Check it works.


Check if the Updgarde is finished by running:

# /var/www/railsapp/script/about


This will show like :

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

##################################


Ref :

http://www.redmine.org/projects/redmine/wiki/RedmineUpgrade
http://www.turnkeylinux.org/forum/general/20120722/guide-how-upgrade-redmine-latest-version-203-painlessly

Error & Fixes:
###############

If you get the error :

Could not find gem 'sqlite3 (>= 0) ruby' in the gems available on this machine.

Install the sqlite3 using the command


If you get an error like this:

Could not find gem 'capybara (~> 2.0.0) ruby' in the gems available on this machine.

Give the below command:

# gem install capybara -v '2.0.1'

If you get the error :

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

libxml2 is missing.

Give the below command:

# apt-get install libxslt1-dev

If you get the error :

An error occurred while installing nokogiri (1.5.9), and Bundler cannot continue.

Make sure that `gem install nokogiri -v '1.5.9'` succeeds before bundling.

# gem install nokogiri -v '1.5.9'

If you get the error :

Could not find gem 'rmagick (~> 2.0.0) ruby' in the gems available on this machine

# apt-get install libmagickwand-dev

# apt-get install libsqlite3-dev

If you get the below error while installing the sqlite3-dev

2013-04-24 12:16:31 UTC LOG: could not translate host name "localhost", service "5432" to address: Name or service not known

2013-04-24 12:16:31 UTC WARNING: could not create listen socket for "localhost"

2013-04-24 12:16:31 UTC FATAL: could not create any TCP/IP sockets

Resolution:

Edit the /etc/hosts file and make sure localhost is added at the end of the line starting with 127.0.0.1

After adding execute "apt-get install libsqlite3-dev" again.

# bundle install

This will give the below result :

Your bundle is complete!

Use `bundle show [gemname]` to see where a bundled gem is installed.

Comments

Popular posts from this blog

Password reset too simplistic/systematic issue

Some time when we try to reset the password of our user in linux it will show as simple and systematic as below: BAD PASSWORD: it is too simplistic/systematic no matter how hard password you give it will show the same. Solution: ######### Check if your password is Ok with the below command, jino@ndz~$ echo 'D7y8HK#56r89lj&8*&^%&^%#56rlKJ!789l' | cracklib-check D7y8HK#56r89lj&8*&^%&^%#56rlKJ!789l: it is too simplistic/systematic Now Create a password with the below command : jino@ndz~$ echo $(tr -dc '[:graph:]' 7\xi%!W[y*S}g-H7W~gbEB4cv,9:E:K; You can see that this password will be ok with the cracklib-check. jino@ndz~$ echo '7\xi%!W[y*S}g-H7W~gbEB4cv,9:E:K;' | cracklib-check                 7\xi%!W[y*S}g-H7W~gbEB4cv,9:E:K;: OK Thats all, Thanks.

Setting /etc/hosts entries during the initial deployment of an Application using k8s yaml file

Some times we have to enter specific hosts file entries to the container running inside the POD of a kubernetes deployment during the initial deployment stage itself. If these entries are not in place, the application env variables mentioned in the yaml file , as hostnames , will not resolve to the IP address and the application will not start properly. So to make sure the /etc/hosts file entries are already there after the spin up of the POD you can add the below entries in your yaml file. cat > api-deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: spec:   template:     metadata:     spec:       volumes:       containers:       - image: registryserver.jinojoseph.com:5000/jinojosephimage:v1.13         lifecycle:           postStart:             exec:               command:...

Running K8s cluster service kubelet with Swap Memory Enabled

For enabling swap memory check the below link : https://jinojoseph.blogspot.com/2019/10/enable-swap-memory-using-swapfile-in.html # sudo vi /etc/systemd/system/kubelet.service.d/10-kubeadm.conf Add the KUBELET_EXTRA_ARGS line as below: ---------------------------------------- Environment="KUBELET_EXTRA_ARGS=--fail-swap-on=false" ExecStart= ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS Now kubelet.service changed on disk. Run 'systemctl daemon-reload' to reload units # sudo systemctl daemon-reload # sudo systemctl restart kubelet # sudo systemctl status kubelet That is all cheers :p