Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Restore .bak into a different name?
Message
From
26/08/2017 15:51:34
 
General information
Forum:
Microsoft SQL Server
Category:
Backups
Miscellaneous
Thread ID:
01653769
Message ID:
01653775
Views:
34
>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
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform