4.2.6 Updating Oscar
How to manually upgrade Oscar
Preface
This basic update is adequate for a local update of Oscar 9.12 to Oscar 10.06. Other upgrades such as 9.6 to 9.12 are similar.
Document Version History
- v1.0 – initial public release to new.oscarmanual.org– July 20, 2010
- v1.1 – adjusted backup instructions to cover documents, and to cover older installs on Tomcat 5.5 – July 27, 2010
- v1.2 - added notes for v9.06 upgrade to 10.12 - E.Wertheimer Jan 27,12
|
Contents
|
Prerequisites
It is assumed that
- You have installed Oscar 9.12 on Ubuntu 10.4 using instructions similar to those at oscarmanual.org
- In particular as a minimum that means you have Oscar running on Tomcat 5.5 or Tomcat 6
- You have a source directory
$HOME/src/oscar_source - You have a basic level of Linux knowledge
- You can open a Linux terminal
- You can use a Linux text editor
- 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
Updating the Base Package
Log into your
server using terminal or PuTTY.
Backup your server.Adjust accordingly is to look at your schema and see what of the Oscar and CAISI commands are already in your database and delete those lines from the update sql.
Replace ****** with the MySQL password.
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.
Get new source code from the CVSThe first cvs command below will ask you for a password – please respond by hitting the Enter key, without adding a password (ie a null password).
By specifying a specific date/time on the checkout command, you ensure that you get a specific, dated version that you can track from. The command, run without the datestamp verb -D "2010-08-27 23:59:59" will retrieve a version that works for both BC and ON.
By specifying a particular release, you will get the code from that branch of the code. The command, run without the release flags, will get you the code from the development branch. If the development stream code is what you want, run the command without -r and also without -r RELEASE_10_06.
This tutorial is specific to the commands in the following section.
cd $HOME/src/oscar_source
cvs -d:pserver:anonymous@oscarmcmaster.cvs.sourceforge.net:/cvsroot/oscarmcmaster login
cvs -z3 -r -d:pserver:anonymous@oscarmcmaster.cvs.sourceforge.net:/cvsroot/oscarmcmaster co -r RELEASE_10_06 -D "2010-08-27 23:59:59" oscar_mcmaster
It will take a few minutes for the source code to download. Afterwards, logout and compile OSCAR.
cvs -d:pserver:anonymous@oscarmcmaster.cvs.sourceforge.net:/cvsroot/oscarmcmaster logoutcd $HOME/src/oscar_source/oscar_mcmaster/build ant
You may ignore the warnings from the compiler, however you should expect to receive the message: BUILD SUCCESSFUL.
If you are upgrading from Oscar 9.06 to 10.12, the build may fail. Don't worry. There are additional notes at the end.
Copy ONLY the resulting oscar.war file to the web server as your new program.
sudo cp $HOME/src/oscar_source/oscar_mcmaster/build/tmp/oscar.war $CATALINA_BASE/webapps
Copy the new OscarDocument.war file to the web server taking care not to overwrite the old.
sudo cp $HOME/src/oscar_source/oscar_mcmaster/build/tmp/OscarDocument.war $CATALINA_BASE/webapps/newOscarDocument.war
Allow a moment for the server to unpack the war and then merge the newOscarDocument files into the old
sudo cp -R $CATALINA_BASE/webapps/newOscarDocument/* $CATALINA_BASE/webapps/OscarDocument/
Update the MySQL database
Now you need to update your MySQL
database with any changes that have taken place between your version of 9.12 to the new of 10.06. Replace ****** with the MySQL password
cd $HOME/src/oscar_source/oscar_mcmaster/database/mysqlmysql -u root -p******** oscar_mcmaster < upgrade-9_12-to-10_06.sql
As Oscar is in the process of establishing "gold database" standard for each branch, it's still hard to know what the exact state of a given installation based merely a number. As a result some of the update commands in the update 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 by deleting SQL instructions from the script that are already in place in your version. You may then re-run the modified upgrade script and if it runs without error you are good to go.
Update the Properties File
You will have to update your existing properties file by hand using your favorite text editor against the copy for 10.06 at $HOME/src/oscar_source/oscar_mcmaster/install/oscar*.propertiessudo vi $CATALINA_HOME/oscar.properties
Trying It Out
At this point you can restart Tomcat
sudo /etc/init.d/tomcat6 restart
(for Tomcat 5.5 sudo /etc/init.d/tomcat5.5 restart)
... and you now can explore the shiny new version of Oscar.
Upgrading from 9.06 to 10.12
If the build fails with a message like the following:
[javac] bad class file: /home/username/src/oscar_source/oscar_mcmaster/web/WEB-INF/lib/ocan.jar(org/oscarehr/ocan/ActionDocument.class)
[javac] class file has wrong version 50.0, should be 49.0
[javac] Please remove or make sure it appears in the correct subdirectory of the classpath.
[javac] import org.oscarehr.ocan.ActionDocument;
You may need to upgrade from java 1.5 to java 1.6
java -version
Oscar 9.06 only used $CATALINA_HOME. It did not use $CATALINA_BASE.
You need to edit /etc/profile to add the missing variable.
There is no SQL upgrade script for 9.06 to 10.12 in
cd $HOME/src/oscar_source/oscar_mcmaster/database/mysql
mysql -u root -p******** oscar_mcmaster < upgrade-9_12-to-10_06.sql
You can find each SQL update in the updates folder.

