Using & Upgrading and all that in Windows

ideaman911 wrote on Monday, April 06, 2009:

Brady;

Thanks for all your efforts and patience.  You will be pleased to know that if you spend enough time banging your head against the wall, eventually the wall will crumble, even though your head will be a mess ;-D

So as a help for anyone who has made the same acquaintance with the wall, a simple start point:  I needed to work in Windows because I don’t know a thing about Linux and the variety of completely new (to me at least) buzzwords like Mandriva, Ubuntu, PHP, Perl, Xampp and whatnot.  But I followed the best advice I could find and then tried to make it a little less incoherent for newbies.  What I learned along the way:

a)  It can be done.  I finally have my real data which started life with OpenEMR ver 2.9.0 in what turned out to be an Xampp from the pleistocene (v1.4) which had MySQL v4.1, working on an XP, now setup with the latest release Xampp (v1.7) which has MySQL v5.1 and so I had to upgrade a ton of stuff.

b)  The instructions to do so are paltry and sometimes wrong.  After trying to get SQL Ledger to work with XP (I never was able), I found that OEMR had incorporated the accounting into a pre-release called 2.9.1dev, which is what we have been using with great success, albeit with Xampp v1.4, which has conflicts with some of the latest OpenEMR coding.  But that meant we have real data which has great value, but was obsolete.  Upgrade was necessary, and with the introduction of 3.0.1 on 3/31/09 I started this.

c)  IN ANY CASE before you do anything else, make backup copies of your real data in multiple places so you are VERY unlikely to damage them all.  You will be needing to upgrade any external GACL (access control for those who do not know) to the internal now included with OpenEMR from ver 3.  That will require using a download from http://bradymd.com/prefixMod.tar.gz which, like the 3.0.1 version of OpenEMR, can be "untarred" or uncompressed using a free utility 7zip which is available on the web.  That will be used to put a "gacl_" prefix automatically on all the GACL folder MySQL files within their original GACL folder.  Then you will copy them over the ones created by OpenEMR 3 when it setup its databases for the internal GACL it now incorporates.

d)  But if your MySQL is an earlier version than 5.1, they and your OpenEMR data files are incompatible with the Xampp 1.7 and OpenEMR 3.0.1 current standard.  Whether you upgrade all within your existing pre-1.7 Xampp then copy to the new setup or copy first then upgrade is your choice.  But the process involves working in the …/mysql/data/openemr/ folder, which contains the tables:
  1)  Adding the gacl_ prefix to current gacl tables
  2)  Copying the gacl tables with the gacl_ prefix to the …/openemr/
  3)  Copying all your earlier openemr tables to the new …/openemr/
  4)  Upgrading all those to the new 5.1 MySQL standard (see below)
  5)  Fixing any tables which do not upgrade correctly

e)  The means to do items 4) and 5) are not well explained and are fairly hidden.  Please note that there is a known problem which can occur, so I will describe it here and its fix:
  1)  The 1.7 Xampp has a bunch of "buttons", of which you want to use ONLY the Start and Stop alongside the Apache and MySQL.
  2)  But if you get a check mark in the Svc at MySQL, you will need to use the XP command prompt window and type "sc delete mysql" and enter following the ">" DOS prompt.
  3) As with the simpler earlier Xampp, you will need to have the Apache and MySQL running on the server to use OpenEMR

f)  The MySQL upgrade is performed in a Command Prompt window as well.  The program files you will need are found at …/mysql/bin/ but they are made to work in Windows. Note that in the Command Prompt window, directory slashes lean left.  Do the following:
  1)  Run mysql-upgrade.exe which will find and try to upgrade all the openemr tables to the new MySQL 5.1 standard.
  2)  Then you have to check that all tables are OK by trying to run OpenEMR.  Most should be fine but the "Log" tables are likely not, which will display on the login screen, although you should still be able to work with OpenEMR after logging in.  To fix those you must type the following command (noting your explicit location might be different)  "myisamchk -r c:\xampp\mysql\data\openemr\log" and enter (replace "log" with whatever table is indicated to have an error when you try to run OpenEMR until all table error messages cease).  You have to stop the MySQL in Xampp before running the myisamchk process, then restart MySQL (closing Xampp is not required).

Once you have done all that the software should now be up to the latest with your real data.  Before you add any more, I strongly advise you to do extensive verification by searches, printing, etc until you are comfortable the data conversion has been a success.

Oh - and immediately make backups of the new format data.  My tests have verified the xcopy backup and copy-paste restore I have described elsewhere will work as well for this (thankfully ;-), although I am still at a loss to understand why PHP file replacements seem to no longer be allowed by a batch process due to “access violations”.  I’m working on that, but the worst case requires manual copy and paste, which works fine.  I use that for my “usability enhancements” like having the encounters which need “release” or have already been billed indicated within the patient Encounters list instead of having to look elsewhere (saves a lot of time) as well as having the Encounter dates displayed directly at the billing function.

Good luck.  OpenEMR really is a great tool, and improving continuously :wink:

Joe Holzer    Idea Man
http://www.holzerent.com

drbowen wrote on Monday, April 06, 2009:

By the way:

I have created a new committee the "MS Windows Committee":

Brady
Joe Holzman
Richard Huffman
Sam Bowen

Sincerely,

Sam Bowen, MD

ideaman911 wrote on Monday, April 06, 2009:

Dr Bowen;

I hope you meant me, and the spelling is different :wink:

Joe Holzer    Idea Man
http://www.holzerent.com

drbowen wrote on Monday, April 06, 2009:

Dear Joe,

I haven’t been getting enough rest recently.  I think my brain merged Holzer and Huffman.

I have created a new committee the "MS Windows Committee":

Brady
Joe Holzer (Idea Man)
Richard Huffman
Sam Bowen

Sam Bowen

anojgoel wrote on Tuesday, April 07, 2009:

hi joe

good to see that windows is getting a new view.

i had loaded openemr both for windows and linux and moved on to linux version but now i am having second thoughts.

i had posted a small howto (incomplete) for upgrading to latest version in linux. would you be interested in sharing your experiance and make a howto for upgrading windows install so that i can update my OpenEMR v2.9.0.3 to the latest version.

http://sourceforge.net/forum/forum.php?thread_id=3171760&forum_id=202505

thanks

ideaman911 wrote on Tuesday, April 07, 2009:

Anoj;

I don’t know that I COULD put it in more detail than my writeup earlier in this thread.  But I can add a critical protection:

Before you start make certain you have made copies of your GACL, OPENEMR and DOCUMENTS directories as I have shown before, and on multiple drives for safety.  One never knows :wink:

Then rename your current Xampp directory.  I’d use Xampp290 or something.

Once you have loaded up the latest Windows miracle by Dr Bowen, which literally requires you to do nothing more than download it and then extract it to C:, you will have a working system with Xampp 1.7 which includes MySQL 5.1, as well as OpenEMR 3.0.1 which has been set to use the Tree View as default instead of the radio Buttons we were familiar with.  (why, I have no idea ?!)  So far I have found two areas which Tree View actually seems to prevent working, so I advise adjusting globals.php back to the radio buttons.  It is simple.  There are a bunch of other “usability” things I had previously done in 2.9 which I also made work in 3.0.1 (you will I think see it actually says 3.0.0.1 still, which you can fix in globals.php at the same time), so I simply made a batch script to overwrite to each setup.  Makes it simple.  I plan to post the whole batch as soon as the dust settles from Dr Bowen’s great job.  I think there will be a whole bunch of Linux people who will be green with envy when they see how simple this is.  (Rod, Jason & Brady, this bud’s for you :wink:

Anyway, at that point you have a working OpenEMR 3.0.1 setup waiting for you to start Xampp, Apache & MySQL.  But here I need to caution you (and anyone else reading this); for your own protection, go to C:\xampp\mysql\bin\ and delete or rename  winmysqladmin.exe  as something else.  Failure to do so will leave you vulnerable to a crash with no evident fix (see my SC DELETE MYSQL notes above).  Once you have done that you should be safe.

Unless your properties has changed somehow, the earlier Xampp-Control.exe icon you probably put on your desktop will launch the same 1.7 version, which has enough buttons to become a Porsche radio ;-)  The ONLY ones you need are still the Start and Stop for Apache and Mysql, and the X to close that window and the Exit button to shut off Xampp when you are not running.  The download offers two alternatives for running, but the MySQL service was the locking culprit, so I have no confidence it is reliable.  But running as services on a server can assure it is not overlooked, because that has to run in order for OpenEMR to work, so the Help Desk may insist ;-)  I have already had one customer forget, and I only HAVE one customer, so read between those lines…

Anyway, copy the earlier GACL folder to the 3.0.1 …mysql/data/ folder, then you can use the Brady prefixer (a php, so run from your browser - I would put it in the htdocs folder for simplicity, then call it with localhost/prefixmod.php from your browser and it will add the gacl_ prefix to all the current gacl files you have.  Then you simply copy all those to the …/mysql/data/openemr/  folder which will overwrite the existing ones, thereby making your prior gacl permissions now correct (that will also remove the admin - pass login if you had done that authorization change as well).

Next step is based on the version of Xampp you were using for 2.9.0, or more importantly the MySQL version contained there.  If it was 5.1 or newer, you should be OK as-is.  If not, when you copy the contents from the old …/data/openemr/  folder to the new one, the system will crash from MySQL mismatch.  If so, use the instructions I posted earlier to first upgrade the MySQL files to 5.1 compatibility, then fix any which are reporting errors per the "myisamchk -r" process.  Note that this must be done in a DOS Command Prompt window and that Xampp must be off at the time.

Once that has been done, and you have copied all your …/documents/ folders (I usually copy the entire folder for simplicity), your old data should be usable in the new version.

As always, make certain before you do anything that you have multiple copies of the old data so you can fix screwups, and immediately after you get it right, make a copy of that new one.  Note that the new one, BTW, no longer needs the separate GACL data folder, so you can delete your old copy from the new …/data/ folder, and only need backup the Openemr and Documents folders.

I hope that helps.  I expect to do my real data this weekend, provided they don’t crucify ME, 'cause there’s no chance of MY rising from any grave ;-D

Joe Holzer    Idea Man
http://www.holzerent.com

bradymiller wrote on Wednesday, April 08, 2009:

Joe,

It’s great to here you’ve rid yourself of the legacy XAMPP blues.

Which areas are tree view not working.  Sounds like some bugs; if so, post them on the tracker here and be as specific as possible (were trying to get the tracker up and working).

-brady