Gil's picture

I am running release 2009.10-2 of the redmaine appliance on VmWare ESX, I would like to upgrade to the latest Turnkey 11 release but I'm not certain of the best method.  What is the recomended way to perform the upgrade.  I'm fairly new to these appliances so any advice from the community would be greatly appreciated.

Forum: 
Jeremy Davis's picture

TKLBAM (TKL Backup And Migration) is what you'll want. Have a look at the docs here. You could also have a look at all the posts discussing tklbam by clicking the tklbam forum tag (in the left margin). Any other queries that are not answered or if you need any clarification please post back.

Gil's picture

I've read everything I can find per your instructions and nothing specifically relates to upgrading version X of a TLK appliance to version Y of a TKL appliance.  I've found various articles on upgrading Redmine from one release to another, and I've done that successfully in a test environment but this I feel defeats the purpose of having everything packaged nice and neat in an appliance.  I've installed TKLBAM on my 10-2 instance of Redmine and backed it up to the turnkey hub quite easily but now what do I do to upgrade to 11?  Do I restore a new release on top of an old or vice versa?

I'm lost.

Liraz Siri's picture

You can use TKLBAM to migrate changed files, new packages and databases from one TurnKey system to another. TKLBAM doesn't know anything about the applications running inside your system and it doesn't transform your data in any way. This means you may still need to upgrade database schemas and such to be compatible with the new version, or not. It depends on the application's (e.g., Redmine) requirements.

I recommend instead of trying to understand how everything works theoretically that you just experiment a bit and see how things work in practice, then apply what you've learned to the task at hand. TKLBAM is a tool. It makes backups and migrations much easier but it's still not quite magic and experimenting a bit will help you understand how it works.

Jeremy Davis's picture

But here's what I'd try:

  1. Back up current server (via TKLBAM).
  2. Create a new server (I'd use a VM at this point) using the current TKL Redmin appliance.
  3. Upgrade Redmine in your new (clean) appliance to the current version. Use the upstream tarball and install to /var/www/railsapp (where Redmine is installed to in standard TKL - as stated on the appliance page). Make sure you clearly document your progress as you will need to repeat exactly if it works.
  4. Restore data (using TKLBAM).
  5. Check that the new version wasn't overwritten by the old (it shouldn't be but just to be sure) and test.

I have no idea if it'll work but that's what I'd try first. If all goes well then you can do the process again but for real this time!

Also be great if you can share your documentation and/or findings.

PS The script you linked to is to upgrade from an install in Ubuntu to one in Debian, and after a little reading on their wiki it seems that they are the versions from their respective repos. I'd guess that'd be why it's not working as expected. When installed by the package manager it will be in a different place (/usr/share/redmine/public) than if installed from an upstream tarball (/var/www/railsapp in TKL - hence the newer version than 0.9.3). I won't go into details but it is considered poor form to manually install stuff to places that the package manager handles. I wouldn't expect an officially updated apppliance anytime soon. Although if you succeed in updating it and provide documentation I may upload an updated ISO to the TKL Community SourceForge project.

Gil's picture

I've recently been successfull in upgrading the appliance after weeks of trial and error.  There may be other ways to skin this cat but this is what I found to make the most sense.  If you follow the process below you should be successful.  Make sure you are fmiliar with and have the following tools available, Putty, Filezilla, MySQL Workbench.

1) Create a new VM and install the latest TKL redmine appliance.

2) Take a snapshot/clone or whatever type of full backup you use of your existing production environment

3) Upgrade your production instance using the following instructions.

* The upgrade process can take a while, be patient while the stack is updated (gem, apt-get), I use Putty and Filezilla to perform a majority of the tasks

1. Stop Apache via the Webmin interface

2. Backup the entire instance using TKLBAM

3. perform some required maintenance on the Ruby stack
 
# gem install -v=0.4.2 i18n

# gem install rails -v=2.3.5

# gem install rack -v=1.0.1

# apt-get install librmagick-ruby  (librmagick-ruby needed for the Redmine RMagick - avoiding to install full 126 MB package of imagemagick libs)
 
4. create a backup of your redmine directory, your choice to use command line, I perfer filezilla for file/directory manipulation

# cd /var/www/

# mv railsapp railsappold
 
5. Checkout the latest stable Redmine branch from rubyforge

# cd /var/www/

# svn co http://redmine.rubyforge.org/svn/branches/1.2-stable railsapp
 
6. Copy your config and data files from the OLD directory to the new upgraded version, again I perfer to use filezilla for this task

# cd /var/www/

# cp ./railsappOLD/config/database.yml  ./railsapp/config/database.yml

# cp ./railsappOLD/config/email.yml  ./railsapp/config/email.yml

# cp -r ./railsappOLD/files ./railsapp/files

7. Set the appropiate permissions on updated files
 
# chown -R root:www-data /var/www/railsapp

# cd /var/www/railsapp

# chown -R www-data:www-data files log tmp

8. Some Ruby & co maintenance - migration

# rake generate_session_store

# rake db:migrate RAILS_ENV=production

# chown -R www-data:www-data files log tmp public/plugin_assets

# rake db:migrate:upgrade_plugin_migrations RAILS_ENV=production

# rake db:migrate_plugins RAILS_ENV=production

# chmod -R 755 files log/ tmp/ public/plugin_assets

# rake tmp:cache:clear

# rake tmp:sessions:clear
 
9. Fix the infamous "uninitialized constant PhusionPassenger::Utils::PseudoIO::StringIO" error

Open /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/utils.rb in your favorite editor and on top of the first "required...." line and add the following:  required 'stringio'

I use the built in editor in Filezilla to perform this edit

10. Restart Apache using the webmin interface.

At this point you have an updated redmine (1.2) instance but the rest of the appliance is still on the old version and should be upgraded so follow the next steps carefully.

A.  Run MYSQL workbench and perform a database synchronization between the updated VM and the TKL VM you installed in step 1. this will ensure that new appliance has all the proper MYSQL changes.

B. Export your newly updated  production database to a single dump file.

C. Import the dumpfile file from step B above into the VM created in step 1

D. The VM you created in step 1 should now be an upgraded version of the appliance with the most recent Redmine updates.

E. Edit your VM for the appropriate production IP addressing.

F. Initialize TLKBAM

G. Let it rip

Jeremy Davis's picture

The TKL core devs have just released a maintenance fix of the 11.x part 1 appliances (v11.2) but they do not include updated upstream apps.

Next I suspect they will now focus their attention on the (seriously delayed) part 2 release of v11.x which will (~) double the appliance range. I would hope this will happen within the next few months, hopefully by end of 2011.

Following that they will probably do another maintenance release (of v11.x part 1) which may or may not include updated apps. But because of the testing required I suspect not. I think it's probably more likelly they'll switch focus to getting the v12.x range (based on the upcoming Ubuntu 12.04) out the door a bit quicker than last time (ie soon after the Ubuntu 12.04 release - end of April 2012). The v12.x appliances will definately have updated apps included. I would optimistically guess they may be released by mid 2012!?

Add new comment