I am trying to restore a DB from the backup. Suddenly, it is giving me the following error everytime while trying to restore.
Restore of database 'Something_Secret' failed.
The file 'C:\Some\Path\Something_Secret.mdf' cannot be overwritten. It is being used by database 'Something_Secreter'.
How to get rid this of error?
2条答案
按热度按时间o3imoua41#
Don't use the UI for this, since this won't be the last thing it gets wrong for you. Learn the
RESTORE DATABASE
command .If you want more specific guidance, show the output of:
mjqavswn2#
Here is a solution for those who would like to continue using the UI (I'm using version 15.+). Once you select the backup media, click the "Files" link in the menu on the left. This will display a dialog that allows you to change the names of the db's files. In the "Restore As" field change the name of the files to match the name of your database.
Alternatively, you could add a level to the directory after the "DATA" directory where the new directory is the name of your database and leave the actual files names as they are.