Upgrade OSCAR 15 to OSCAR 19
Upgrade OSCAR 15 to OSCAR 19
In theory, you can migrate up or down to any DEB in the OSCAR 15-19 series. In practice, there are several set points and transitions that are not reversible.
The first set point is oscar_emr15-88~840.deb which is the last one that supports Java 6. Upgrade your Java to version 8 prior to proceeding. You will still be able to downgrade on Java 8 to earlier DEBs.
The second set point on Java 8 is migration from ANY prior OSCAR 15 to the final one oscar_emr15-97final858.deb
sudo dpkg -i oscar_emr15-97final858.deb
NOTE: There is a bug in the deb that might error if you are moving from a significantly older oscar 15 as the patches are run in the wrong order. Luckily the deb will drop the needed files at /usr/share/oscar-emr. If you receive an error run the patches manually in the following order:
mysql -uroot -p******* oscar_15 < patch1.sql
mysql -uroot -p******* oscar_15 < patch.sql
After those files run correctly you can re run the deb and ensure that it does not error this time.
sudo dpkg -i oscar_emr15-97final858.deb
At this point you can still downgrade to earlier OSCAR 15 so test that OSCAR 15 in its final glory is working and make a fresh backup.
OSCAR 19 did a major reconciliation of divergent measurements to a standard set of over 400 to which you can add. The next script (among other things) adds any that you might be missing. Before you run it you will need to check your measurementTypes table so that the update can add new standard measurements to your system. While you can have several measurements of a given type, eg BP that can be sitting standing and so on, what has to be unique is the combination of measurement ‘type’ and matching ‘measuringInstruction’. eg. Some OSPs added a ‘Smok’ ‘type’ with different descriptions but the same null ‘measuringInstruction’. If you only use one keep it and delete the rest or simply add unique ‘measuringInstruction’ to all. Then you can run the LATEST VERSION of oscar_15_to_oscar_19.sql to update the schema. You can get it from bitbucket at https://bitbucket.org/oscaremr/oscar/src/
mysql -uroot -p******* oscar_15 < oscar_15_to_oscar_19.sql
Now upgrade to the first oscar 19 deb available
sudo dpkg -i oscar_emr19-26~1047.deb
Another backup would be good here. Now you must migrate the data in those tables to the OSCAR 19 formats (see below)
Then you will be free to upgrade or downgrade to your pick of any deb in the 19 series.
Data Migration OSCAR 15-19
If you are upgrading from OSCAR 15 remember to run the data migration tools in Administration to finish your setup. Everyone has to run the migrations to Roster Data.
Administration > Updates and Migrations
Only those with pre-existing HRM data need to run the HRM utility. ONAR migration is a tool for migration from OSCAR 12, you do not need to run. The DEB will migrate you to the new Contacts interface (the old one is deprecated), do not run the migration utility after a DEB install or you will have duplicate entries! You will need to upgrade the Roster data. Do not rush, for even a medium sized clinic these migrations can take over an hour.
Upgrade Roster Data
This utility will migrate OSCAR 15 rostered physician data to the newer OSCAR 19 format (OntarioMD 5.0 CMS standard). This utility will set the Enrolled To Physician to that of MRP for patients where Roster Status was set to ROSTERED. This is only run once on conversion of an OSCAR 15 system to an OSCAR 19 Allow a coffee break for this to run. When finished “Upgrade Complete” will display
Migrate HRM
This utility will migrate OSCAR 15 HRM data to the newer OSCAR 19 format. This is only run once on conversion of an OSCAR 15 system to an OSCAR 19. Allow at least an hour for this when done the “Changes were successful” message will display
Middle Names
In prior versions, middle names were often inserted into the first name spot in the master demographic record. You can migrate them to the middle names section with the following.
First log into MariaDB and clean the data in case end users have added padding to the first_name
$ sudo mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 65
Server version: 10.1.34-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> UPDATE demographic set first_name=TRIM(first_name);
Now extract the second (and further) name for middleNames
UPDATE `demographic` SET `middleNames` = CASE
WHEN `middleNames`='' OR `middleNames` IS NULL
THEN If(length(`first_name`) - length(replace(`first_name`, ' ', ''))>0,SUBSTRING_INDEX(`first_name`, ' ', -length(`first_name`) + length(replace(`first_name`, ' ', ''))), '')
ELSE `middleNames` END;
Now trim the first_name to just the first
UPDATE demographic SET first_name=If(length(first_name) - length(replace(first_name, ' ', ''))>0,SUBSTRING_INDEX(first_name, ' ', 1) ,first_name);
Documentation copyright [c] 2012-2025 by Peter Hutten-Czapski MD under the Creative Commons Attribution-Share Alike 3.0 Unported License