Upgrading Your OSCAR Server
Preface
These instructions are a method of transferring production from one Ubuntu to a newer Ubuntu. They have been lightly tested with conversion of OSCAR 19 from Ubuntu 18.04 to Ubuntu 22.04 but are generic.
Document Version History
- v0.1 – Initial instructions for LTS Ubuntu 18.04 conversion – Jan 10, 2023
Documentation Copyright © 2023 by Peter Hutten-Czapski MD with some notes from Adrian Starzynski under the Creative Commons Attribution-Share Alike 3.0 Unported License
Prerequisites
- Time. You can test transfer at anytime at any rate but your final transfer should be done with no time pressure
- A DEB installed OSCAR on an older Ubuntu
Step 1 – Prepare the previous OSCAR
Best to make sure everything is up to date and working
Upgrade to the latest OSCAR 19 DEB and check all functionality. The newest DEB should transform any problematic tables in your database to be accepted by the newer MariaDB that exists in the newer Ubuntu.
Do NOT try to upgrade your old Ubuntu as it will break OSCAR
Step 2 – Prepare a new Server
Create a new OSCAR server with the same DEB based on the latest instructions on this site. The new DEB will prepare the latest Tomcat to specifications that will accept OSCAR and its file structures.
Load the test data and check all functionality. Save the oscar.properties on your new server as new.properties
Transfer over your previous oscar.properties and check all functionality again.
Step 3 – Dump a Copy of the Database
Change to the documents directory and create a backup file. Replace ${DBPWD} with your mysql password:
cd /usr/share/oscar-emr/OscarDocument
sudo mysqldump -opt --dump-date --single-transaction --skip-lock-tables oscar_15 -uroot -p${DBPWD} > OscarBackup.sql
Step 4 – Transfer the documents
A simple rsync from the new to the old will get the existing documents, AND the OscarBackup.sql file:
sudo rsync -aW --exclude 'oscar/oscar_backup.sh' --progress --chown=tomcat:tomcat --rsh='ssh -C -p22' ${REMOTE_USER}@${REMOTE_IP}:/usr/share/oscar-emr/OscarDocument /usr/share/oscar-emr/
Step 5 – Load the Database
Load the schema:
mysql -uroot -p${DBPWD} oscar_15 < /usr/share/oscar-emr/OscarDocument/oscar/OscarBackup.sql
Test that the data is correct and that functionality is intact.
Step 6 – Rinse and Repeat
When you have established a successful transfer, repeat steps 3-5 with your latest data and transfer production to the new server