In the openemr/interface/main/backup.php file at line 58, set the $GLOBALS variable to the path where your mysql binary is. (don’t worry about the perl or temp directory variables).
I noticed that when PHP 5.2.1 or greater is used the code overrides the “temporary_files_dir_win” variable with “sys_get_temp_dir()”. When this happens (in windows) the “sys_get_temp_dir()” returns the trailing backslash. I’m not sure if that matters or not overall but as you can see it is ugly and might raise future questions.
I made the requested changes and i’m still get the following:
“C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqldump -u “openemr001” -p"dlee5400” -opt -quote-names -r C:\WINDOWS\TEMP\openemr_web_backup/emr_backup/openemr.sql “openemr001"” returned -1:
What directory rights and for whom does that “windows/temp” directory need to have?
In XAMPP (uses php>5.2.1) this works fine, so the “double” slash is not really an issue (agree not pretty). Since your using IIS web server, and since permissions have always seemed to be the issue, I’d just make that directory to be as open as possible to get it to work (then can begin to limit the permissions).
There also seems to be some ugliness in your command (ie -p and the password are not space). Have you modified anything else besides the variables at the top of the backup.php file?
The change didn’t do it; although i did cut and paste the command to the command line and it wouldn’t work until i put double quotes around the sub directories that have spaces in them ie:
This asked for a password so i suspect it was moving pass the issue. I tried to get it to take those double quotes literally in PHP but no success. Any thoughts with this tid bit of info?
At commandline try:
<pre><code>“C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqldump” -u “openemr001” -p"dlee5400" -opt -quote-names -r C:\WINDOWS\TEMP\openemr_web_backup/emr_backup/openemr.sql “openemr001”</code></pre>
Note I am putting entire command in quotations and I am leaving no space between -p and the password (this is on purpose). If this indeed works then I’d re-start from the original backup.php and put in your paths at top and only make the one line change that is described above at line 196.
hey,
improved line (some issues with the _ character above) and removed the -r stuff for now:
<pre><code>“C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqldump” -u “openemr001” -p"dlee5400" -opt -quote-names “openemr001”</code></pre>
1) Start with a fresh interface/main/backup.php file:
2) Then replace line 58 with(don’t touch the slashes):
<pre><code>$GLOBALS = “C:/Program Files/MySQL/MySQL Server 5.1/bin”;
</code></pre>
3) Remove browser cookies and login to openemr, and try backup script.
4) If backup script doesn’t work then copy/paste output here in forum, and then replace line 196 with:
<pre><code>$cmd = “”$mysqldumpcmd" -u " . escapeshellarg($sqlconf) .</code></pre>
5) Again, remove browser cookies, re-login to openemr and try the backup.
6) If doesn’t work, then again paste output here in forum.
I sabotaged you on both inserts (note the missing \_ character in mysqlbindir\_win, which should be mysq\l_bin\_dir\_win). friggin forum formatting is killing me here. Here are fixed instructions:
1) Start with a fresh interface/main/backup.php file:
2) Then replace line 58 with(don’t touch the slashes):
<pre><code>$GLOBALS = “C:/Program Files/MySQL/MySQL Server 5.1/bin”;</code></pre>
3) Remove browser cookies and login to openemr, and try backup script.
4) If backup script doesn’t work then copy/paste output here in forum, and then replace line 196 with:
Hello, I think I can help you with your project. I have been very interested in the medical software arena for some time but have been unable to land a job in the medical software field. I’ve seen a lot of stuff on line about Open Source projects but not having been involved in any I’m not sure about the proper way to get involved. I am an experienced .net with some knowledge of php. I think I could be of help, if you don’t mind spending some time to help me get cranked up. Let me know if i can help?
This is a tough one, and odd that no error code is getting reported after the colon. Either related to the spacing and path separators or a IIS webserver issue (also a good possibility both are causing problems). On our side, we should test the spacing issue and path separators in paths in the mysql command and also in the temporary path (and fix if needed). I likely can’t get around to testing this for awhile, Bill, are you available to test/fix this stuff?