Restore failing because the backup set holds a backup of a database other than the existing database? This is a follow up of the blog post I have posted on error 3154 few years ago. I have received quite a few emails that how we can fix the same error with the help of SQL Server Management Studio. In this blog post, I will explain how we can do the same with SSMS. Here is the error code:
Error 3154: The backup set holds a backup of a database other than the existing database.
You can fix that with the help of T-SQL with the following command.
RESTORE DATABASE AdventureWorks FROM DISK = 'C:\BackupAdventureworks.bak' WITH REPLACE
If you want to do the same with SSMS, you can follow the steps here:
Step 1: Create a database with your preferred name. (In our case AdventureWorks)
Step 2: Write click on the database and click on Tasks >> Restore >> Database…

Step 3: On the restore screen go to third selection of Options. Now select the checkbox “Overwrite the existing database (WITH REPLACE)”

Step 4: Click OK. It should successfully restore the database.
Note: When you restore a database WITH REPLACE it will overwrite the old database.
Relevant Blog Post:
FIX : Error 3154: The backup set holds a backup of a database other than the existing database
Published by Pinal Dave on SQLAuthority. More of my work at pinaldave.com.





47 Comments. Leave new
Thanks Db restore successfully
TeeJay
Great! Thanks for sharing.
Thanks!
Successfully
Perfect. Thanks for the comment.
Thanks man you are great !! You saved my life and database ;)
Saving database is OK but I am not someone who can save life :)
thanks great job
thank you
still have same issue and it says that “cannot be overwritten. It is being used by database “
tahnks
Thanks lot.
Thank you
thanks men!
Great, thanks man!
you are perfect thank you
I am using SQL Server 2008. While I am restoring database from backup file I got the error.
Restore failed for Server ‘WIN-TUT3YRM1MMN\SQLEXPRESS’. (Microsoft.SqlServer.SmoExtended)
System.Data.SqlClient.SqlError: RESTORE detected an error on page (44262:41495) in database “KBCLDBNEW” as read from the backup set. (Microsoft.SqlServer.Smo).
I have tried restoring in new database but still gives the error. I am cannot find the what is the problem. Thanks for helping me.
Thank you, That was the best solution I found!
Thanks, That was the best solution I found! One tick in the option section :)