Problems with restoring data in OSX install of OEMR

My setup: A new installation (not an upgrade from 4.2.2) of XAMPP 5.6.30-0 for OSX, with openemr-5.0.0 windows package, running on a 2015 Mac mini under a fresh installation of OSX 10.11.6.

My office manager spent a good deal of time today entering new patients into the database. She had 20 or more patients entered by the end of the day (she left around 5 PM), and I could see these patients from my login to the server this evening.

around 9:20 I deleted the fee sheet from Lists in an effort to rebuild it. But starting a new sheet after that didn’t re-create the format. I wasn’t sure what to do, so I decided to replace the entire XAMPP folder from a time machine backup. I have Time Machine backing everything up every hour, alternating between two hard drives.

I replaced the XAMPP package with the 8:08 Time Machine backup. XAMPP relaunches fine. And this replaced the deleted File Sheet in the Lists view of Admin.

But then when I went to look at my patients list, no-one was there but a patient that I’d entered 3 days ago. It is as if I reinstalled a three day old system from a backup that ran an hour ago.

So I’m wondering, where are the sql tables actually stored on an OSX setup. Did I fail to restore some tables because they aren’t in the XAMPP folder? Admin/Miscellaneous says that the mysql files are in C:/xampp/mysql/bin and the perl binaries are in C:/xampp/perl/bin. But this is a legacy statement from the Windows build, since there is no C:/ drive on a mac. The XAMPP folder is in Macintosh Drive/Applications/XAMPP. But the only folder in XAMPP is XAMPP/xamppfiles. This xamppfiles folder contains a mysql folder, but there is no perl folder (there is a pear folder), and I have no idea where any of the tables are. Are they in hidden folders? Are they somewhere else than in the XAMPP mother folder group?

I need a bit more documentation on the specifics here. The Time Machine process should be backing up every changed file on the hard drive. But it’s hard to restore files if you don’t know where they are on the system. And it is hard on confidence when your first effort to restore anything on the system causes all the patient data on the system to evaporate! Oy.

I’m also using Carbon Copy Cloner to clone my system, once a day. I note that in this clone, the XAMPP file is greyed out, and cannot be opened. I’ve been leaving XAMPP running 24/7 for the past few days. Does the Apache Webserver lock up XAMPP so that no outside program can copy it while it is running? Do you have to turn XAMPP and the manager-OSX program OFF in order to run a backup using an outside program like Time Machine or Carbon Copy Cloner?

might want to try installing the linux tarball, http://sourceforge.net/projects/openemr/files/OpenEMR%20Current/5.0.0/openemr-5.0.0.tar.gz/download

install instructions, http://open-emr.org/wiki/index.php/OpenEMR_5.0.0_Linux_Installation, move extracted openemr directory under the xampp htdocs folder

at the bottom of this page is a discussion of backup strategies for xampp https://www.apachefriends.org/faq_osx.html

Assuming that I can install the linux build in and OSX XAMPP setup (advice to OSX users was to install the Windows version)—what would be the advantage of installing the Linux version?

os x is more like linux than windows so it would hopefully alleviate any file naming convention issues

To clarify the, builds for tar.gz and zip are the same. One is just packaged as a tarball and the other as a zip.
-brady

So once unpackaged, it’s the same code?

Yep, albeit the “permissions” of the files(ie. the ones that require write access) may be different since I think tarballs hang on to set permissions more than zips do.
-brady

Well, it would be interesting to try it out on a fresh installation, since the permissions are probably what’s causing issues with the External Data Upload (ICD-10). I can certainly produce the tools to unpack a tarball.

My other question remains unanswered. From reading the Backup discussion, I guess my understanding is that the apache webserver locks the files on the XAMPP system, so that software outside the XAMPP system cannot access the files to back them up.

To unlock the files, do I have to turn off the entire XAMPP machine, a two step process: Stop mysql and apache, then turn off xamp by turning off the manager-osx facility?

Or will an external backup work if apache and mysql are turned off, but xampp’s php service is still running?

Is there a way to run scheduled shut-downs of the mysql and apache servers within XMAPP? Is there a way to run scheduled shutdowns of XAMPP? Maybe I need to go to the Bitnami webite to ask these questions?

Because if I can regularly shut down the system, then my CCC clones and Time Machine backups can access the files automatically and do there job. I could do this manually, but automatic backups would be a more reliable solution in a multi-person office, and my office staff does not have direct physical access to the server.

mentioned this above https://www.apachefriends.org/faq_osx.html, at the bottom of the page :slight_smile:

I tried this out on a fresh install of OSX 10.11.6. It doesn’t work. The .tar package certainly hangs on to more permissions, but that leads to a hang of the install on the first page. With the zip (windows) package, permissions don’t seem to be a problem during installation. The issue only comes up later in some obscure way, during the External Data Upload of ICD-10 codes.

Ok, thanks. To fix the permissions you can run
sudo chown -R www-data: openemr_dir

where openemr_dir is something like /var/www/html/openemr

Hi, Steve. Tried this (OSX 10.11.6 and got this message from terminal:

Last login: Sat Apr 1 10:32:50 on console
Pauls-MacBook-Pro:~ PAUL$ sudo chown -R www-data: /Applications/XAMPP/xamppfiles/htdocs/openemr
Password:
chown: www-data: illegal user name
Paul-Darts-MacBook-Pro:~ PAUL$

hi Paul, www-data is the name of the “user” that owns the web directory on linux systems, not sure with xampp on mac, for a workaround try this
sudo chmod -R 0775 /Applications/XAMPP/xamppfiles/htdocs/openemr

Appears to run without error now. I’m not sure what to check to see how permissions were changed. I’ll try running the install with the Linux package again now.

sudo ls -lrt /Applications/XAMPP/xamppfiles/htdocs/openemr

Opened apache config file in OSX XAMPP. Turns out “user” is “daemon”, group is “daemon”

ran terminal command: sudo chown -R daemon /Applications/XAMPP/xamppfiles/htdocs/openemr

this worked and install is now proceeding cleanly, to the passwords page.

The last few posts on this string really discuss how to install OEMR on an OSX system, and whether an install of the Linux tar.gz package might preserve more permissions and avoid some glitches down the line. Maybe all this should be on a different thread under that subject heading. I don’t know how to make that change.

But here I’ll summarize what I’ve done that worked on my setup on a new OEMR installation (not an upgrade from 4.2.2) of XAMPP 5.6.30-0 for OSX, with openemr-5.0.0 on a mac running OSX 10.11.6 (“El Capitan”), following the instructions at http://www.open-emr.org/wiki/index.php/XAMPP_and_OpenEMR_Installation_in_OS_X

Installing the windows zip package, the installation process runs well (as long as I turn off my browser and 1Password’s “ask whether to save a new password” function, which glitches the installation at the end of the password setup page).

But once up and running, efforts to perform the external data upload of ICD-10 do not work well, producing an error message: “Error: Unable to copy the file.” This error also occurred in the 4.2.2 windows install, but a workaround that solved the problem in 4.2.2 doesn’t seem to work with 5.0.0

The install lists non-existent locations for Temp files in the OEMR globals/miscellaneous settings. But even when I point them to the more logical options of "C:XAMPP/xamppfiles/temp, the error in data upload persists. This problem with ICD-10 upload seems to be the main glitch with the OSX XAMPP install of OEMR.

Receiving the suggestion that since OSX is based on Unix, installing the Linux tarball package might work better, since Linux uses similar permissions and the tar package preserves these permissions.

The effort to install the Linux tar.gz package of 5.0.0 hit some initial permission problems. But I was able to achieve a clean installation process with this package after running the following commands in terminal:

sudo chmod 666 /Applications/XAMPP/xamppfiles/htdocs/openemr/sites/default/sqlconf.php

sudo chmod 666 /Applications/XAMPP/xamppfiles/htdocs/openemr/sites/default/sqlconf.php

sudo chmod 666 /Applications/XAMPP/xamppfiles/htdocs/openemr/interface/modules/zend_modules/config/application.config.php

sudo chown -R daemon /Applications/XAMPP/xamppfiles/htdocs/openemr

Once this was done, I launched the XAMPP Application Manager, and started up both the Apache web server and the MySQL database (if the latter isn’t running, you can start the OEMR install but you’ll get odd errors late in the installation process).

Then when I logged onto localhost/openemr/ the installation process went smoothly.

However, once OpenEMR was up and running, and I’d re-labeled the temp directory as “C:XAMPP/xamppfiles/temp”, I got the same error message in the attempt to upload ICD-10 codes.

I modified the php.ini file to assign the temp file: upload_tmp_dir="/Applications/XAMPP/xamppfiles/temp/" and pointed to this file in the Global/Miscellaneous settings. Still get the error message.

Following Brady Miller’s suggestion, I then ran this terminal command:

sudo chmod -R a+w /Applications/XAMPP/xamppfiles/temp

After restarting the Application manager and the apache and MySQL services and logging onto OEMR again, running the external data upload gives the same error message.

Note that I’ve modified php.ini as advised, with max_execution_time=180, and max_input_time=180, so I don’t think that timing out is the issue with the ICD-10 upload.

To summarize this verbose post regarding installation of OEMR on the Mac OSX platform:

XAMPP for OSX installs smoothly.

The openemr-5.0.0.zip windows package installs in XAMPP for OSX smoothly, if it isn’t interrupted by other programs while in process. But once installed, locations of temp files are listed as for a windows file system, not OSX, pointing to locations that don’t exist, and External Date Upload of ICD-10 doesn’t work.

The openemr-5.0.0.tar.gz package can also be installed in a XAMPP for OSX setup, after running terminal commands to change some permissions issues. But the same temp file locations issues occur, and the same failure in ICD-10 upload occurs.

For Mac users in the USA, this difficulty with ICD-10 upload is a serious problem, of course. It is a critical part of the installation.

====
Some things I don’t know:

I don’t know whether there is any advantage to doing the Linux install, since it made the installation process a bit more complex, and it didn’t solve the ICD-10 problem.

I don’t know if the terminal commands executed during the linux tar.gz install create more of a security problem.

The temp directory /Applications/XAMPP/xamppfiles/temp does exist, it is created during the XAMPP install. And at the end of the installation process it has some files in it.

But I don’t know if the syntax I’ve used to point to it is acceptable to OEMR, or if the location I’ve pointed to is acceptable to OEMR for use in the External Data Upload process.

I don’t know if the 5.0.0 system is actually using a different temp directory for Data Upload than the one that I’ve pointed to in php.ini and in Globals/Miscellaneous with my edits.

I don’t know if the ICD-10 upload problem is due to some sort of permissions issue, that requires a different setting in the actual temp folder than any applied so far.

I don’t have the expertise needed to figure out the answers to any of these questions.

thanks for the update sdp, i’ll get my hands on a mac and trouble shoot the icd10 data load