Wesbytes Knowledge Base

Search our articles or browse by category below

How can I back up my website and MS SQL database?

Last modified: July 2, 2022
You are here:
Estimated reading time: 1 min

How can I back up my website and MS SQL database?

Any database administrator who wants to prevent data loss or corruption should regularly backup their SQL Server databases. The safest way to safeguard and recover your data from several problems, including hardware failure, user failures, media mistakes, and many more, is to create a backup.

A database backup is also perfect for routine administration activities like database mirroring and copying databases between servers.

MSSQL is the most widely used database management system for Windows-based systems powered by Microsoft. It is used to store website data such as blog and user information.

In this guide, we will show you how to backup and restore the MSSQL database on Windows operating system.

Prerequisites

  • A server running on Windows server 2016.
  • SQL Server and SQL Server Management Studio (SSMS) installed in your system.

Backup MS SQL Database

You may download all your websites via FTP to your local PC.

However, to access the MS SQL server, we will send you the configurations for MS SQL upon request and you will be able to remotely access the server and perform a backup.

Create New Database

  1. Firstly, open SSMS from the Start menu.

  2. Secondly, click on Connect button to connect your MS SQL Server.

  3. Then, click on New Query to open a new query window.

  4. Type the following query in the above query window to create a new database named NEWDB and create a new table named TABLE1:
    USE [master]
    GO
    CREATE DATABASE [NEWDB]
    GO
    USE [NEWDB]
    GO
    CREATE TABLE TABLE1 (
    ID INT NOT NULL PRIMARY KEY,
    a1 VARCHAR(100) NOT NULL,
    dt1 DATETIME NOT NULL DEFAULT getdate()
    )
    GO
  5. Next, click on the Execute button to run the query. 

Take Backup with SSMS

  1. Firstly, open up SSMS and expand Databases section.

  2. Secondly, right-click on the NEWDB and click on the Tasks > Back Up.

  3. Select all required information like, Database, Backup type, Backup path then click OK.

  4. Lastly, you get the confirmation message The backup of database “DBTEST” completed successfully if the backup is successful.

Restore MS SQL Backup

  1. Firstly, open SSMS.

  2. Then, right-click on the NEWDB and click on Tasks > Restore > Database

  3. Next, select Device and click on the ““.

  4. Click on the Add button.

  5. After that, select your database backup file and click OK.

  6. Click on the OK button again to close the “Select backup devices window”. 

  7. Lastly, click on the OK button to restore the backup of your database.
Was this article helpful?
Dislike 0
Views: 8