XCopy backup problem
XCopy backup problem
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.
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.
- jordansparks
- Site Admin
- Posts: 5770
- Joined: Sun Jun 17, 2007 3:59 pm
- Location: Salem, Oregon
- Contact:
Re: XCopy backup problem
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
http://www.opendental.com
Re: XCopy backup problem
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
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
- jordansparks
- Site Admin
- Posts: 5770
- Joined: Sun Jun 17, 2007 3:59 pm
- Location: Salem, Oregon
- Contact:
Re: XCopy backup problem
No. I do restore via xcopy to the same directory every night. Is this the problem?
- jordansparks
- Site Admin
- Posts: 5770
- Joined: Sun Jun 17, 2007 3:59 pm
- Location: Salem, Oregon
- Contact:
Re: XCopy backup problem
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.
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
http://www.opendental.com
Re: XCopy backup problem
I'm unable to restore xcopy to my home computer. I get a message that says. Unable to stop msql. Any suggestions
-
- Posts: 361
- Joined: Mon Feb 25, 2008 3:09 am
Re: XCopy backup problem
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
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
Re: XCopy backup problem
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
-
- Posts: 361
- Joined: Mon Feb 25, 2008 3:09 am
Re: XCopy backup problem
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
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
Re: XCopy backup problem
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.
Right click on the Open Dental icon and Run as Admin.
Entropy isn't what it used to be...
Arna Meyer
Arna Meyer
- Justin Shafer
- Posts: 596
- Joined: Sat Jul 28, 2007 7:34 pm
- Location: Fort Worth, TX.
Re: XCopy backup problem
Check out SyncBack Pro.
I used to use xcopy... robocopy is better.. but even better.. is SyncBack. LOTS of options.
I used to use xcopy... robocopy is better.. but even better.. is SyncBack. LOTS of options.
Justin Shafer
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
- Hersheydmd
- Posts: 705
- Joined: Sun May 03, 2009 9:12 pm
Re: XCopy backup problem
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?
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
Univ. of Penn 1982
Brooklyn, NY 11234
https://www.facebook.com/pages/Robert-M ... 1471599429
Re: XCopy backup problem
"#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
Arna Meyer