I have taken file group backup of SampleDB
database and I want to restore it on to a different existing empty database RestoreDB
. I was able to restore a full backup but I am having problem while restoring a file group backup.
Here is what i have tried so far.
RESTORE DATABASE RestoreDB
FROM DISK = 'D:\Sample\SampleDB_FileGroup.bak'
WITH
REPLACE, -- Overwrite DB - if one exists
NORECOVERY, -- Use if DIFFs / T/Logs to recover
-- RECOVERY, -- Use if NO more files to recover, database will be set ready to use
STATS = 10, -- Show progress (every 10%)
MOVE 'SampleDB' TO 'D:\Sample\RestoreDB\RestoreDB.mdf',
MOVE 'SampleDB_2' TO 'D:\Sample\RestoreDB\RestoreDB_2.ndf',
MOVE 'SampleDB_log' TO 'D:\Sample\RestoreDB\RestoreDB_log.ldf'
Using the above code I was able to restore a full backup but I am not able to restore a file group backup.
Any ideas on how to achieve this?