Upgrading from v5.0.0 to v5.0.1 - Safest Way

In our Production we are seeing some issues with postings and a few other small issues with our current OpenEMR v5.0.0(6). I am sure these issues have already been fixed in the latest version. We would like to upgrade to the latest stable version 5.0.1.

Since this is our PRODUCTION, we want to be utmost careful.

What’s the safest way to upgrade from v5.0.0(6) to v5.0.1? Below are our current versions:

OpenEMR v5.0.0 (6)
Ubuntu 14.04.5 LTS
PHP 5.5.9-1ubuntu4.23 (cli) (built: Feb 8 2018 21:59:47)
MySQL Server version: 5.6.39 MySQL Community Server (GPL)

We had similar setup in Test environment and we tried to upgrade to v5.0.1 without first upgrading Ubuntu and PHP. Now our Test env. is a mess.

That being said, should we upgrade Ubuntu first, then PHP and finally OpenEMR to v5.0.1?

Any suggestions will be greatly appreciated.

Thanks!

hi @smirzaoe, recommend installing new with ubuntu on your test environment and get 5.0.0(6) running and then practice the openemr upgrade

I had major issues with the last 5.0.0 -> 5.0.1 upgrade I tried (on Ubuntu 16.04 LTS) and had to revert. sql_upgrade failed to update some tables…

ALTER TABLE openemr_postcalendar_categories ADD UNIQUE (`pc_constant_id`)
Query Error
ERROR: query failed: ALTER TABLE openemr_postcalendar_categories ADD UNIQUE (`pc_constant_id`)

Error: Duplicate entry 'closed' for key 'pc_constant_id'
mysql> select pc_catid,pc_constant_id from openemr_postcalendar_categories;
+----------+----------------------------------+
| pc_catid | pc_constant_id                   |
+----------+----------------------------------+
|        1 | no_show                          |
|        2 | in_office                        |
|        3 | out_of_office                    |
|        4 | vacation                         |
|        5 | office_visit                     |
|        6 | holidays                         |
|        7 | closed                           |
|        8 | lunch                            |
|        9 | established_patient              |
|       10 | new_patient                      |
|       11 | reserved                         |
|       12 | nurse's_visit                    |
|       13 | illness_visit                    |
|       14 | routine_follow_up_visit          |
|       15 | hormone_lab_review               |
|       16 | bhrt                             |
|       17 | closed                           |
|       18 | health_and_behavioral_assessment |
|       19 | preventive_care_services         |
|       20 | ophthalmological_services        |
|       21 | group_therapy                    |
+----------+----------------------------------+
21 rows in set (0.00 sec)

mysql> update openemr_postcalendar_categories set pc_constant_id='closed_2' where pc_catid=17;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

Upgrade can finish ... but to what effect?

and Then... 

Query Error
ERROR: query failed: SELECT * FROM layout_options WHERE form_id = 'DEM' AND uor > 0 ORDER BY group_id, seq

Error: Unknown column 'group_id' in 'order clause'
/var/www/openemr/interface/patient_file/summary/demographics_full.php at 63:sqlStatement

Took this from 5_0_0-to-5_0_1_upgrade.sql
 ALTER TABLE layout_options ADD COLUMN group_id VARCHAR(31) NOT NULL default '' AFTER group_name;

But other things were very messed up and we reverted…

How did you revert? Just curious.

Restored the backup I made right before I started.

This is because you have entries in openemr_postcalendar_categories with identical ‘Closed’ pc_catname.(the upgrade copies them to pc_constant_id and creates of unique index of them)
Rec. changing one of the ‘Closed’ pc_catname before the upgrade.

I saw that as as the notes say I fixed it, but there were other issues are ripple effects which I did not have time to sort out. Not to mention the customer had two closed catnames for a reason (which I am not clear on) so I’m not what other things might be effected by that change. In any case, as the post shows, I did that and got more errors …

mysql> update openemr_postcalendar_categories set pc_constant_id='closed_2' where pc_catid=17;

Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0

oh, didn’t note the scrollable message within a message. I’m assuming you did a revert and then a full rettrial on the upgrade after your change. The layouts engine had a big upgrade this version, so custom stuff may need some walking through it appears (luckily, there haven’t been any other reports that I recall of the layout engine causing issue on upgrade). I’d be super interested in hearing about the other things that were messed up since I am guessing they will all be related and help to pinpoint the issue.

I’ll get back to this in 2 weeks (the customer could not be down and I’m going on vacation) I’m going to try it locally. He had very minimal layout customizations, but not zero.