1. To back up a database on a Microsoft SQL Server, you can use SQL Server Management Studio (SSMS):
- Open SSMS and connect to your SQL Server instance.
- Expand the Databases node in the Object Explorer.
- Right-click the database you want to back up, and then click Tasks > Back Up.
- In the Back Up Database window, choose the following options:
Backup Type: Select Full
Destination: Make sure to remove the existing filename (if any). Click Add to specify the location and file name for the backup. And then enter a new name for a backup. - Click OK to start the backup.
2. To restore a database using SQL Server Management Studio (SSMS), follow these steps:
- Open SSMS and Connect to the SQL Server Instance
- In the Object Explorer on the left side, Right-click the database you want to back up, and then click Tasks > Restore> Database.
- Choose the Restore Source
In the Restore Database window, under the Source section, select Device (which allows you to restore from a backup file).
Click the Browse button (the ellipsis button …) next to the Device option. - Select the Backup File
In the Select Backup Devices window, click Add.
Browse to the location of the .bak file that contains your backup.
Select the backup file and click OK to return to the Restore Database window. - Select the Database to Restore
In the Destination section of the Restore Database window, select the database you want to restore. - Choose the Restore Options
Under the Backup Sets to Restore section, ensure the box next to the appropriate backup set is checked.
Restore As: This should show the correct path where the data files will be restored.
If you are overwriting an existing database, ensure that the Overwrite the existing database (WITH REPLACE) option is checked. - Start the Restore
Once everything is configured, click OK to start the restore process.
A progress window will appear, and once the restore is complete, a confirmation message will be displayed.