question

nuthan avatar image
nuthan asked

the backup set holds a backup of database other than the existing 'DBname' database

I'm try to restore the Database to my local system where the backup was taken in the server but I'm not able to restore it. I created a empty Database with the same database name which is given in the server and SQL wizard and checking the Overwrite database. I have tried all the possible ways but the error remains the same. I even tried the T-SQL command, Following are the list of commands I have been trying RESTORE DATABASE ERPDB FROM DISK = N'E:\test.bak' WITH REPLACE RESTORE FILELISTONLY FROM DISK = 'E:\test.bak' Took the Logicalname RESTORE DATABASE ERPDB FROM disk = 'E:\test.bak' WITH REPLACE,MOVE 'ERPDB' TO 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SIDEWAYS\MSSQL\DATA\ERPDB.mdf', MOVE 'ERPDB_log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SIDEWAYS\MSSQL\DATA\ERPDB_log.ldf' GO This is the error I'm facing. Msg 3154, Level 16, State 4, Line 1 The backup set holds a backup of a database other than the existing 'ERPDB' database. Msg 3013, Level 16, State 1, Line 1 RESTORE DATABASE is terminating abnormally. Please let me out with this. Regards, Nuthan A R
sql-server-2008-r2backup-restore
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Grant Fritchey avatar image
Grant Fritchey answered
Don't create the database first if you're trying to restore. There's no need to do that, and, if the WITH MOVE rearranges the data files, you could be hitting issues there. Instead, run the restore command and use the MOVE option.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.