LuísA
LuísA

Reputation: 59

SQL Server Management Studio can't recognize .bak file

I'm trying to restore a db from Microsoft (AdventureWorks2012). However, when I try to restore the .bak file, it seems like SSMS doesn't recognize it and I get an error:

No backup set selected to be restored

I gave full permissions to the folder which contains the .bak file.

Steps I've taken to restore the .bak file:

Here is a screenshot:

enter image description here

Upvotes: 0

Views: 5329

Answers (2)

Muthukumar S
Muthukumar S

Reputation: 11

Try the below VERIFYONLY option to understand more about the issue:

USE master RESTORE VERIFYONLY FROM DISK='C:\Share\DBName.bak'

In my case, I got the below error when VERIFYONLY option was used:

The path specified by "E:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\DATA\DBName.mdf" is not in a valid directory. Directory lookup for the file "F:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Data\DBName_log.ldf" failed with the operating system error 3

It was expecting the folder 'E:\Program Files'. As it was not there in my PC, I fixed it by following RESTORE WITH MOVE option:

RESTORE DATABASE DBName FROM DISK = 'C:\Share\DBName.bak' WITH MOVE 'DBName' TO 'C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\DATA\DBName.mdf', MOVE 'DBName_Log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\DATA\DBName_Log.ldf', RECOVERY, REPLACE, STATS = 10;

Upvotes: 0

Sean Lange
Sean Lange

Reputation: 33581

That is the error message that typically coincides with trying to restore a backup from a newer version on an older version. And it looks like you have sql server 10.5 in your screen which is 2008r2. And you are trying to restore AW2012. That will never work. You can't restore a newer version to an older version.

Upvotes: 2

Related Questions