A friend of mine let me know about a vulnerability in Redmine today so I decided to upgrade to the latest stable release. Upgrading Redmine is easy but figured I would log the exact steps I took to upgrade from Redmine 0.8.3 to Redmine 0.8.7. The installation of Redmine I upgraded is running off of a MySQL database. Also the upgrade is easier since it was a minor version upgrade and didn’t require upgrading Rails, MySQL, or Ruby. The requirements for each Redmine version are located here in case you aren’t sure if you have the correct versions of Rails, Ruby, and MySQL installed.
Upgrade A Redmine Installation Running Off Of A MySQL Database:
- Backup Redmine Files:First backup all of the Redmine files to make sure that you could always roll back if there are any issues. In this example Redmine is run from /home/web/redmine and you could use the below command to backup the entire directory.
- cp -pR /home/web/redmine /home/web/redmine.bak
- Backup MySQL Database:Now backup the MySQL database that Redmine is using. In this example the database that Redmine uses is called “redmine”.
- mysqldump -u root -p redmine > redmine.sql
- Download Redmine:Download the latest stable Redmine version from RubyForge by clicking here. In this example I am upgrading to Redmine 0.8.7 which has a file name of redmine-0.8.7.tar.gz.
- Extract Redmine Stable: Now with the file in /home/web (using the example above) and logged in as the “web” user issue the below command to extract redmine.
- tar -zxvf redmine-0.8.7.tar.gz
This will create a new directory in /home/web by the name of redmine-0.8.7.
- Update Database Settings:Use the command below to update the database settings on the new release by copying the database.yml file into the new directory.
- cp -pR /home/web/redmine/config/database.yml /home/web/redmine-0.8.7/config/
- Update Email Settings:Copy the email.yml file from the current installation into the new directory.
- cp -pR /home/web/redmine/config/email.yml /home/web/redmine-0.8.7/config/
- Update Files:Copy the files directory from your current Redmine installation into the new stable release directory by using the below command.
- cp -pR /home/web/redmine/files /home/web/redmine-0.8.7/
- Copy Redmine Plugins:Now copy over any Redmine plugins that you have installed. In this example there is the Stuff To Do plugin and the TLS Mailer plugin. These can be moved into the new release by issuing the below commands.
- cp -pR /home/web/redmine/vendor/plugins/action_mailer_optional_tls /home/web/redmine-0.8.7/vendor/plugins
- cp -pR /home/web/redmine/vendor/plugins/stuff_to_do_plugin /home/web/redmine-0.8.7/vendor/plugins
- Move Upgrade Live: Now we will move the current installation out of the way and rename the new folder to the old folders name using the commands below.
- mv /home/web/redmine /home/web/redmine.bak
- mv /home/web/redmine-0.8.7 /home/web/redmine
- Restart Web Server: Now restart your web server.
- Verify & Test:Visit the domain that points to the Redmine project to make sure everything is working properly. I also recommend testing adding tickets, updating tickets, receiving emails from Redmine, and any other items that are important to your Redmine installation.
Thats all you have to do. Redmine is excellent software to use for project management.