Upgrading from (4.0 Dev) to (4.0 Stable)

curtmunsey wrote on Monday, June 06, 2011:

Guys,
Sorry for the noob question, but I have been searching for the best way to upgrade my live Dev 4.0.0 to the latest stable release.
I have tried running the install package over a clean system then restore my backup and customizatiosn but I end up with a messed up system.
I am running OpenEMR on Ubuntu  and truly appreciate your help here.:slight_smile:

Thanks,
Curt

yehster wrote on Tuesday, June 07, 2011:

The problem you are most likely encountering is that your 4.0 Dev system is missing the database changes between whatever version you grabbed and the 4.0 Release version.
When you restore your 4.0 Dev backup on top of the 4.0 Release system, you are likely losing those changes.
An approach to try, but don’t do this to your “live” system would be as follows.
Start with a duplicate of your 4.0 Dev system.
Copy the 3_2_0_to_4_0_0_upgrade.sql from 4.0 release to the duplicate system
Run that script on the duplicate dev system.
Back up the “upgraded system.”
Then use that backup to restore to a clean 4.0 release system.

curtmunsey wrote on Tuesday, June 07, 2011:

Hi Yehster,
Thanks for your reply . Unfortunately it didn’t work… :frowning:
When I ran the script from phpMyadmin it gave an error out  “#1060 – Duplicate column name ‘patient_id’ “.

Thanks again,
Curt

yehster wrote on Tuesday, June 07, 2011:

You should try executing the upgrade script statement by statement.  Ignore errors, as any errors are likely trying to create columns etc that were created already. 

Alternately you could use mysqldump to retrieve your data and then import that into a clean 4.0 Release DB.