Network Management

Database Restore Over another DB / DB backup Restore Error Restore failed for server Microsoft.SqlServer.SmoExtended

Resolve Restore failed for server.(Microsoft.SqlServer.SmoExtended). System.Data.SqlClient.SqlError: The file 'C:\ProgramFiles\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\test1_MSCRM.mdf' cannot be overwritten. It is being used by database 'test1_MSCRM'. (Microsoft.SqlServer.Smo)

First published date

11/29/2018 10:48 PM

Last published date

1/27/2022 7:02 AM

Overview

You have following error while restoring the DB:

This Error can bee seen if you are trying to restore the DB backup to another DB Or Restoring the DB backup to another DB 

 

 

Product section

Network Performance Monitor

Cause

You cannot restore overwrite the files. While restoring you created the new DB with different name but forgot to change the file name for .mdf and .ldf which was taken with Backup.

Resolution

  1. Click on Options.
  2. At right side, Under ‘Restore the database file as:‘ section. The first column represent the original file names of file type .mdf and .ldf and right most column represents the file name which you want to provide and restore the DB file as.

 

  1. Click on the browse button and scroll all the way to see the file name and change it to your preferred name(test2_MSCRM.mdf and test2_MSCRM.ldf). (Whatever you want to name according to the DB name).
  2. After changing the restore database file name as, my DB restore succeeded.