database restore failing with move
sql, sql-server, sql-server-2008
Solution
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)
- 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:
Problem
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)