Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Restore Database, New DB, New File Structure

Author  Topic 

dbthj
Posting Yak Master

143 Posts

Posted - 2010-01-05 : 12:09:57
I have a database that has 1 .mdf, 4 .ndf files and a log. I backed it up. I want to restore it to a different server, but end up with only one .mdf datafile and one log file. I have tried to test this and have failed. No matter what I do (REPLACE, MOVE or whatever), the restore process looks in the backup (or sysfiles) and sees all the files and says, "this guy needs 5 data files and a log" and it creates them. Gotta be a way to do this.

shan
Yak Posting Veteran

84 Posts

Posted - 2010-01-05 : 12:12:17
Look in the below posting

http://www.mssqltips.com/tipprint.asp?tip=1894

-Shan
Go to Top of Page

NeilG
Aged Yak Warrior

530 Posts

Posted - 2010-01-05 : 12:26:05
That won't work as soon as you click on the mdf file it will link to the ndf files
Go to Top of Page

NeilG
Aged Yak Warrior

530 Posts

Posted - 2010-01-05 : 12:28:16

http://www.eggheadcafe.com/community/aspnet/13/10007989/merge-ndf-files-for-a-dat.aspx[/hr]

-----------------------------------------------
Learning something new on SQL Server everyday.
Go to Top of Page

dbthj
Posting Yak Master

143 Posts

Posted - 2010-01-05 : 12:40:02
That solution involves moving tables between filegroups. 2 Problems.
1. Moving tables is a tricky business from what I've seen. Clustering indexes and constraints really complicate the issue.
2. When you are done, you will end up with one .mdf and one .ndf rather than just one .mdf.

No way of doing this during the restore?
Go to Top of Page

NeilG
Aged Yak Warrior

530 Posts

Posted - 2010-01-05 : 12:44:58
I've investigated this previously regards doing this during a restore and i was unable to find a solution, in fact I ended up creating a new database and then exporting the data/schema over to the new server table by table
Go to Top of Page
   

- Advertisement -