Project

General

Profile

Actions

RedmineUpgrade » History » Revision 15

« Previous | Revision 15/84 (diff) | Next »
Eric Davis, 2009-04-02 22:25
Large rewrite of the upgrade instructions to consolidate the steps for the downloaded release and the svn checkout version.


Upgrading

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.

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.

Backing up the files

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

MySQL database

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

SQLite database

SQLite databases are all contained in a single file, so you can back them up by copying the file to another location.

PostgreSQL

The pg_dump command can be used to backup the contents of a PostgreSQL database to a text file.

Step 3 - Perform the upgrade

Now it's time to perform the actual upgrade. This process if different depending on how you downloaded Redmine

Downloaded release (tar.gz or zip file)

1. Uncompress the new program archive in a new directory.

2. Copy your database settings-file config/database.yml into the new config directory.

3. Copy the email settings-file config/email.yml.example to config/email.yml and edit this file to adjust your SMTP settings.

4. Copy the RAILS_ROOT/files directory content into your new installation.

Upgrading from a SVN checkout

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

svn update

2. If you are upgrading the trunk version of Redmine to r2493 or above, you must generate a secret for cookie store. See the note at the bottom about generating a session_store.

Step 4 - 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 db:migrate_plugins RAILS_ENV="production" 

Step 5 - 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. mongrel, thin, passenger)

3. Finally go to "Admin -> Roles & permissions" to check/set permissions for the new features, if any.

Common issues

Generating a session_store.rb

An unique session_store.rb file needs to be generated for Redmine for the new cookie based sessions to work. This is required on the trunk version of Redmine at r2493 or above. Just run the following command and Redmine will create one for you:

rake config/initializers/session_store.rb

Errors about a missing session_store.rb

If you see any errors about a missing session_store.rb file, run the command above to create a new one.

Error about the Rails version

Also remember that the trunk version of Redmine after r2493 uses Rails 2.2.2, so you will need to upgrade your Ruby on Rails gem:

gem install rails -v=2.2.2

As part of the Rails 2.2.2 upgrade, plugin migrations will need to be updated as well

rake db:migrate:upgrade_plugin_migrations RAILS_ENV="production" 

Updated by Eric Davis over 15 years ago · 15 revisions locked