Restoring database with multiple files, filegroups and With Move

  • HI, A vendor just set up a database for us and we were told we had to perform the backups and restores. That's fine but this is the first database we have with multiple files and file groups. We have a nightly backup and have included the "RESTORE FILELISTONLY' output from the backup file. We can't get a good sample from BOL.

    Can someone please help us with a script to restore the database with all it's files and filegroups using the with move. Our test server will rewquire us to use the with move for this test as we only have a drive C. For now we must test the restore using drive C for everything. We have tried looking it up in BOL but that's beyond this configuration.

    Please help...

    Database name is: NGProd

    Backup File is NGProd_data_dump.bak (Single FULL backup)

    The database will be put in FULL recovery mode shortly so we will have log backups also.

    Listing from RESTORE FILELISTONLY:

    Logical Name Path FileGroup Type FileID

    NextGenSys D:\MSSQL.1\MSSQL\Data\NGProd_Data.mdfPRIMARY D 1

    NextGen_Core_Data_0 D:\MSSQL.1\MSSQL\Data\NGProd_Core_Data0.ndf NEXTGEN_CORE D 3

    NextGen_Core_Data_1 D:\MSSQL.1\MSSQL\Data\NGProd_Core_Data1.ndf NEXTGEN_CORE D 4

    NextGen_Core_Data_2 D:\MSSQL.1\MSSQL\Data\NGProd_Core_Data2.ndf NEXTGEN_CORE D 5

    NextGen_Core_Data_3 D:\MSSQL.1\MSSQL\Data\NGProd_Core_Data3.ndf NEXTGEN_CORE D 6

    NextGen_Core_Data_4 D:\MSSQL.1\MSSQL\Data\NGProd_Core_Data4.ndf NEXTGEN_CORE D 7

    NextGen_Core_Data_5 D:\MSSQL.1\MSSQL\Data\NGProd_Core_Data5.ndf NEXTGEN_CORE D 8

    NextGen_Core_Data_6 D:\MSSQL.1\MSSQL\Data\NGProd_Core_Data6.ndf NEXTGEN_CORE D 9

    NextGen_Core_Data_7 D:\MSSQL.1\MSSQL\Data\NGProd_Core_Data7.ndf NEXTGEN_CORE D 10

    NextGen_Index_0 I:\MSSQL.1\MSSQL\Data\NGProd_Index0.ndf NEXTGEN_INDEX_1 D 11

    NextGen_Index_1 I:\MSSQL.1\MSSQL\Data\NGProd_Index1.ndf NEXTGEN_INDEX_1 D 12

    NextGen_Index_2 I:\MSSQL.1\MSSQL\Data\NGProd_Index2.ndf NEXTGEN_INDEX_1 D 13

    NextGen_Index_3 I:\MSSQL.1\MSSQL\Data\NGProd_Index3.ndf NEXTGEN_INDEX_1 D 14

    NextGen_Index_4 I:\MSSQL.1\MSSQL\Data\NGProd_Index4.ndf NEXTGEN_INDEX_1 D 15

    NextGen_Index_5 I:\MSSQL.1\MSSQL\Data\NGProd_Index5.ndf NEXTGEN_INDEX_1 D 16

    NextGen_Index_6 I:\MSSQL.1\MSSQL\Data\NGProd_Index6.ndf NEXTGEN_INDEX_1 D 17

    NextGen_Index_7 I:\MSSQL.1\MSSQL\Data\NGProd_Index7.ndf NEXTGEN_INDEX_1 D 18

    NextGen_LOB_0 D:\MSSQL.1\MSSQL\Data\NGProd_LOB0.ndf NEXTGEN_LOB_1 D 19

    NextGen_LOB_1 D:\MSSQL.1\MSSQL\Data\NGProd_LOB1.ndf NEXTGEN_LOB_1 D 20

    NextGen_LOB_2 D:\MSSQL.1\MSSQL\Data\NGProd_LOB2.ndf NEXTGEN_LOB_1 D 21

    NextGen_LOB_3 D:\MSSQL.1\MSSQL\Data\NGProd_LOB3.ndf NEXTGEN_LOB_1 D 22

    NextGen_LOB_4 D:\MSSQL.1\MSSQL\Data\NGProd_LOB4.ndf NEXTGEN_LOB_1 D 23

    NextGen_LOB_5 D:\MSSQL.1\MSSQL\Data\NGProd_LOB5.ndf NEXTGEN_LOB_1 D 24

    NextGen_LOB_6 D:\MSSQL.1\MSSQL\Data\NGProd_LOB6.ndf NEXTGEN_LOB_1 D 25

    NextGen_LOB_7 D:\MSSQL.1\MSSQL\Data\NGProd_LOB7.ndf NEXTGEN_LOB_1 D 26

    NextGen_Log L:\MSSQL.1\MSSQL\Data\NGProd_Log.ldf NULL L 2

    Is the code that different without the 'WITH MOVE' option?

    Thank You.

    really frustrated with BOL.

  • This link has a good video along with it from Brent Ozar that goes through restoring a multiple file database. Sorry it is not an exact script for you but I have not messed much with multiple file databases either.

    NOTE: SQL PASS conference is going on now so it might be a few and the regulars may start posting a response to help you out.

    Shawn Melton
    Twitter: @wsmelton
    Blog: wsmelton.github.com
    Github: wsmelton

  • Thanks for the quick reply and heads up on the PASS summit. I forgot about the summit.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply