# Problems with restoring data in OSX install of OEMR

**URL:** <https://community.open-emr.org/t/problems-with-restoring-data-in-osx-install-of-oemr/8324>\
**Category:** Management and Administration\
**Created:** [March 31, 2017, 6:12am UTC](https://community.open-emr.org/t/problems-with-restoring-data-in-osx-install-of-oemr/8324 "2017-03-31T06:12:03Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![sourdoughpablo](https://community.open-emr.org/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sourdoughpablo](https://community.open-emr.org/u/sourdoughpablo)\
**Post date:** [March 31, 2017, 6:12am UTC](https://community.open-emr.org/t/problems-with-restoring-data-in-osx-install-of-oemr/8324/1 "2017-03-31T06:12:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sourdoughpablo](https://community.open-emr.org/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sourdoughpablo](https://community.open-emr.org/u/sourdoughpablo)\
**Post date:** [March 31, 2017, 6:29am UTC](https://community.open-emr.org/t/problems-with-restoring-data-in-osx-install-of-oemr/8324/2 "2017-03-31T06:29:18Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![stephenwaite](https://community.open-emr.org/user_avatar/community.open-emr.org/stephenwaite/32/15754_2.png) [@stephenwaite](https://community.open-emr.org/u/stephenwaite)\
**Post date:** [March 31, 2017, 12:27pm UTC](https://community.open-emr.org/t/problems-with-restoring-data-in-osx-install-of-oemr/8324/3 "2017-03-31T12:27:13Z")

</div>

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](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](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](https://www.apachefriends.org/faq_osx.html)

---

<div class="post-metadata">

**Author:** ![sourdoughpablo](https://community.open-emr.org/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sourdoughpablo](https://community.open-emr.org/u/sourdoughpablo)\
**Post date:** [March 31, 2017, 3:23pm UTC](https://community.open-emr.org/t/problems-with-restoring-data-in-osx-install-of-oemr/8324/4 "2017-03-31T15:23:35Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![stephenwaite](https://community.open-emr.org/user_avatar/community.open-emr.org/stephenwaite/32/15754_2.png) [@stephenwaite](https://community.open-emr.org/u/stephenwaite)\
**Post date:** [March 31, 2017, 3:27pm UTC](https://community.open-emr.org/t/problems-with-restoring-data-in-osx-install-of-oemr/8324/5 "2017-03-31T15:27:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![brady.miller](https://community.open-emr.org/user_avatar/community.open-emr.org/brady.miller/32/10178_2.png) [@brady.miller](https://community.open-emr.org/u/brady.miller)\
**Post date:** [March 31, 2017, 4:07pm UTC](https://community.open-emr.org/t/problems-with-restoring-data-in-osx-install-of-oemr/8324/6 "2017-03-31T16:07:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sourdoughpablo](https://community.open-emr.org/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sourdoughpablo](https://community.open-emr.org/u/sourdoughpablo)\
**Post date:** [March 31, 2017, 4:11pm UTC](https://community.open-emr.org/t/problems-with-restoring-data-in-osx-install-of-oemr/8324/7 "2017-03-31T16:11:37Z")

</div>

So once unpackaged, it’s the same code?

---

<div class="post-metadata">

**Author:** ![brady.miller](https://community.open-emr.org/user_avatar/community.open-emr.org/brady.miller/32/10178_2.png) [@brady.miller](https://community.open-emr.org/u/brady.miller)\
**Post date:** [March 31, 2017, 4:14pm UTC](https://community.open-emr.org/t/problems-with-restoring-data-in-osx-install-of-oemr/8324/8 "2017-03-31T16:14:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sourdoughpablo](https://community.open-emr.org/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sourdoughpablo](https://community.open-emr.org/u/sourdoughpablo)\
**Post date:** [March 31, 2017, 7:18pm UTC](https://community.open-emr.org/t/problems-with-restoring-data-in-osx-install-of-oemr/8324/9 "2017-03-31T19:18:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sourdoughpablo](https://community.open-emr.org/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sourdoughpablo](https://community.open-emr.org/u/sourdoughpablo)\
**Post date:** [March 31, 2017, 7:25pm UTC](https://community.open-emr.org/t/problems-with-restoring-data-in-osx-install-of-oemr/8324/10 "2017-03-31T19:25:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![stephenwaite](https://community.open-emr.org/user_avatar/community.open-emr.org/stephenwaite/32/15754_2.png) [@stephenwaite](https://community.open-emr.org/u/stephenwaite)\
**Post date:** [March 31, 2017, 7:29pm UTC](https://community.open-emr.org/t/problems-with-restoring-data-in-osx-install-of-oemr/8324/11 "2017-03-31T19:29:20Z")

</div>

mentioned this above [https://www.apachefriends.org/faq\_osx.html](https://www.apachefriends.org/faq_osx.html), at the bottom of the page 🙂

---

<div class="post-metadata">

**Author:** ![sourdoughpablo](https://community.open-emr.org/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sourdoughpablo](https://community.open-emr.org/u/sourdoughpablo)\
**Post date:** [April 3, 2017, 5:19am UTC](https://community.open-emr.org/t/problems-with-restoring-data-in-osx-install-of-oemr/8324/12 "2017-04-03T05:19:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![stephenwaite](https://community.open-emr.org/user_avatar/community.open-emr.org/stephenwaite/32/15754_2.png) [@stephenwaite](https://community.open-emr.org/u/stephenwaite)\
**Post date:** [April 3, 2017, 5:46pm UTC](https://community.open-emr.org/t/problems-with-restoring-data-in-osx-install-of-oemr/8324/13 "2017-04-03T17:46:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sourdoughpablo](https://community.open-emr.org/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sourdoughpablo](https://community.open-emr.org/u/sourdoughpablo)\
**Post date:** [April 5, 2017, 6:13pm UTC](https://community.open-emr.org/t/problems-with-restoring-data-in-osx-install-of-oemr/8324/14 "2017-04-05T18:13:46Z")

</div>

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$

---

<div class="post-metadata">

**Author:** ![stephenwaite](https://community.open-emr.org/user_avatar/community.open-emr.org/stephenwaite/32/15754_2.png) [@stephenwaite](https://community.open-emr.org/u/stephenwaite)\
**Post date:** [April 5, 2017, 6:36pm UTC](https://community.open-emr.org/t/problems-with-restoring-data-in-osx-install-of-oemr/8324/15 "2017-04-05T18:36:27Z")

</div>

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`

---

<div class="post-metadata">

**Author:** ![sourdoughpablo](https://community.open-emr.org/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sourdoughpablo](https://community.open-emr.org/u/sourdoughpablo)\
**Post date:** [April 5, 2017, 6:44pm UTC](https://community.open-emr.org/t/problems-with-restoring-data-in-osx-install-of-oemr/8324/16 "2017-04-05T18:44:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![stephenwaite](https://community.open-emr.org/user_avatar/community.open-emr.org/stephenwaite/32/15754_2.png) [@stephenwaite](https://community.open-emr.org/u/stephenwaite)\
**Post date:** [April 5, 2017, 7:04pm UTC](https://community.open-emr.org/t/problems-with-restoring-data-in-osx-install-of-oemr/8324/17 "2017-04-05T19:04:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sourdoughpablo](https://community.open-emr.org/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sourdoughpablo](https://community.open-emr.org/u/sourdoughpablo)\
**Post date:** [April 5, 2017, 7:10pm UTC](https://community.open-emr.org/t/problems-with-restoring-data-in-osx-install-of-oemr/8324/18 "2017-04-05T19:10:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sourdoughpablo](https://community.open-emr.org/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sourdoughpablo](https://community.open-emr.org/u/sourdoughpablo)\
**Post date:** [April 6, 2017, 6:36am UTC](https://community.open-emr.org/t/problems-with-restoring-data-in-osx-install-of-oemr/8324/19 "2017-04-06T06:36:49Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![stephenwaite](https://community.open-emr.org/user_avatar/community.open-emr.org/stephenwaite/32/15754_2.png) [@stephenwaite](https://community.open-emr.org/u/stephenwaite)\
**Post date:** [April 6, 2017, 2:03pm UTC](https://community.open-emr.org/t/problems-with-restoring-data-in-osx-install-of-oemr/8324/20 "2017-04-06T14:03:28Z")

</div>

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

[Next page](https://community.open-emr.org/t/problems-with-restoring-data-in-osx-install-of-oemr/8324.md?page=2)
