How to Create a New Database from Backup in MSSQL

From the below code take the LogicalName for data and the log

RESTORE FILELISTONLY
FROM DISK = 'E:\Backup\Full\DatabaseDev.bak';

Run the below command to restore the backup to a new database

RESTORE DATABASE DatabaseDev
FROM DISK = 'E:\Backup\Full\DatabaseDev.bak'
WITH MOVE 'LogicalName_Data' TO 'D:\Data\DatabaseDev.mdf',
MOVE 'LogicalName_Log' TO 'D:\Data\DatabaseDev_log.ldf';

Leave a Reply