3

I have just installed SQL Server 2005 on a fresh machine, and I'm trying to import 2 databases from one of my servers. This has worked fine for a box that I did this morning but now I'm getting some errors on this second box.

I am doing the following :

  1. Right click Database > Restore Database...
  2. To database : "myDb"
  3. From Device : C:\myDbBkp.bak
  4. Check the backup set, and click OK

Normally it would give a popup saying "Import sucessful", but now I get the following :

Restore failed for server "myServer". (Microsoft.SqlServer.Smo)

Additional Information : System.Data.SqlClient.SqlError : Directory lookup for the file "C:\Program Files\Microsoft Sql Server\MSSQL.1\MSSQL\DATA\myDbBkp.mdf" failed with the operating system error 3(error not found) (Microsoft.SqlServer.Smo)

My next questions are :

  1. Why is it trying to load an MDF file from a directory I haven't specified
  2. Error not found, is that as helpful as it sounds?

Any ideas? I did this successfully earlier on an identical environment with the same versions etc.

Many thanks

user155695
  • 290
  • 3
  • 5
  • 14

2 Answers2

3

It’s not trying to load an MDF from a directory you haven’t specified, it’s trying to PUT it there (because it was there in the first place).

Instead of doing step #4, check it and don’t click “OK", but then go to OPTIONS and make sure that both the Data path and the log path (And .MDF/.LDF names) are OK and unique.

Alternatively, create the path *C:\Program Files\Microsoft Sql Server\MSSQL.1\MSSQL\DATA*.

;)

Martin Marconcini
  • 307
  • 1
  • 5
  • 13
0

Is the destination path the same as the source path? If not, you'll need to change the destination path.

joeqwerty
  • 109,901
  • 6
  • 81
  • 172