Solved

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

Posted on 2008-06-14
7
1,434 Views
Last Modified: 2012-06-27
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?

0
Comment
Question by:kwh3856
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
7 Comments
 

Author Comment

by:kwh3856
ID: 21786952
The name of the file they sent us is

PM_RW_MDSPED_080430.bak

Thanks
Kenny
0
 

Author Comment

by:kwh3856
ID: 21786988
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
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 21787582
>Is that my primary problem?
yes, and exactly as the error message indicates, you have to use the MOVE :


restore Database PM_RW_MDSPED_080430 from MdServe 
with RECOVERY
 , MOVE 'PM_RW_Mdsped_Data' TO  'C:\PM_MDF\PM_RW_MDSPED.mdf'
 , MOVE 'PM_RW_Mdsped_Log' TO 'C:\PM_LDF\PM_RW_MDSPED.ldf' 
note: the full folder ( C:\PM_MDF ) must exist before the restore, otherwise you will get the same error.

Open in new window

0
Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

 

Author Comment

by:kwh3856
ID: 21788510
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.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 21788539
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!
0
 

Author Comment

by:kwh3856
ID: 21788553
Thanks.  I did not notice there were two seperate directories.

Thanks
Kenny
0
 

Author Closing Comment

by:kwh3856
ID: 31467269
Awesome!!!!

Thanks
Kenny
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question