[Ubuntu] How to upgrade redmine?

[Ubuntu] How to upgrade redmine?

[Option 1] Upgrade from 2.3.X to 2.5.X and upgrade Ruby
[Requirements]
o Ubuntu LTS 12.04 64-bit
o Apache 2.2
o MySQL 5
o Ruby 1.9.3p547
o Redmine 2.5.X


Step1: Backup all files just in case
1. Backup files in ./file directory
2. Dump MySQL database:

$ mysqldump -uredmine -pmy_password redmine > /home/USERNAME/redmine_dump_20140611.sql

Step2: Upgrade ruby and bundler

$ source ~/.rvm/scripts/rvm
$ rvm get stable
$ rvm install 1.9.3
$ rvm use 1.9.3
$ rvm rubygems current
$ ruby -v
$ gem -v
$ gem install bundler
$ gem install rails

Step3: Check out source code and copy all configure files
1. Check out source code

$ svn co http://svn.redmine.org/redmine/branches/2.5-stable redmine-2.5
$ cd ~/redmine-2.5

2. Copy your database settings-file config/database.yml into the new config directory.
3. Copy the files directory content into your new installation (this directory contains all your uploaded files).
4. Copy the folders of your custom installed plugins from your vendor/plugins directory or plugins directory into new installation plugins directory. Make sure that you copy only plugins that are were not initially bundled with your previous Redmine setup.
5. Check for any themes that you may have installed in the public/themes directory. You can copy them over but checking for updated version is ideal.

VERY IMPORTANT: do NOT overwrite config/settings.yml with the old one.

Step4: Install redmine2.5.X
1. Install the required gems by running:

$ bundle install --without development test postgresql sqlite

2. Run the following command from your new Redmine root directory:

$ rake generate_secret_token

Step5: Update database
1. Database schema objects creation

$ 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

2 .Database default data set

$ RAILS_ENV=production rake redmine:load_default_data

Step6: Clean up

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

Step7: Test the installation

$ ruby script/about
$ ruby script/rails server webrick -e production

Open the browser: http://0.0.0.0:3000

Step8: Update Apache Passenger

$ gem install passenger --no-rdoc --no-ri
$ passenger-install-apache2-module
$ cd /etc/apache2/mods-available
$ sudo vim passenger.conf

LoadModule passenger_module /home/YOUR_USERNAME/.rvm/gems/ruby-1.9.3-p547/gems/passenger-4.0.44/buildout/apache2/mod_passenger.so 
  <IfModule mod_passenger.c>
    PassengerRoot /home/YOUR_USERNAME/.rvm/gems/ruby-1.9.3-p547/gems/passenger-4.0.4
    PassengerDefaultRuby /home/YOUR_USERNAME/.rvm/gems/ruby-1.9.3-p547/wrappers/ruby
  </IfModule>

$ sudo vi passenger.load

LoadModule passenger_module /home/YOUR_USERNAME/.rvm/gems/ruby-1.9.3-p547/gems/passenger-4.0.44/buildout/apache2/mod_passenger.so 
  <IfModule mod_passenger.c>
    PassengerRoot /home/YOUR_USERNAME/.rvm/gems/ruby-1.9.3-p547/gems/passenger-4.0.4
    PassengerDefaultRuby /home/YOUR_USERNAME/.rvm/gems/ruby-1.9.3-p547/wrappers/ruby
  </IfModule>

$ cd /etc/apache2/mods-enabled
$ sudo ln -s /etc/apache2/mods-available/passenger.conf
$ sudo ln -s /etc/apache2/mods-available/passenger.load
$ sudo vim /etc/apache2/sites-available/default

DocumentRoot /home/YOUR_USERNAME/redmine/public
<Directory /home/YOUR_USERNAME/redmine/public/>

$ sudo service apache2 restart

Before:
redmine1

After:
redmine2

[Option 2]
Step1: Backup all files just in case
1. Backup files in ./file directory
2. Dump MySQL database:

$ mysqldump -uredmine -pmy_password redmine &gt; /home/USERNAME/redmine_dump_20140611.sql

Step2: Perform the upgrade
1. Go to the Redmine root directory and run the following command:

$ svn update

2. Updating gems: run the following command:

$ bundle update

Step 3: Update the database
This step is the one that could change the contents of your database. Go to your new redmine directory, then migrate your database:

$ 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

Step 4: Clean up
1. You should clear the cache and the existing sessions:

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

2. Restart the application server (e.g. puma, thin, passenger)
3. Finally go to “Admin -> Roles & permissions” to check/set permissions for the new features.

Reference: Upgrading an existing installation
http://www.redmine.org/projects/redmine/wiki/RedmineUpgrade

(Visited 38 time, 1 visit today)
Facebooktwittergoogle_plusredditpinterestlinkedinmail
Comments are closed.