Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Importing a backup in SSMSE 2005

Posted on 2013-12-09
2
Medium Priority
?
354 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:RBG IT
[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
2 Comments
 
LVL 38

Accepted Solution

by:
Jim P. earned 1000 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 1000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

722 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