>I made a backup of a customer SQL Server database (my app database) into a .BAK file.
>I then copied this .BAK file to my computer, into my SQL Server database backup folder.
>Now I want to restore this .BAK into my SQL Server but since I already have a DB of the same name, I want to restore it into a different name. E.g. the name of the DB in my SQL Server is MyAppDb and I want to restore the .BAK into MyAppDbCurrent.
>I open/connect my SQL Server 2016 SSMS. I go to the Restore window and specify Destination as MyAppDbCurrent and then select the .BAK file as restore from. But the Restore of the DB fails. Is this because the database name (in .BAK) is MyAppDb (the same as one of my existing databases). How would I resolve it?
Here is an example to customize the restore:
USE Master
RESTORE DATABASE [LevelExtreme] FROM DISK = N'D:\Data\Level Extreme\LevelExtreme.bak'
WITH
MOVE 'UniversalThread' TO 'D:\Data\Level Extreme\LevelExtreme.mdf',
MOVE 'UniversalThread_log' TO 'D:\Data\Level Extreme\LevelExtreme.ldf',
FILE = 1, NOUNLOAD, REPLACE, STATS = 10
GO