Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

database restore failing with move

I am trying to restore a database backup but getting error:

Restore failed for Server 'ASIF-VAIO'. (Microsoft.SqlServer.SmoExtended)

ADDITIONAL INFORMATION:

System.Data.SqlClient.SqlError: File 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\uwa.mdf' is claimed by 'Aston_Fresh_log'(2) and 'Aston_Fresh'(1). The WITH MOVE clause can be used to relocate one or more files. (Microsoft.SqlServer.Smo)

like image 776
DotnetSparrow Avatar asked Feb 19 '13 09:02

DotnetSparrow


1 Answers

When restoring, you need to be sure to

  • pick a new database name that doesn't already exist (unless you want to overwrite that pre-existing database)

enter image description here

  • you tick the Overwrite option in the Options tab page and define valid and new file names for the .mdf and .ldf file so that you don't accidentally overwrite another database on your system:

enter image description here

like image 75
marc_s Avatar answered Nov 02 '22 23:11

marc_s