Link to home
Start Free TrialLog in
Avatar of kwh3856
kwh3856Flag for United States of America

asked on

How do you restore a .bak file that was created from a SQL Backup?

We have been using a vendor in an ASP environment for some time now.  We have decided to move to an inhouse server and the vendor has sent us our data in a .bak format.  They said it was a backup of our database from SQL.  What command do I use to restore it on my SQL server?

Avatar of kwh3856
kwh3856
Flag of United States of America image

ASKER

The name of the file they sent us is

PM_RW_MDSPED_080430.bak

Thanks
Kenny
Avatar of kwh3856

ASKER

Ok..I setup a restore device under backup devices and pointed it to my file.  I then entered the following command.

restore Database PM_RW_MDSPED_080430 from MdServe with RECOVERY

I now get the following error messages when you execute the command

Msg 5133, Level 16, State 1, Line 2
Directory lookup for the file "E:\PM_MDF\PM_RW_MDSPED.mdf" failed with the operating system error 3(The system cannot find the path specified.).
Msg 3156, Level 16, State 3, Line 2
File 'PM_RW_Mdsped_Data' cannot be restored to 'E:\PM_MDF\PM_RW_MDSPED.mdf'. Use WITH MOVE to identify a valid location for the file.
Msg 5133, Level 16, State 1, Line 2
Directory lookup for the file "e:\PM_LDF\PM_RW_MDSPED.ldf" failed with the operating system error 3(The system cannot find the path specified.).
Msg 3156, Level 16, State 3, Line 2
File 'PM_RW_Mdsped_Log' cannot be restored to 'e:\PM_LDF\PM_RW_MDSPED.ldf'. Use WITH MOVE to identify a valid location for the file.
Msg 3119, Level 16, State 1, Line 2
Problems were identified while planning for the RESTORE statement. Previous messages provide details.
Msg 3013, Level 16, State 1, Line 2
RESTORE DATABASE is terminating abnormally.



My server does not have a drive letter e:

Is that my primary problem?

Thanks
Kenny
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kwh3856

ASKER

Angel,
Thanks.  I got this error message when I tried your command.



Msg 5133, Level 16, State 1, Line 1
Directory lookup for the file "C:\PM_LDF\PM_RW_MDSPED.ldf" failed with the operating system error 2(The system cannot find the file specified.).
Msg 3156, Level 16, State 3, Line 1
File 'PM_RW_Mdsped_Log' cannot be restored to 'C:\PM_LDF\PM_RW_MDSPED.ldf'. Use WITH MOVE to identify a valid location for the file.
Msg 3119, Level 16, State 1, Line 1
Problems were identified while planning for the RESTORE statement. Previous messages provide details.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
just to emphasise: the folder C:\PM_LDF HAS to exist BEFORE you try the restore.
sql server will not implicitely try to create the folder!
Avatar of kwh3856

ASKER

Thanks.  I did not notice there were two seperate directories.

Thanks
Kenny
Avatar of kwh3856

ASKER

Awesome!!!!

Thanks
Kenny