Reputation: 2898
My .bak
file is the other the local server.
I tried too many different script but unable to successes.
I tried syntax is
RESTORE FILELISTONLY FROM DISK='D:\ERPNewtesting-12022014.bak'
Get the Logicalname from above query and use in below query
RESTORE DATABASE Test FROM DISK='ERPNewtesting-12022014.bak'
WITH
MOVE 'ERPAgrotechBeta' TO 'D:\Pragnesh\Test.mdf',
MOVE 'ERPAgrotechBeta_log' TO 'D:\Pragnesh\Test_log.ldf',
REPLACE,
STATS=10
After executing above query below error is generate.
Msg 3201, Level 16, State 2, Line 3
Cannot open backup device 'C:\Program Files (x86)\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Backup\ERPNewtesting-12022014.bak'. Operating system error 2(The system cannot find the file specified.).
Msg 3013, Level 16, State 1, Line 3
RESTORE DATABASE is terminating abnormally.
Please help me for this manner
Upvotes: 0
Views: 23141
Reputation: 14441
FYI: From SqlServer management studio there's an option to restore a database from the UI. It allows you to browse to find the source bak file. The browse window opened is on the database server machine NOT the machine where you are running management studio.
Upvotes: 2
Reputation: 738
Its mainly due to the rights issue :-
Follow below 2 steps and it will resolve :-
Let the Server take backup on default directory and copy the file in your desired folder. I did that.
Give same kind of permissions to your desired folder as Backup directory has.
OR
U can add the service account into local admin group of the machine where backup is taken
Upvotes: 0
Reputation: 4936
It sounds like you have backed up a db on one server, and you want to restore it to another server. Is this correct?
Your backup file D:\ERPNewtesting-12022014.bak
is on server A, right? It needs to be accessible to the account running the SQL Server service on server B. A few quick options come to mind:
Then proceed with the restore. If you chose option 1 or 2, it will be something like this:
RESTORE DATABASE Test
FROM DISK='\\SomeServer\Shared Folder\ERPNewtesting-12022014.bak'
WITH
MOVE 'ERPAgrotechBeta' TO 'D:\Pragnesh\Test.mdf',
MOVE 'ERPAgrotechBeta_log' TO 'D:\Pragnesh\Test_log.ldf',
REPLACE,
STATS=10
If you chose option 3, it will look something like this:
RESTORE DATABASE Test
FROM DISK='D:\Path on Server B\ERPNewtesting-12022014.bak'
WITH
MOVE 'ERPAgrotechBeta' TO 'D:\Pragnesh\Test.mdf',
MOVE 'ERPAgrotechBeta_log' TO 'D:\Pragnesh\Test_log.ldf',
REPLACE,
STATS=10
Upvotes: 3
Reputation: 754240
You're only specifying a "relative" path for the .bak
file here:
RESTORE DATABASE Test FROM DISK='ERPNewtesting-12022014.bak'
and quite obviously, from the error message, the file isn't there where this points to.
Cannot open backup device 'C:\Program Files (x86)\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Backup\ERPNewtesting-12022014.bak'. Operating system error 2 (The system cannot find the file specified.)
You'll need to specify the full, complete path to the .bak
file here:
RESTORE DATABASE Test FROM DISK='D:\ERPNewtesting-12022014.bak'
*****
If you would actually try and specify the complete path here so that SQL Server can find it's source for the restore - I'm always positive it'll work......
Upvotes: 1