can t restore a DB: Message: Directory lookup for the file ...... failed
Error: Directory lookup for the file ...... failed
Hi there,
We have a DB on a server, we backed up the DB using: SSMS by selecting the DB in question, tasks, back up, then back up the DB to a file called my Backup
Then to restore the backed up database on my server, I do this in
SSMS: in Databases I do: Restore,
in To Database: I specify: MyBackedUpDatabase
I check : from device, then I specify the path to my file back up
called : backup
But I get this error:
Restore failed for Server 'ABC'. (Microsoft.SqlServer.Smo)
System.Data.SqlClient.SqlError: Directory lookup for the file "D:\Databases\Microsoft SQL Server\MSSQL.1\MSSQL\Data\OrleansEcomm.mdf" failed with the operating system error 21(error not found). (Microsoft.SqlServer.Smo)
Merci (thank)
Re: can t restore a DB: Message: Directory lookup for the file ...... failed
We prefer to use T-SQL statements to backup and restore files...
This would be a restore:
RESTORE FILELISTONLY
FROM DISK = 'c:\acs desktop\Stufiles_Mar27_boe.BAK'
RESTORE DATABASE Stufiles
FROM DISK = 'c:\acs desktop\Stufiles_Mar27_boe.BAK'
WITH MOVE 'Stufiles_data' TO 'c:\sql data\Stufiles.mdf',
MOVE 'Stufiles_log' TO 'c:\sql logs\Stufiles.ldf'
The first RESTORE with FILELISTONLY displays a grid in the Management Studio that shows the "logical" names of the data and log portions of the .BAK.
The second RESTORE actually restores the DB - with specific file locations for data and log.
Re: can t restore a DB: Message: Directory lookup for the file ...... failed
Try checking the destination paths form the .mdf and .ldf files. In the "Restore Database" window, click "Options", then check the values under "Restore As". I once got the same error message because the files had been stored on the D partition on the source server, so my computer was trying to restore them to the D drive, which was my CD ROM drive.