Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Unable to restore DB in MS SQL Server 2005 from .BAK file

Posted on 2006-11-29
3
Medium Priority
?
465 Views
Last Modified: 2008-01-09
I installed the Trial version of MS SQL Server 2005 & am trying to restore a database from a backup file a client sent me as a zipped file, name of backup file is URM.BAK. In SQL Server, I right click Databases & choose Restore Databases, then select From Device, then click on Add to specify the location of the Backup File URM.BAK, which I put at "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data", then click OK. In the "To database" drop-down, I give a name to the DB, calling it URM as well (for sakes of simplicity). In the section "Select the backup sets to restore", I check both checkboxes of URM backup. When I finally click OK, I get the following error:

TITLE: Microsoft SQL Server Management Studio
------------------------------
Restore failed for Server 'BABER-WLVHQ8ELP'.  (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: Directory lookup for the file "C:\Program Files\Microsoft SQL Server\MSSQL\data\URM_Data.MDF" failed with the operating system error 3(The system cannot find the path specified.). (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
Probably all that is important is the error, but I am descrbing in details just to ensure I am not doing anything incorrectly. I must point out that according to my client, the URM.BAK is from SQL Server 2004, but I'd assume 2005 should be backward compatible. I have also tried changing the location of the URM.BAK file to the Data Folder under sql server. Please help.
0
Comment
Question by:nemesis7
3 Comments
 
LVL 29

Accepted Solution

by:
Nightman earned 150 total points
ID: 18043152
Have a look at the options menu (second one one the left)  when you are restoring the database. The look at the path of both the MDF and LDF file. This will be (by default) the path where the MDF used to reside whereever it was running.

Look at changing
C:\Program Files\Microsoft SQL Server\MSSQL\data\URM_Data.MDF
to
C:\Program Files\Microsoft SQL Server\MSSQL.1\data\URM_Data.MDF

Notice the subtle difference in the path?
Also do the same with the ldf.
0
 
LVL 10

Expert Comment

by:harisrashid
ID: 18043953
Create a new database and give it the same name as the backed up database.

After creating this new Db, run the restore operation.

Regards,

Haris
0
 
LVL 35

Expert Comment

by:David Todd
ID: 18051277
Hi,

Of even try taking a backup from one of the sample databases - adventure works et al, and restoring that to a new database.

Regards
  David
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

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

It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how the fundamental information of how to create a table.

876 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