SQL Server 2005: How To Restore a Database from a Backup

Contributor Icon Contributed by shamanstears Date Icon February 7, 2007  
Tag Icon Tagged: Database

Your database is down, your users are in a panic, what do you do?. If you have been performing routine backups of your database, you can restore it to the point of the most recent backup. To restore your database, follow these steps:


1. Open SQL Server 2005 Management Studio.

2. Connect to the appropriate server.

3. Expand Databases.

4. Right-click the desired database, mouseover Tasks, mouseover Restore and select Database.

5. The Restore Database window will appear.

6. Ensure that the correct database name appears in the To database field. If not, select it from the dropdown.

7. Under Source for restore, select the From device radio button.

8. Click the button next to the textbox to select the device to restore from.

9. The Specify Backup window will appear.

10. Click Add and locate and select the backup file from the Locate Backup File Window. Click OK.

11. Under Select the backup sets to restore, select all three backups (full, transaction log, and differential).

12. In the left pane, select Options.

13. Under Recovery state, ensure that the Restore with Recovery radio button is selected.

14. Click OK to begin restoring the database.

15. Once the restore is complete, a notification box will appear. Click OK to close the box. You have now restored your database to the most recent state.

Previous recipe | Next recipe |
 
  • Anonymous
    Hi all,

    Am having the backup data in my network drive(X:) I want to restore the data from that drive. I followed the same process what u mentioned in the forum.

    After clicking the add button in the specify backup window it shows only my local disks and removable devices not showing the network drive(x:)

    Is there any option to map the data from the network drive...
  • umesh
    I taken backup of database from Sql server 2005 from other PC and try to Restore it on my PC. Both having Windows authentication. But i am facing following error

    System.Data.Sqlclient.sqlError:The media set has 2 media families but only 1 are provided.All member must be provided.(Microsoft.Sqlserver.Smo).

    IS it problem of Ownar . because owanr of .bak file is different from where i try to restore it.
  • Himanshu
    Hi,
    This is not the problem of owner, it is just because while selecting the restoring device there must be two paths (1. Default by Microsoft, 2. Given by you).
    So delete the default path given by SQL Server itself, so it remains only one path that is given by you.
    Do let me know in case this doesn't work also
    Regards,
    Himanshu
  • sundar
    hello sir/madam,

    i have stored mdf file and ldf file in dotnet solution file. i have copied my project from another system. i have to restore the database inorder to run my dotnet project.
    i have followed your procedure, but when i click the ok button, it shows error.

    please help me....
  • How To attach database sql
    mdf and ldf files are not sql2005 based.. its sql 2000.. so install that and not need to restore.. you right click the database in enterprise manager in sql2000..attach the MDF file from location.. then run the program
  • Shamsul
    Great step by step guidance. Worked a treat for me who is a complete novice
  • Osmar Mateus
    I need to restore my database to a new location (we are moving to another server).

    What do I have to do in this case?

    Thanks
  • Sunil
    Really This was very helpfull to me.
    Thank You!!
    Thank You very much
  • I have tried the above steps but didnt work out. I have 2 database servers, one with SQL Server ver 7.0 and other with SQL Server 2005. Can anyone help me out how to restore the backup file (.BAK) from the SQL Server 7.0 to SQL Server 2005 database other than using the above steps, as that didnt work and showed a versoion conflict error.
  • David Collins
    What if the Specify Backup window remains blank after you have already selected the .bak file in the previous screen. With it being blank, you are unable to restore.
    Any ideas?
  • Hello!
    How to restore with old name of PC and instances?
blog comments powered by Disqus