Windows Backup And Restore Made Easy
This process of backup is a refinement and simplification of Joe Holzer's method. Knowledge of programming and of Command Prompt is not required.
In reference to the built-in backup utility, once constructed properly, this method is just as simple to use. Comments on OpenEMR Forum stressed that browser-based backups are not reliable. In a recently restored backup after using the native tool, all the scanned documents were missing and the LBV forms had to be re-configured. Recovery with this method does not necessitate the unbundling of the backup file, copying and replacing of the openemr\sites\default folder and the rebuilding of the MySql database.
Unlike the Joe Holzer method the entire XAMPP directory is replicated, not just the four htdocs\openemr folders and the MySql database. Recovery does not require that XAMPP-OpenEMR be downloaded and the files to be copied onto the download.
Two pieces of information are necessary before construction of the tool.
1) The version of Apache must be known. A quick way to find out, go to Control Panel->Systems and Security-> Administrative Tools->Services. In the list of Services, look for the number next to Apache.
1) Open Notepad to create an empty folder.
4) Open Notepad again, copy and paste the following set of commands:
net stop "mysql"
net stop "apache2.4"
cmd /c cd C:\
if exist C:\check.bat xcopy C:\xampp\*.* F:\xampp\ /d /e /c /i /f /h /k /y
net start "apache2.4"
net start "mysql"
5) Change the version of Apache if it is not 2.4 in lines 2 and 5 of the script and the drive letter if it is not F in line 4.
6) It is very important that these next 2 steps are executed exactly as stated to avoid problems. Under the File tab, choose Save As. In the File Name bar, type in C:\users\XXX\desktop\backup.cmd where XXX is the name of the account that you signed into at the Windows Welcome Screen.
7) In the Save As Type bar, click the drop down menu and choose All Files. Save to Desktop. Click Save. If you use the default of Text Documents, you will have only a document of the instructions and not the actual command to execute the backup.
1) Log off OpenEMR.
2) Double click the backup.cmd icon on your Desktop.
3) Command Prompt will appear and start the backup and save it to your device. Flash drives, SD cards and external hard drives have been used successfully as backup media. DVD's have not been tested. To change the drive of the destination device, right click on the backup.cmd icon and choose Edit.
1) Send the XAMPP folder to C-drive.
3) Under Modules Service click the red x changing it to a green check mark to install Apache and then under Actions, click Start to begin the service. Do the same for MySql. You have to "turn on the lights" before getting back to work. Both modules are ready to use when the PID(s) and Port(s) are populated with numbers.
4) If you are interested in verification of the accuracy of the backup using just the copy on the destination device, you may need to use XAMPP Start and XAMPP Stop if XAMPP Control does not work. The copy on the device runs only at 80% speed compared to that installed on C-drive, but it is still a very handy feature if verification is the only objective..
5) Log on by typing in http://localhost/openemer in the URL bar. Now it is back to work we go.
The elegant script and technical advice have been graciously supplied by cverk of the OpenEMR Forum. It would not have been possible for us to construct the tool without the invaluable technical assistance of Kevin Yeh, M.D., of IntegralEMR. Pieter W. Blankevoort, M.D.,(a.k.a. the LBV Guru) was kind enough to take time from his medical practice on a sunny isle to brainstorm.
Good luck and smooth sailing.