XCopy backup problem

For users or potential users.
Post Reply
drtmz
Posts: 84
Joined: Thu May 29, 2008 4:27 pm

XCopy backup problem

Post by drtmz » Sun Nov 02, 2008 1:43 am

I previously wrote a bat file using xcopy to backup the data and image folders and sub folders to a removable hard drive using the following line of switches; xcopy *.* e:\Opendentaldata /e /y /i /s

I would take the drive home, stop mysql and use xcopy to restore the files to my home computer, restart msql and check the restore. This worked up until version roughly version 5.0 or about the time OD put in the backup and restore routine.

Now if I do this, the backup is corrupted and virtually useless. But if I go into the folders and manually copy through Windows the files to the external hard drive and go through the same restore routine at home, the backup and restore process is 100% accurate.

Any Ideas? Both the office and home PCs are running XP SP3 and we are now on OD 6.1.

User avatar
jordansparks
Site Admin
Posts: 5739
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: XCopy backup problem

Post by jordansparks » Sun Nov 02, 2008 10:57 am

When you use xcopy or when you copy manually, you have to copy into a blank folder. Do not just copy on top of existing files.
Jordan Sparks, DMD
http://www.opendental.com

drtmz
Posts: 84
Joined: Thu May 29, 2008 4:27 pm

Re: XCopy backup problem

Post by drtmz » Mon Nov 03, 2008 6:34 am

I did use a different folder every day. Here is the complete script.

for /F "tokens=1-4 delims=/ " %%I IN ('Date /t') DO SET mydate=%%J%%K%%L

cd\mysql\data\opendental

xcopy *.* E:\opendental_backup\opendental\%mydate% /s /e /y /i

User avatar
jordansparks
Site Admin
Posts: 5739
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: XCopy backup problem

Post by jordansparks » Mon Nov 03, 2008 11:14 am

No, I mean when you restore.
Jordan Sparks, DMD
http://www.opendental.com

drtmz
Posts: 84
Joined: Thu May 29, 2008 4:27 pm

Re: XCopy backup problem

Post by drtmz » Tue Nov 04, 2008 6:28 am

No. I do restore via xcopy to the same directory every night. Is this the problem?

User avatar
jordansparks
Site Admin
Posts: 5739
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: XCopy backup problem

Post by jordansparks » Wed Nov 05, 2008 3:29 pm

Yes, it's a problem. You need to follow the directions at the bottom of:
http://www.open-dent.com/manual/backups.html
It sounds like you are not stopping the service and you are not restoring to a BLANK directory.
Jordan Sparks, DMD
http://www.opendental.com

Jm1956
Posts: 2
Joined: Thu Oct 04, 2012 4:52 pm

Re: XCopy backup problem

Post by Jm1956 » Sat May 02, 2015 7:52 am

I'm unable to restore xcopy to my home computer. I get a message that says. Unable to stop msql. Any suggestions

Tom Zaccaria
Posts: 353
Joined: Mon Feb 25, 2008 3:09 am

Re: XCopy backup problem

Post by Tom Zaccaria » Sat May 02, 2015 10:42 am

Are you in the right directory?
Right click on the Start button in Windows 7 Pro 64 bit
Search for Cmd.exe
Right click to run as Administrator
Type the following at the command prompt
Net stop mysql
(this will stop the service)

Restore your files from backup and then type
Net Start Mysql
Exit

Should work
drtmz

Jm1956
Posts: 2
Joined: Thu Oct 04, 2012 4:52 pm

Re: XCopy backup problem

Post by Jm1956 » Sat May 02, 2015 12:11 pm

I did that, but when I tried to restore in Open Dental the program would not open since I stopped it. Where do I restore from. Can you give me all the steps

Tom Zaccaria
Posts: 353
Joined: Mon Feb 25, 2008 3:09 am

Re: XCopy backup problem

Post by Tom Zaccaria » Sun May 03, 2015 3:01 am

I restore from a thumb drive. In my case it is recognized as 'E drive'.
I stop the service, minimize that window,
restore,
maximize the stop window and start the service.
Click on OD, run as administrator and that's it

drtmz

User avatar
Arna
Posts: 444
Joined: Tue Jul 09, 2013 3:16 pm

Re: XCopy backup problem

Post by Arna » Mon May 04, 2015 9:50 am

Simply running Open Dental as Administrator (if you are using the built in backup tool) will solve your problem.
Right click on the Open Dental icon and Run as Admin.
Entropy isn't what it used to be...

Arna Meyer

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: XCopy backup problem

Post by Justin Shafer » Wed May 13, 2015 7:02 pm

Check out SyncBack Pro.

I used to use xcopy... robocopy is better.. but even better.. is SyncBack. LOTS of options.

User avatar
Hersheydmd
Posts: 700
Joined: Sun May 03, 2009 9:12 pm

Re: XCopy backup problem

Post by Hersheydmd » Thu May 14, 2015 5:26 pm

From home I remote desktop into my office workstation computer, from which I can also remote into my server.
First I stop MySQL on my home computer and on my office server.
Then I run either of the following .bat files to copy the MySQL\Data\Opentdental folder from Office to Home or from Home to Office.
First it renames the existing folder in the destination by adding the date to the name. e.g. Opendental_2015-05-14
Then it copies the Opendental folder from the source to the destination.

A) @Echo On
ren \\Server\C\mysql\data\opendental opendental_%date:~10,4%-%date:~4,2%-%date:~7,2%
robocopy \\tsclient\C\mysql\data\opendental \\Server\C\mysql\data\opendental /s
pause

B) @Echo On
ren \\tsclient\C\mysql\data\opendental opendental_%date:~10,4%-%date:~4,2%-%date:~7,2%
robocopy \\Server\C\mysql\data\opendental \\tsclient\C\mysql\data\opendental /s
Pause

Then I restart MySQL.

Now for the interesting part I don't understand.
When I look in the destination Data folder, I can see the Opendental folder was renamed correctly to "Opendental_yyyy-mm-dd"
and the source database was copied to the destination.
However, when I open Opendental and look in the Choose Database list the name of the backed up database is: "#mysql50#opendental_yyyy-mm-dd"
I can open it and everything looks fine.
What's going on? What is with "#mysql50#"? Why is the name not simply "Opendental_yyyy-mm-dd" as it is in the ...\Data folder list in Explorer?
Robert M Hersh DMD, FAGD
Univ. of Penn 1982
Brooklyn, NY 11234
https://www.facebook.com/pages/Robert-M ... 1471599429

User avatar
Arna
Posts: 444
Joined: Tue Jul 09, 2013 3:16 pm

Re: XCopy backup problem

Post by Arna » Fri May 15, 2015 8:44 am

"#mysql50#" shows up when there are special characters in the database name. Underscores are fine, so I think it may be your dashes in the date that are causing that. This started to happen after the data directory structure changed between MySQL versions 5.0 and 5.1. Try replacing the dashes with underscores.
Entropy isn't what it used to be...

Arna Meyer

Post Reply