SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Restoring database with multiple files, filegroups and With Move


Restoring database with multiple files, filegroups and With Move

Author
Message
Dana Bibeault
Dana Bibeault
SSC Eights!
SSC Eights! (928 reputation)SSC Eights! (928 reputation)SSC Eights! (928 reputation)SSC Eights! (928 reputation)SSC Eights! (928 reputation)SSC Eights! (928 reputation)SSC Eights! (928 reputation)SSC Eights! (928 reputation)

Group: General Forum Members
Points: 928 Visits: 338
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.mdf PRIMARY 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.
Shawn Melton
Shawn Melton
SSCertifiable
SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)

Group: General Forum Members
Points: 6001 Visits: 3537
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: blog.wsmelton.info
Dana Bibeault
Dana Bibeault
SSC Eights!
SSC Eights! (928 reputation)SSC Eights! (928 reputation)SSC Eights! (928 reputation)SSC Eights! (928 reputation)SSC Eights! (928 reputation)SSC Eights! (928 reputation)SSC Eights! (928 reputation)SSC Eights! (928 reputation)

Group: General Forum Members
Points: 928 Visits: 338
Thanks for the quick reply and heads up on the PASS summit. I forgot about the summit.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search