3

I am trying to restore a database over the existing one. This worked fine in the past, until all of a sudden, it doesnt.

I have clearly, in the past, attached the same database file under a different name and it now thinks that restoring a database over the current instance will overwrite the other instance as well hence giving me the following error:

Failed to restore database: The file 'E:\database\db.mdf' cannot be overwritten. It is being used by database 'ABC'.
File 'db' cannot be restored to 'E:\database\db.mdf'. Use WITH MOVE to identify a valid location for the file.

The file 'E:\database\db_log.ldf' cannot be overwritten.  It is being used by database 'ABC'.
File 'db_log' cannot be restored to 'E:\database\db_log.ldf'. Use WITH MOVE to identify a valid location for the file.

The big question: How do you delete references to the old database? How do you find what previous database instances were used even?

Thanks

1 Answer 1

0

Try moving the conflicting files into a different directory/deleting them. The operation is basically being told to overwrite files that it sees to be there with something different. I had a similar problem on a test environment and discovered either deleting the conflicting files/moving them worked perfectly.

Also, have you tried to use the WITH REPLACE option under the restoration menu? I'm not entirely sure this works for an instance named differently, but with a same name it will overwrite it perfectly fine.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .