Search code examples
sql-serversql-server-2008database-restore

SQL Server 2008 R2: Restore a single filegroup


Not sure if this is a duplicate of https://stackoverflow.com/questions/2951016/sql-server-2005-partial-filegroup-restore-on-qa-database, but if so then I apologise (even though it was not answered).

I have a database on SQL2008R2 with multiple (3) filegroups. There are production and development copies of this database on separate servers.

I have created a filegroup backup of the PRIMARY filegroup from production and wish to restore it on the development server. I do not want to try and backup/restore the entire database as one of the filegroups contains nearly 1TB of data and the servers are geographically distant.

I have tried restoring the filegroup backup using "with partial, recovery" and I now have access to the data in that filegroup, but I have lost access to the data in the other filegroups (I am testing this on a 3rd server for now so I have not really lost anything as such).

I am not even sure that what I am trying to do is possible (and it is starting to look as if it is not), can anybody shed any light on what else I might to to acheive my goal.

Thanks.


Solution

  • You cannot restore the PRIMARY filegroup and keep access to the pre-restore data in the other two filegroups. It simply not how it works, and if you think a bit about data consistency you'll see that is not possible to work in any other way.

    After you restored the PRIMARY filegroup you must continue with restoring the other filegroups, or not have access to them.