Support #354
Updated by Daniel Curtis over 10 years ago
h2. 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: # /path/to/redmine/*configuration.yml* # /path/to/redmine/*database.yml* h3. 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. <pre> mv /path/to/redmine /path/to/redmine.bak mkdir /path/to/redmine </pre> h3. MySQL database The @mysqldump@ command can be used to backup the contents of your MySQL database to a text file. For example: <pre> /usr/bin/mysqldump -u <username> -p<password> <redmine_database> | gzip > /path/to/db/redmine_`date +%y_%m_%d`.gz </pre> h2. 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. # "Download release":http://www.redmine.org/projects/redmine/wiki/Download (tar.gz or zip file) # Uncompress the new program archive in a new directory. # 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`. # Copy your base configuration settings-file config/configuration.yml into the new config directory. # Copy the files directory content into your new installation (this directory contains all your uploaded files). # 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. # Install the required gems by running: <pre> bundle install --without development test </pre> #* If ImageMagick is not installed on your system, you should skip the installation of the rmagick gem using: <pre> bundle install --without development test rmagick </pre> 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. # Run #Run the following command from your new Redmine root directory: <pre> rake generate_secret_token </pre> This will generate a file (@config/initializers/secret_token.rb@) with a random secret used to secure session data. # 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`. h2. 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: <pre> rake db:migrate RAILS_ENV=production </pre> If you have installed any plugins, you should also run their database migrations: <pre> rake redmine:plugins:migrate RAILS_ENV=production </pre> h2. Clean up # You should clear the cache and the existing sessions: <pre> rake tmp:cache:clear rake tmp:sessions:clear </pre> # Restart the application server (e.g. puma, thin, passenger) # Finally go to "Admin -> Roles & permissions" to check/set permissions for the new features, if any. h2. Resources * http://www.redmine.org/projects/redmine/wiki/RedmineUpgrade