Restore Backup in a database while one have changed the filegroups

  • Hi all and good to find you all.

    I have 2 databases, the one is the "mirror" of the other. Each night there is a restore job that runs and copies the data from the production to the secondary server.

    The production server has one database which was decided to be split into multiple filegroups. One filegroup (primary has the 5 biggest tables) while the secondary filegroup has all the rest tables and lies in a different disk (the reason was obviously storage capacity)

    The question is, can the job run automatically now (it restores redgate backups from production to the secondary server) or one has to do exactly the same steps and split the secondary database in filegroups before restoring? The two databases have exactly the same structure the only thing that changes are the filegroups to which the data are stored.

    I hope i am understood because i am reading it again and i doubt myself 😛

  • the structure of the database is held in the backup. So the new file structure will be created on the next restore as long as the directory layout you are using exists on the secondary server and you use the 'replace' clause in the restore.

    ---------------------------------------------------------------------

  • Hi, thanks for the reply!

    What you mean is that the database after the restore will look exactly the same as the production one, as long as the directory can be created? or i need to create it myself? I am confused since the secondary filegroup in the production server lies in a different disk. The "mirror" server only has one disk. Given that there is enough space, it would create 2 filegroups?

  • thanoseft (6/17/2011)


    Hi, thanks for the reply!

    What you mean is that the database after the restore will look exactly the same as the production one, as long as the directory can be created? or i need to create it myself? I am confused since the secondary filegroup in the production server lies in a different disk. The "mirror" server only has one disk. Given that there is enough space, it would create 2 filegroups?

    you are going to need to add that second disk ideally, and set up the directory structure. (not the file, just the directory

    You can get round it by using the 'with move' option of the restore statement, and tell the restore to place all the files on the existing drive. All other restores after that can carry on as normal.

    ---------------------------------------------------------------------

  • Thanks again!

    The help is really appreciated! 🙂

  • no probs

    ---------------------------------------------------------------------

Viewing 6 posts - 1 through 5 (of 5 total)

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