A Third Way For Backup

blankev wrote on Sunday, March 03, 2013:

http://www.techrepublic.com/blog/window-on-windows/simplify-file-management-with-the-xcopy-tool/1930?tag=content;siu-container

is the place to find fsgl info on XCOPY management and far beyond.  (# 17)

cverk wrote on Monday, March 04, 2013:

As I said before, I just adapted the script from the wiki for my windows setup. I think that is the idea of opensource, trying to elaborate on other peoples ideas and then give refinements back to the community for everyones benefit.  The check.bat file is used to make sure the drive you are copying is present, so it will turn back on the server if its not. I think you can also change that to the drive you are copying to if you want to make sure that one is present.  I haven’t had administrator issues,  I think because my log in is the administrator ,and windows 7 just runs xcopy on its own without any fuss. Just double click on the cmd file.  I think maybe you guys are overthinking this thing, because this was meant to help you find the simplest backup solution possible. You basically just sequentially backup the whole directory to whatever other type of hard drive you want to use. There are certainly more complicated routes such as sql dump files or the previous idea I put forward for amazon cloud backup, but they are not so simple to check and make sure your backup is OK.  With the above idea you can just take a copy to another computer on a thumb drive and make sure it works. I just put another command file on my home computer with the drive letters reversed, to copy the files from a thumb drive to my home computer.  This is the one I can play with to try out ideas, and if I crash it I can just erase and start over without messing up my office. So unlike medical experience, which for me is vastly larger than computer experience, you can just reboot and do over.
   Up to now when I wanted to actually work on my office patient files from home, I used windows mesh to log into my server, but microsoft has discontinued that.  I have been reading a bit about 2 possible options, one of which involves a service built into widows pro or higher and the other being something called logmein.  If I get around to getting one of those to work, I will give some feedback. Its nice to have when you take call and want to update what you may have done for someone while you were out of the office.

blankev wrote on Monday, March 04, 2013:

Reading your excellent explanation of the Check.bat file, I come to the following conclusion, if you use C\ drive and D:\ drive put the Check.bat file in destination D:\ drive. Also if you want to make a copy to a USB dive put the Check.bat file also on the F:\USB drive…….

Or is this overkill?

Should be another way to check if the destination drive ia available, but for now a great suggestion.

blankev wrote on Monday, March 04, 2013:

suggestion = solution

blankev wrote on Monday, March 04, 2013:

Is team viewer a good and save replacement for Windows Mesh?

fsgl wrote on Monday, March 04, 2013:

The good Maryknoll Sisters and the very cerebral Jesuit Fathers taught us to think.  It is a bad habit I have never been able to overcome (tongue in cheek).  Of course, I have more questions about check.bat.  Answering a little child’s question about the color of the sky without delving into diffraction, wave lengths and angles is difficult and incomplete.  More research on my own is called for.

The altruism and philanthropic spirit of the open source community are wonderful and refreshing to witness.  Service to the larger community, without extracting oversized financial gain, was inculcated in medical school in the 1970’s.

There is no question that your backup method (refined upon Joe Holzer’s) is simple and elegant.  The obstacle to implementation, I have already stated in prior posts.  I presume that you authored  Windows OpenEMR Backup and Recovery over Amazon Web Services.  Might I suggest you write a detailed, step-by-step Wiki article of your modified backup method?  For us neophytes Joe Holzer’s article has a lot of gaps.  I read Brady Miller’s “the more, the merrier” encouragement in this regard.  I would think that the Wiki audience is larger than that of the Forum.

pfwilliams wrote on Monday, March 04, 2013:

Personally, I will never consider any backup method that requires all users to exit the system, and therefore can only practicably be run once or twice a day, to be “robust”.  We run nonintrusive backups 5 times a day, using the compiled python script mysqldbexport included in the MqSQL Workbench tools, and XCOPY to copy “flat” files such as the /sites folder.  We clone exact copies of our production database to our test database at any time, transparent to users, using the Workbench mysqldbcopy tool.
I’d posted a rough example of a backup batch file in a prior thread, and suggested that the intregration of python (which has a small footprint) and the MySQL Workbench utilities, or possibly the entire Workbench application might be a valid development path for a more functional backup.  Once we had a functional, although unrefined, backup in place, I was directed to concentrate on other areas of development.  I do hope to return to improve upon our implementation of mysqldbexport someday (unless someone else beats me to it).  In the meantime, I will continue to immediately discount any proposed backup method as inferior if it does not incorporate a “live” capability.

fsgl wrote on Monday, March 04, 2013:

Cverk, you will look forward to the day when you are old enough to be on the Senior Active Staff and never to be on call again.  It is such a nice luxury.

LogMeIn Free sounds good because of the price and I understand the transmission is encrypted.  If it does not suit, is
Windows Remote Assistance (each session is encrypted and password protected) of any use to you?  Like Xcopy it is native to the operating system.

fsgl wrote on Monday, March 04, 2013:

TechRepublic demanded its pound of flesh for the “free” Xcopy Tool.  Not satified with a registration on their website with just a username and password; email address, full name, address with state & country, phone number and the particulars of one’s occupation were required.  Beat a quick retreat; back to square one; now it is time to bite the bullet.

blankev wrote on Monday, March 04, 2013:

This is the menu that I made for Backup and restore as a ,BAT file. Also if you use Dropbox as e storage place you can make a copy from the backup to D:\Dropbox folder. It might need some fine tuning. If the F:\Drive is not available Windows will give a signal that this drive is not available. It is only valid for a USB stick registered as F:\drive.
(Make a .bat file of the lines between -----------    and ---------------)
If you make a shortcut on the desktop to this file, you can make this file as RUN by administrator.


@echo off

ECHO …………………………………………
ECHO PRESS 1, 2 OR 3 to select your task, or 4 to EXIT.
ECHO …………………………………………
ECHO.
ECHO 1 - Make BACKUP of All XAMMP OpenEMR files on D:\backupOEMR (incremental)
ECHO 2 - Make BACKUP to USB stick in Dir F:\BackupOEMR
ECHO 3 - XAMPP to DROPBOX (Do this only after 1 is completed)
ECHO 4 - EXIT
echo.

ECHO -------------------------------------------
ECHO Realy want to restore, THIS MIGHT could give rise to lost input.
ECHO -------------------------------------------
ECHO Restore section. PRESS 4 to go back to Windows.

ECHO 6 - Restore complete XAMPP Directory
ECHO .

SET /P M=Type 1, 2, 3, 4 …… FOR RESTORE press   9   then press ENTER:
IF %M%==1 GOTO BACKUP
IF %M%==2 GOTO BU-USB
IF %M%==3 GOTO COPY2DROPBOX
IF %M%==4 GOTO EOF
IF %M%==9 GOTO RESTORE

:BACKUP

net stop “mysql”

net stop “apache2.4”

cmd /c cd C:\

if exist D:\XamppOpenEMR\BackupOEMR\check.bat xcopy C:\xampp\*.* D:\backupOEMR\*.*  /d /e /c /i /f /h /k /y

net start “apache2.4”
net start “mysql”
EXIT

:BU-USB

net stop “mysql”
net stop “apache2.4”

cmd /c cd C:\

if exist D:\XamppOpenEMR\BackupOEMR\check.bat xcopy C:\xampp\*.* F:\backupOEMR\*.* /d /e /c /i /f /h /k /y

net start “apache2.4”
net start “mysql”

exit

:RESTORE

net stop “mysql”
net stop “apache2.4”

cmd /c cd C:\

xcopy D:\backupOEMR\*.* C:\xampp\*.* /d /e /c /i /f /h /k /y

net start “apache2.4”
net start “mysql”
EXIT

:COPY2DROPBOX

cmd /c cd C:\

xcopy D:\backupOEMR\*.* D:\Dropbox\xampp\*.* /d /e /c /i /f /h /k /y
EXIT


If this is acceptable we could give it a place in WIKI. (But I would be happier if a backup and restore of the Internet SERVER could be included, but I could not get Workbench working on my Local or Server to try!)

Next time I hope to include the automatic running of the XAMPP-backup part (the most critical part of Xampp to run at the time you schedule in Windows.

fsgl wrote on Monday, March 04, 2013:

Pimm, why have 2 copies of the same backup? Redundancy?  Why not have 2 different methods of backup just in case one fails to restore properly, i.e., à la Joe Holzer and cverk?

blankev wrote on Tuesday, March 05, 2013:

One backup for the hard-disc crash to D:, one backup for the home computer to USB-stick if needed, and one for the Internet  D:\Dropbox to have a copy when and where you might want it……. Never had that many crashes, but read the advise of the crash consultants and even this is not enough……

cverk wrote on Tuesday, March 05, 2013:

I think the critique from pfwilliams is very valid, I just haven’t been able to figure out how to make it work in windows.  So end of day redundant backup once users were off the system and use of RAID drives, was much better than no backup. I realize that large commercial databases are never shut down to users and are backed up nonstop, but single doctor offices don’t have IT departments. I think that backup is such a basic need for all users that a robust solution incorporated into the program and turned on through administration would be a great addition.
I think the windows system for remote access is called remote desktop connection, but I haven’t had time to figure it out yet.

blankev wrote on Tuesday, March 05, 2013:

http://windows.microsoft.com/en-us/windows-vista/connect-to-another-computer-using-remote-desktop-connection

Is this where the solution can be found? Even better if we could have a stepwise instruction to follow for the less knowledgeable programmer.

blankev wrote on Tuesday, March 05, 2013:

**First FAQ I read: **You can’t use Remote Desktop Connection for computers running XP……. and I have one computer that need Win XP to do the work expected from that computer.

fsgl wrote on Tuesday, March 05, 2013:

Because the medical record is of paramount importance to a practice, most physicians would sub-contract out the conversion to EMR.  They would not choose OpenEMR because it is counter-intuitive to think that open source is better than proprietary.  Most physicians would choose the most popular EMR or one recommended by colleagues.  Large practices with means would never consider doing it themselves.  Thinking about whether a backup method is live or not would be the farthest thing on their minds.  If a physician chooses OpenEMR, (s)he would pay for technical support, so it is the responsibility of the hired gun to worry about the backup.  The quality of a backup method rests upon the fact that it is able to produce a bona fide copy of the original.  Whether or not it can operate concurrently is merely icing on the cake, not the cake itself.  There is no reason, however, why we can’t have more than one favor, cverk’s plain vanilla and pfwilliams’ pistachio mocha fudge.

Pimm, have a look at step-by-step guide to Remote Assistance to see if it is useful. (If the named link turns out wrong, I will post the unnamed link again.)

fsgl wrote on Tuesday, March 05, 2013:

Time for the cavalry to ride to the rescue.

1. Saved empty check.bat to C-drive.
2. created notepad document with cverk script, change M to F drive, because USB drive is F on my laptop.
3. Named it backup.txt and saved in C:, User/Desktop folder
4. Went to Desktop & renamed backup.txt  to backup.cmd

Double clicked the backup.cmd folder and the cverk script opened and nothing else happened.

I know I am missing something because I expected that command prompt to pop up, do its thing and voilà, a nice copy in F-drive.  But it did not happen.

yehster wrote on Tuesday, March 05, 2013:

My suggestion is that you launch the command prompt and type backup.cmd<ENTER>
You’ll be able to see any error messages that way.

One issues that commonly arises when running scripts by double-clicking in the GUI is that screen flashes too quickly to see what happened.

fsgl wrote on Tuesday, March 05, 2013:

Kevin, thanks for the Grease Monkey script for Allscripts.  The dreaded command prompt was launched, backup.cmd typed in and enter button hit.

Error message: ‘backup.cmd’ is not recognized as an internal or external command, operable program or batch file.

I was amazed it was in American English.  I goofed in the construction of the second notepad document.  Thoughts on where that occurred, please.

yehster wrote on Tuesday, March 05, 2013:

You most likely need to cd (change directory) into your “c:\users&lt;username>\desktkop”  folder or whatever folder you saved the script into.
When you first start the command prompt, it likely says “c:\users&lt;username>”
do:
cd desktop
then
dir backup.cmd
hopefully that will confirm that you are in the correct location.
Following that, try
backup.cmd
again and see what happens.