Restoring an SQL database

  • Im trying to restore a database from a standalone server to a cluster configuration. i only have the BAK file, and i cant get around this error:

    System.Data.SqlClient.SqlError: Cannot use file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\CMS_DB.mdf' for clustered server. Only formatted files on which the cluster resource of the server has a dependency can be used. (Microsoft.SqlServer.Smo)

    And if i try to create the database first, and then restore the BAK file, i get this error:

    System.Data.SqlClient.SqlError: The backup set holds a backup of a database other than the existing 'CMS_DB' database. (Microsoft.SqlServer.Smo)

    Off course the Microsoft help link is not any god 🙁

    Can any one help me out here?

    Kind regards

    Bjørn Andersen

  • I would say you need to use the 'with move' option when restoring the database to move the database files to drives that are in the dependancies list of the SQL resource in your cluster

    see BOL but basically

    restore database dbname from disk = 'path to .bak file'

    with move 'data file logical name' to 'new physical location',

    move 'log file logical name' to 'new physical location'

    use restore database filelistonly from disk = 'path to .bak file'

    to see file names and existing locations

    delete those files you created earlier.

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

  • I think George it right. be sure you're restoring from the clustered server and not one of the instances on one of the boxes.

  • Okay off cource that did the trick. But as i recall it, in SQL server 2000 it was possible to make the changes directly in the gui. This is not possible in SQL server 2005. So you has to write the restore script manually. Any way - this may be a better way to do it 🙂

    Thanks for the help to both of you.

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

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