Restoring a database from a different database backup...

  • I would like to restore a database from a database backup with a different database name.  The filenames are also different, obviously.  How do I go about doing this?  My backup database name is WFSA, and the database I would like to restore name is WFSA_dev.

    Thank you in advance,

    Jim

  • Hello Jim,

    If you are restoring the database from Enterprise Manager (GUI), then you can Right Mouse click on Databases and select 'Restore'. You will be prompted with a screen showing the first database on that server. Here you can give an alternative name as you desired. select the location of the backup file. on the next tab, you select "Force restore on this database" option and here you need to give the specific location to where the data files need to be written.

    With TSQL

    Restore database <your new database>

    from <backup device> -- location of the existing backup file

    with move 'logical file name' to 'operating_system_file_name' -- logical file name will be the same as the source but operating system file can be changed.

    Hope this helps.

    Thanks

     


    Lucky

  • If you want a list of the logical file names then you can do a RESTORE FILELISTONLY FROM <backup device> (http://msdn2.microsoft.com/en-us/library/ms173778.aspx).

    - James

    --
    James Moore
    Red Gate Software Ltd

  • If you are using Enterprise Manager:

    > Right-click the WFSA_dev database

    > Select "Restore Database" (the Restore database dialog box will display)

    > Using the combo-box: "Show backups of database:" select WFSA

    > The last backup of WFSA will be checked and shown in the listview.

    > If an earlier backup is desired, use the combo-box: "First backup to restore:" to select it.

    > (Make sure you check the appropriate backup in the listview)

    > The first time you restore WFSA over WFSA_dev you will have to select the "Options" tab and check "Force restore over existing database."

    > Click "OK"

  • Be sure you change the filenames. By default it has the file names for the existing db. In the EM dialog, change the db name manually after picking the backup and on the options tab, change the file names.

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

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