Solved

Importing a backup in SSMSE 2005

Posted on 2013-12-09
2
333 Views
Last Modified: 2013-12-09
I need to export a live SQL 2005 database and import it into a test environment. I've used the SQL backup feature to obtain a '.bak' file and copied it to a test server. When I try to import the .bak file it fails with error "restore failed for server "SRV-12\INVENTIVE_WEB".

System.Data.SqlClient.SQLError: Directoy lookup for the file C:\Program Files\Microsoft SQL Server\MSSQL.4\MSSQL\Data\Inventive_web.mdf failed with the operating system error 3(error not found).

Is it possible to import the .bak file? If not, what's the best option?

Thanks
John
0
Comment
Question by:inventiveIT
2 Comments
 
LVL 38

Accepted Solution

by:
Jim P. earned 250 total points
ID: 39707226
The issue is that SQL can't find the C:\Program Files\Microsoft SQL Server\MSSQL.4\MSSQL\ folder.

Two options:

Create the directory, or during the restore process change the path for the mdf and ldf files.
0
 
LVL 16

Assisted Solution

by:DcpKing
DcpKing earned 250 total points
ID: 39707281
Yes, it's certainly possible (assuming that you're not trying to import it into SQL Server 2000, or from Enterprise into Express).

You don't "import" a .bak file: you use the Restore facility to create a whole new database from the backed-up data.

Therefore open SSMS and right-click on Databases and then select Restore Database ...

In the Restore Database dialog box that you get choose Device and File, then Add from the next dialog box and find your .bak file. Once back at the Restore Database dialog you can give your incoming database a name.

Then go to the files page and make sure that the paths are correct - you're unlikely to be putting the mdf and ldf file into the same places as they were for the other server.

Try this out again bearing these things in mind and, if you get problems again, take some screenshots (Alt-PrintScreen) of the error messages and of the settings in the Restore Database.

hth

Mike
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

708 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now