Problems Running Backups in Mac OSX installation

The wiki page OpenEMR Backup Tools does not list any backup tools for OSX.

My routine in OSX backup is to clone the system to another hard drive once a day with Carbon Copy Cloner, and to run incremental backups to another hard drive every hour with Time Machine.

However, it appears that CCC and Time Machine do not have access to the files in XAMPP while the apache server is up and running. The server must be turned off (manually) in order for these external programs to copy anything in the XAMPP system files.

This became apparent to me when I attempted to restore the entire XAMPP folder from a one hour old Time Machine backup, when the XAMPP Apache server had been up and running for several days, and my data was restored to the state it had been in several days prior, the last time that the server had been turned off. So to use my regular backup system, I have to manually turn off the XAMPP servers and close XAMPP down, and then manually start it up again later. This isn’t a very reliable or convenient routine.

It would be easier for me to check the details of this if I knew where the sql database files were stored in OpenEMR. I haven’t been able to find this out in the on line documentation, and would love someone to tell me. Then I could explore the Time Machine functionality on a more granular level by checking the date of the last backup of the files. And I could restore the database files without having to restore the entire server package.

====
When I attempt to do a backup by the web interface, I receive this response:

“C:/xampp/mysql/bin/mysqldump -u ‘openemr’ -p’myPHPmysqlpassword’ -h’localhost’ --port=‘3306’ --opt --quote-names -r /var/folders/wc/kdx9dc3s4x17gj66kft8yt_h0000gp/T/openemr_web_backup/emr_backup/openemr.sql ‘openemr’” returned 127:

The good news is that the target for this dump is in a subfolder of the (hidden) Macintosh HD/private folder, i.e. in “.private/var/folders/wc/kdx9dc3s4x17gj66kft8yt_h0000gp/T/openemr_web_backup/emr_backup” This location is outside of the XAMPP package, so this folder should be visible to Time Machine and CCC even when the XAMPP servers are running. I could develop a routine of doing a web backup every hour or so, and should then have a recent version of this file in my Time Machine backups on a routine basis.

And I can unhide .private via terminal commands, and open it and drill down to the openemr_web_backup folder, and make an alias of this folder in a convenient place, and conveniently inspect my backup anytime I so desire.

Conceivably it wouldn’t be too hard to automate this routine by programming OpenEMR to run a Web Interface backup on a timer, making this OSX backup routine fairly robust???

The bad news is that I can’t actually confirm this fact because while the backup routine creates the appropriate folders, the message “returned 127:” apparently is an error message of some kind. When I look inside the openemr_web_backup/emr_backup folder, it is empty. The file “openemr.sql” has not been created. The Web interface backup routine has not performed the dump on my setup (OSX 10.11.6, OpenEMR 5_0_0

What next?

pretty sure that xampp would have it’s own mysql directory, might want to check under /Applications
you could try rsync’ing the mysql directory and the codebase to an external drive rsync -avc source destination

I find the folder XAMPP/xamppfiles/var/mysql, which contains within it the locked folders mysql and openemr. I can’t open these files in a finder window, but do get a view of them in the tree view of phpMyAdmin. Is this var/mysql directory the one you are talking about here? Is this directory the location of the database files for openemr?

Will rsync be able to sync the files while the apache server is up and running?

Can the source and destination be on the same hard drive?

hi @sourdoughpablo, yes, yes

hi @sourdoughpablo, yes, yes

Great. I’ll read the rsync man files and give it a try. I think that I’ll try running this on a schedule with the Lingon app, since Apple has “deprecated” cron and is pushing folks towards launchd, and learning how to code that process is probably a bridge too far for me right now. I’ll update this post when I’ve had a chance to test the process out a bit.

One other question: Does anyone have any idea why the web interface backup routine “returned 127” rather than producing a backup?

hi @sourdoughpablo, most likely mysql dump script not wired for mac osx