Casbay Knowledge Base

Search our articles or browse by category below

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

Last modified: May 12, 2021
You are here:
Estimated reading time: 1 min

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

Backing up your SQL Server databases constantly is a good practice for any database administrator to avoid data loss or corruption. Backing up is the safest way to protect and restore your data from many failures like hardware failure, user failures, media errors and many more.

Moreover, a database backup is also ideal for day-to-day administrative tasks such as, database mirroring and copying a database from one server to another.

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 TasksBack 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 TasksRestoreDatabase

  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.

Check out the next article on How can I access MS SQL 2000?

Was this article helpful?
Dislike 0
Views: 6