Solved

Importing a backup in SSMSE 2005

Posted on 2013-12-09
2
344 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
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

685 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