SQL-Server: The backup set holds a backup of a database other than the existing

前端 未结 24 1781
天命终不由人
天命终不由人 2020-12-07 06:49

I am trying to restore a SQL Server backup file for my database, but it is throwing an error as follow:

The backup set holds a backup of a database ot

24条回答
  •  無奈伤痛
    2020-12-07 07:08

    Its because the .mdf and .ldf Files from the original Db were locate at maybe c:\programFile\.... and this info is saved in the Backup!

    If you create the same DB on a different SQL Server where the installation is on c:\program Files (x86)\ .... you can not restore as usually. You need to relocate the path for .mdf and .ldf Files.

    Therefore:

    • Create a empty DB on the new Server

    • Right click on the empty Db > Tasks > Restore > Database > click Device select your .bak Files > Select Db to restore into

    • click on Files at left side > Select "Relocate all Files to Folder"
    • click Options on the left site > click on Overwrite

    Done!
    Hope it helps!

提交回复
热议问题