Personal tools
You are here: Home / OSCAR EMR 12.x / 4.0 Developers / 4.2 Installation 12.x / 4.2.6 Manually Updating Oscar

4.2.6 Manually Updating Oscar

How to manually upgrade Oscar from previous versions of unknown installation to a standardized deb version.


This basic update is adequate for a local update of Oscar 9.06 or newer to Oscar 12_1.  Note that deb installs have a utility to upgrade automatically between versions, you will not need this method more than once.

Document Version History

  • v1.0 – initial public release to– July 20, 2010
  • v1.1 – adapted for Oscar 11 – Aug 27, 2011
  • v1.2 – updated for OLIS – Dec 27, 2011
  • v1.3 – updated for OSCAR 12 – April 15, 2012
  • v1.4 – updated for OSCAR 12_1 – Sept 22, 2012
  • v1.5 – changed order of updates to put OLIS first – Oct 24, 2012
  The document is copyright © 2010-2012 by Peter Hutten-Czapski under the Creative Commons Attribution-Share Alike 3.0 Unported License



  1. Preface
    1. Document Version History
  2. Prerequisites
  3. Updating The Base Package
  4. Updating the MySQL Schema
  5. Trying It Out
  6. Update the Properties File


It is assumed that

  1. You have installed any previous Oscar AND a deb installed Oscar 12_1 on Ubuntu 10.4 using instructions similar to those at
    • In particular as a minimum that means you have both a previous Oscar and Oscar 12_1 running on Tomcat 5.5 or Tomcat 6
    • Your existing Production Oscar has a database called oscar_mcmaster
  2. You have a basic level of Linux knowledge
  3. You can open a Linux terminal
  4. You can use a Linux text editor
  5. You can cut and paste EXACTLY the following instructions

NOTE: Firefox will copy with Control+C while a linux terminal requires Shift+Control+V for paste

Backup your server

Replace ****** with the MySQL password.  If your production database is something other than oscar_mcmaster use that name instead!

cd $HOME
mysqldump --add-drop-table -uroot -p******* oscar_mcmaster > keep_me_safe_from_myself.sql

You should also backup your documents (varies by system).  Both backups should NOT be on the hard-drive but on removed media to reduce the risk of being inadvertently overwritten and should be checked that they are intact and not corrupted.

Take backup shortcuts at your own risk!!

Update OscarDocuments

The OscarDocuments supplied by the Oscar12_1 deb will automatically have updated your documents safely.  If you are deviating from the instructions and something has gone astray simply install the new OscarDocuments and overwrite with your existing documents backup.

Update the MySQL database

Now you need to update your MySQL database with any changes that have taken place between your previous Oscar version and the new.  There are two ways to do this.  One is automatically when you are upgrading Oscar installations that have been done by deb installer.  However if your installation is non standard, or there is an error, you have to do it manually as below.

Pickup the files you need

cd $HOME

Then start by dropping the deb installed oscar_12_1 and creating a blank oscar_12_1 and installing your production data into it.  Replace ****** with the MySQL password

mysql -u root -p******** -e "drop schema oscar_12_1;"
mysql -u root -p******** -e "create schema oscar_12_1;"
mysql -u root -p******** oscar_12_1 < keep_me_safe_from_myself.sql
If you are in Ontario, change to the OLIS directory
cd $HOME/mysql/olis

Now run the OLIS initiation script (you can safely skip this step if you are in BC)

mysql -u root -p******** oscar_12_1 < olisinit.sql 

Change to the CAISI update script directory in Oscar 12 source

cd $HOME/mysql/caisi/updates

Now iteratively adjust your Oscar production database with the scripts dated between the version of your production database and 12_1 (all of them).  

mysql -u root -p******** oscar_12_1 < patch-yyyy-mm-dd.sql 

Repeat command with all the updates scripts that apply. 

Some of the update commands in the SQL may not apply to your setup and your update will error out. If that is the case you should check your set up, and see what is needed to make the conversion and adjust according.  This usually means deleting SQL instructions from the script that are already in place in your version.  When a SQL errors out NO FURTHER PROCESSING occurs so that the SQL lines after the error don't execute. You may then re-run the modified upgrade script and if it runs without error you may continue.

Then change to the update script directory

cd $HOME/mysql/updates

Now iteratively adjust your Oscar production database with the scripts dated between the version of your production database and 12_1 ( Oscar12_1 released August 1st, 2012 so the last one should be update-2012-07-26.sql ).  Replace ****** with the MySQL password

mysql -u root -p******** oscar_12_1 < update-yyyy-mm-dd.sql 

Repeat the second line with all the updates scripts that apply.  If you are in BC or otherwise outside Ontario you are done.

Trying It Out


... and you now can explore the shiny new version of Oscar12_1. 

Just go to  (assuming the previous installation was secured through instructions and provides https at port 8443)


and use your own login credentials this time!


Oscar12 on Ubuntu 12.04LTS

OPTIONAL: Tweak the Properties File

 The deb installed is fairly usable out of the box, but might lack some of your custom settings from your old properties file. Adjust to taste against your existing properties file by hand using your favourite text editor.


At this point you can restart Tomcat for the property file changes to "take" 

sudo /etc/init.d/tomcat6 restart

(for Tomcat 5.5 sudo /etc/init.d/tomcat5.5 restart)

Document Actions