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