triz-docs/docs/database-operations/sql-server-backup-restore/restoring.md
2026-04-29 11:32:42 +01:00

3.3 KiB
Raw Permalink Blame History

sidebar_position title
3 Restoring a Database

Restoring a Database


WARNING: Restoring a database replaces its current contents. Always confirm you are targeting the correct server and database before proceeding. Close any active connections to the target database beforehand.


Restore from a Full Backup

  1. In Object Explorer, right-click the Databases node (not a specific database) and select Restore Database…

SSMS Restore Menu

  1. The Restore Database window opens on the General page. Under Source, select Device, then click the … (Browse) button.

Restore Source Device

  1. In the Select backup devices dialog, click Add.

Add Backup Device

  1. Navigate to your .bak file, select it, and click OK. Then click OK again to close the dialog.

Select BAK File

  1. The backup details will populate in the Backup sets to restore grid. Verify that the correct backup is checked.
  2. Under Destination, confirm the database name in the Database field. You can type a new name here to restore as a different database.

Verify Restore Sets

  1. Go to the Options page (left-hand panel). Check Close existing connections to the destination database to avoid connection conflicts during restore.
  2. Click OK to begin.

Restore Options

  1. A confirmation message will appear on success.

Restore Success


Restore from a Full + Differential Backup

  1. Follow steps 14 above, but when adding backup devices, add both the full backup file and the differential backup file.

Add Multiple Backup Devices

  1. SSMS will automatically detect the backup types and display them in the correct order in the Backup sets to restore grid.
  2. Make sure both the full and differential entries are checked.

Multiple Restore Sets

  1. Go to Options, check Close existing connections to the destination database.
  2. Click OK to restore.

Point-in-Time Recovery (Transaction Logs)

  1. Follow steps 14 above, adding the full backup file and all transaction log (.trn) files in the Select backup devices dialog.

Add Log Files

  1. SSMS will list all backup sets in the correct sequence in the grid. Verify all needed entries are checked.
  2. To restore to a specific point in time, click the Timeline… button at the top of the General page. In the Backup Timeline dialog, drag the slider or type a specific date and time, then click OK.

Restore Timeline

  1. Go to Options, check Close existing connections to the destination database.
  2. Click OK to run the restore.

Restoring to a Different Server or Name

To restore a backup onto a different server, or under a different database name:

  1. Connect SSMS to the target server (not the original one).
  2. Follow the restore steps in the section above.
  3. At step 6, change the Database name field to your desired new name.

Rename Database

  1. Go to the Files page (left-hand panel). You will see the original file paths listed. Check Relocate all files to folder and specify the data and log folders on the target server.

Relocate Files

  1. Click OK to restore.