I'm writing a script to perform a nightly refresh of a test DB from the Production backup. Everything looks like it's going fine and then I get:
Restore-VESQLDatabase : The specified file already exists on the target server.
I'm using -Force switch which should allow the job to overwrite the file, but it doesn't seem to be working. I've verified that the account running the job has full access to the DB and Log files so they should be able to overwrite them at the file system level. I could write to a different file, but since it is a nightly task, the issue would occur the second time it ran. Any ideas?? His is my Restore-VESQLDatabase line:
Restore-VESQLDatabase -Database $clDatabase -ServerName $destDBsrv -InstanceName $destDBInst -Force
I've verified the variables are all being populated correctly by DB objects and server/instance names... Any Ideas?
Mike
-
- Novice
- Posts: 6
- Liked: never
- Joined: Feb 13, 2018 6:39 pm
- Full Name: Mike Richter
- Contact:
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: restore-vesqldatabase DB refresh question
Should work fine, is it the whole line or you've ejected parameter or few? Thanks!
Who is online
Users browsing this forum: Amazon [Bot], Google [Bot] and 11 guests