Some tips and tricks I learned in doing a version upgrade in Windows that may help you 5.01 5o the latest 7

Situation
Client had a Win 7 system with Firefox and open EMR 5.01 and wanted to move to the latest 7.2.

First, in the upgrade section of the install document seems to be incorrect when it states the updates are incremental , this is no longer the case, you can jump from at least 5.01 to 7.02 in one big leap. When I first saw it was incremental I wasted a lot of time trying to match up 5.021 to a version of XMPP. The next step was to go to 6.0 and figure that out and finally to the latest version of 7. As it turns out this is incorrect. You can jump from the old version directly to the new one, and it is a lot faster and easier.

First, before you even start taking the old system down, grant a several users admin privilege’s. There were some “rough edges” post the upgrade and one of them was the primary user was not able to log on. I spent a long time trying to reset the password with MySQk. One of the other people in the office just waked up and logged on and her account worked, and she was an admin, so we used her to unlock the others. So, before you step into this, make sure you have a team of admin users, just in case the primary can not log in.

Next, grab the new pieces. You want the latest XMPP. In our case that was 8.2.12. You will see that it comes in a few flavors. You want the windows installer version. The other version does not fix internal paths and if you install onto another drive or path it will have paths to things referencing C:. That took a bit to figure out. So just make sure you get the version with the Windows installer as that will fix all the internal paths.

Stop the apache and MySQL services with the XMPP control panel and than click on the quit button to kill the control panel.

With file manager, navigate the base of your XMPP directory, and rename it. This by default is c:\XMPP but in our case it was another drive. When you have found it, rename it to something you will remember.

Install the new xampp you previously downloaded by double clicking on it’s installer. It is a click through install but make sure you select the correct drive and path if you did not have it on C:/xampp. They recommend that you do not put it in programs files.

Once the installer is done, use the XMPP control panel to start Apache and MySQL. Verify they both start.

On the same computer start a web browser and in the address bar enter local host. You should see the XMPP default page. This means that Apache is working. Look along the top of the XMPP default screen and in the upper left you should see Applications, FAQs, HOW-TO Guides, PHPInfo, and phpMyAdmin. Click on phpMyAdmin and verify you can get into the wen page. This verifies that MySQL is running.

Now we need to being the openemr database over. Stop the MySQL process via the xampp control panel. The database update works in place. It does not ask for a path to the old and create the new. You have to copy the old over and it updates it in place. To move the old database to the new location, navigate to the old install with file explorer. From the root of your old install you should see a MySQL directory and under that, a data directory. You want to copy the openerm data directory to the new MySQL data directory. Also you in the root of the data directory you will see a couple of files with log in them. You need to copy these to the new MySQL data directory. Note the files with log in them will overwrite existing files. So in the new MySQL directory you should have a copy of the old openerm folder and any files with log in them, just like in the old directory.

Go back to the XMPP control panel and restart MySQL, verify it starts. Note that the phpmyadmin link we tried before may no longer work. Do not worry about it now.

From the XMPP control panel open a shell. From the prompt type in MySQL -u opener -p and press return. It should ask you for a password. Enter the opemr password. If you do not know the opener password it should be in the file:

C:\XMPP\ht docs\opener\sites\default\sqlconf.php

Note that the start of your path may be different but from the root of XMPP on it should be the same.

Enter this password when prompted and you should get a prompt that looks like this:

MySQL -u opener -p

Enter password: ************
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 25
Server versions: 10.4.32-MariaDB mariadb.org binary distribution

Copyright © 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [(none)]>

Now we have verified that the opener account can access the database. This is very good.
Now type in: show databases; and press return as shown below and look at your output:

MariaDB [(none)]> show databases;
±------------------±
| Database |
±------------------±
| information_schema |
| MySQL |
| opener |
| performance_schema |
| phpmyadmin |
| test |
±------------------±
6 rows in set (0.001 sec)

MariaDB [(none)]>

Look at the output and verify that the opener database is there. It is, good.
At the prompt type quit as show below

MariaDB [(none)]> quit
Bye

sdr@SDR-PC c:\XMPP

Now type exit at the prompt to close the shell.

At this point go to the install directions and edit/move the files they tell you to in the update section of the install document.

At the end of that process the have you will navigate to local host:/openerm/sql_upgrade in your web browser. If all goes well it should take you to a page that asks wnat version you are updating from in a drop down menu. Select the version you have now, and hit the go button and it should start the update.

In the top window you can see it executing sql commands and you should see a bar graph that shows what version you are up to and how much more you have to go. Sadly in our case it blew up at 32% of the last upgrade. Note you may need to scroll to the bottom of the page to see that it died with an error.

In the bottom window you see the sql output leading up to the failure. All of the errors are in red. All of them in our case were things not fitting in where they should. You can cheat. Cut all the red errors out and put them in a list, one after the other.

Go back to chatgpt and ask it to generate the sql commands to fis the issues, and paste in the list of stuff. It should tell you some fields should be named text and sone dynamic, and it should generate some sql to run to change things. Open up a shell, just like before, and run the commands. Note the script may use the root sql account, if does and the script has issues, change the user to openerm and try it again. We had to stomp out two bunches of errors before the script ran to completion.

Once the script has ended cleanly, take a deep breath as this is the big moment, open a new web page and navigate to local host/opener and you should get the login screen

Try to log in. Idid a lot of fighting with different things to get this far so there is a good chance we messed up the db or the user account somehow, but if your credentials do not work, try the others that you gave admin powers to. If one gets in they can reset the passwords on the others.

I do believe with these hints and the upgrade section of the install manual you should be able to update from almost anything, and get it right on the first try. Good luck. Oh, and yes, you can hire me to help you if this sounds over your head.