Here is how you can do this step by step, so let's get started with the backup database
Step 1. First, connect to your database server using SQL Server Management Studio & open it.
Now right-click on your database and under the “Tasks” option, choose “Back Up” as in the following image.
Step 2. Next a new window will open and now we have to configure where to save our database backup file (.bak).
You have to ensure that the “Backup type” is set to “Full” to get full backup. Now highlight the destination file that is already in the list by clicking on it and clicking the “Remove” option.
Step 3. Now click “Add” to specify where to save the backup file. A window will pop up, asking you where to save the backup file.
Enter a location you want. For example, we are saving it to “C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\Backup\medishop.bak.
Step 4. Now click on “Ok” to begin the database backup. If the database is backed up successfully, you should receive a message as in the following image.
After backing up the database, now we need to restore that database somewhere else or wherever you want. Here are the steps to restore it,
To Restore
Step 1. After you connect to the appropriate instance of Microsoft SQL Server Database Engine, in Object Explorer, click the server name to expand the server tree.
Step 2. Right-click the database and point to Restore which opens the Restore Database dialog box.
Step 3. On the General Page, use the Source section to specify the source & location of the backup sets to restore.
- Select Device to manually specify the file or device to restore.
- In the Device option, click the browse (…..) button to open the Select backup devices dialog box.
- In the Backup media type box, select one of the listed device types. To select one or more devices for the Backup media box, click Add.
- After you add the devices, click ok to return to the General page.
Step 4. In the Source: Device: Database list box, select the name of the database that should be restored and click on “Ok”. Then your database will be restored.