Project

General

Profile

Support #354

Upgrading Redmine

Added by Daniel Curtis over 10 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
-
Start date:
04/02/2014
Due date:
% Done:

100%

Estimated time:
1.00 h
Spent time:

Description

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. It is important to have copies of the following 2 files:
  1. /path/to/redmine/config/configuration.yml
  2. /path/to/redmine/config/database.yml

Backing up 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.

mv /path/to/redmine /path/to/redmine.bak
mkdir /path/to/redmine

MySQL database

The mysqldump command can be used to backup the contents of your MySQL database to a text file. For example:

/usr/bin/mysqldump -u <username> -p<password> <redmine_database> | gzip > /path/to/db/redmine_`date +%y_%m_%d`.gz

Perform the upgrade

Now it's time to perform the actual upgrade. This process is different depending on how you downloaded Redmine. You only need to perform one of the following options.

  1. Download release (tar.gz or zip file)
  2. Uncompress the new program archive in a new directory.
  3. Copy your database settings-file config/database.yml into the new config directory. If you're running Redmine >= 1.4 with mysql and ruby1.9, change the database adapter to `mysql2`.
  4. Copy your base configuration settings-file config/configuration.yml into the new config directory.
  5. Copy the files directory content into your new installation (this directory contains all your uploaded files).
  6. Copy the folders of your custom installed plugins from your vendor/plugins directory (if upgrading from a version prior to 2.0.0) or plugins directory (else, upgrading from a version >= 2.0.0) into new installation plugins directory. Make sure that you copy only plugins that are were not initially bundled with your previous Redmine setup.
  7. Install the required gems by running:
    bundle install --without development test
    
    • If ImageMagick is not installed on your system, you should skip the installation
      of the rmagick gem using:
      bundle install --without development test rmagick
      

      Only the gems that are needed by the adapters you've specified in your database
      configuration file are actually installed (eg. if your config/database.yml
      uses the 'mysql2' adapter, then only the mysql2 gem will be installed). Don't
      forget to re-run `bundle install` when you change config/database.yml for using
      other database adapters.
  8. Run the following command from your new Redmine root directory:
    rake generate_secret_token
    

    This will generate a file (config/initializers/secret_token.rb) with a random secret used to secure session data.
  9. 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.

NOTE: If you need to load some gems that are not required by Redmine core (eg. fcgi),
you can create a file named Gemfile.local at the root of your redmine directory.
It will be loaded automatically when running `bundle install`.

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

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, if any.

Resources

Also available in: Atom PDF