New Redmine versions come out every month or so which is great, top software, free and it saves us all from having to suffer silly corporate ideas like using Sharepoint for project management or bug tracking. Wouldn’t it be nice if you had some simple instructions… SSDD.
*Note Next Week(ish) I’ll add a PDF which is specific step by step (clean basically) version that you can use as deployment notes for IT/SysOps etc
So lets get on with it to “upgrade” you’ll need the following
- SVN in your Windows PATH
System Properties > Advanced System Properties > Environmental Variables > PATH
Should contain the path to your SVN bin folder which if you haven’t installed SVN manually will exist within your Bitnami folder; or you could just use TortoiseSVN)
- Your existing Bitnami Redmine Stack ~ Ruby Stack with Redmine Module
- At least Redmine 0.9, If you’ve not upgraded from the .8 branch yet you may as well take the heavyweight route.
- I’ll be assuming your using MySQL as its the default on the stack; postgres or other options will vary in the backing up lines only
- Are at least half concious and not totally intoxicated
Backup your database
- Go to command prompt (Start > Run > CMD [ENTER])
- Change your directory to a suibtable location; in WinVista/7 it opens in your main user directory, so CD Desktop; server 2003 tends to open at the root c: in which case you can create a new directory for your backup (mkdir RedmineBackup [ENTER] then cd RedmineBackup)
- Type: mysqldump -u root -p bitnami_redmine > redmine_backup.sql [ENTER]
- Alternatively Use the MySql WorkBench or (older) Admin Tools to simplify back ups and maintenance
- First job done, assuming everything went ok we should have a nice hot-backup of our redmine database, so if we cock-up were pretty safe.
Upgrading Redmine (APP ONLY)
There is very little within a redmine installation that makes it unique to you; a few config files, the junk people update, a session key and what ever plugins you’ve installed.
- Turn off your bitnami stack using the short-cuts in your start-menu; if you dont have any browse to the folder and you can access the same short-cuts there or go to Start > Run > services.msc when the window opens browse down to ‘Redmine’ and stop the mongrel servers, and Apache
- Browse to your Bitnami folder/apps/ and rename your Redmine app to something else (e.g. redmine-old)
- Choose which repository you want to raid, be it stable or dev http://www.redmine.org/wiki/1/Download
For the sakes of this example I’ll be upgrading to the trunk so I can play with all the new developments, yay.
- I’ll be using the HTTP trunk svn URL; open a command prompt in your c:/bitnami-install-path/apps/ folder and type (or copy paste)
svn co http://redmine.rubyforge.org/svn/trunk redmine
- SVN will do a dance and download all the files to your server, fab. Once thats done go to redmine/config/environment.rb and open it in notepad++ or GVIM or notepad, whatever you prefer and change this line.
RAILS_GEM_VERSION = 'x.x.x' unless defined? RAILS_GEM_VERSION
#RAILS_GEM_VERSION = 'x.x.x' unless defined? RAILS_GEM_VERSION
That little bastard cost me hours.
- Next lets copy some of our stuff back, you can do this in command prompt or by drag’n'drop, I’ll assume you hate typing and simply say, drag (copy) the following files into your new app.
- redmine-old/config/initializers/session_store.rb to redmine/config/initializers
- redmine-old/scripts to redmine/scripts (this folder wont exist in the new app till you copy it)
- redmine-old/conf to redmine/conf
- redmine-old/files to redmine/files (this is all the attachments and user added files, I tend to set this folder to compressible (right click folder, properties, advanced)
- From redmine-old/config/ copy only email.yml and database.yml to redmine/config/
- Then we need to copy our session store from redmine-old/config/initializers/session_store.rb to redmine/config/initializers/
- Caveat: If this file doesnt exist we’ll generate a new one from command prompt as follows
- rake config/initializers/session_store
- And lastly in your new redmine/tmp folder create a new folder called pids (i.e. redmine/tmp/pids)
- Start your mongrel servers and apache backup at this point as were about to kick some raking
- Now hopefully you still have a command prompt open with the current directory at
rake db:migrate RAILS_ENV="production"
Now at this point if you have plugins or themes you’ll want to copy them across from your old install; themes are located in app/redmine-old/public/themes and your plugins are in app/redmine-old/vendor/plugins/ copy what you need over to the same location in your new redmine and then run:
rake db:migrate RAILS_ENV="production" rake db:migrate_plugins RAILS_ENV="production"
- Now before we get all over excited lets clear the cache; (command prompt again)
rake tmp:cache:clear rake tmp:sessions:clear
- Restart Mongrel One, Two (if you have two) then restart Apache
That should be the lot; any questions drop a comment.