Answered Restore from a filegroup to a different database

  • 2012年3月13日 0:27
     
     

    Hello folks,

          I have a huge database in production that needs to be backed up on daily basis. However, parts of that database are not very important. My plan to tackle this situation is to create a filegroup and move some of the tables to that filegroup and backup that specific filegroup on a daily basis. When I'm trying to restore it on a different server on a database with the same name and filegroups, I get the below error. I tried "with replace" and "partial" options as well. Nothing seemed to work in this scenario. below is also the script i'm trying to run. Any help is greatly appreciated and thanks in advance.

    Error:

    Msg 3154, Level 16, State 4, Line 2
    The backup set holds a backup of a database other than the existing 'Database1' database.

    RESTORE DATABASE [Database1]
    FILEGROUP = 'FG_Data_rollup'
    FROM  DISK = N'C:\SQL DATA\Database1_data_rollup.bak'
    WITH MOVE 'Database1' TO 'C:\SQL Data\Database1.mdf',
    MOVE 'FG_DATA_rollup' TO 'C:\SQL Data\FG_DATA_rollup.ndf',
    MOVE 'FG_DATA_rollup0' TO 'C:\SQL Data\FG_DATA_rollup0.ndf',
    MOVE 'Database1_Log' TO 'C:\SQL Data\Database1_log.ldf',
     FILE = 1,  NOUNLOAD,  REPLACE,  STATS = 10, partial
    GO

    Thank you.


    ----- Vinod

全部回复