How to back up and restore Microsoft SQL Server using Hyper Data Protector and NetBak PC Agent?
Applicable Products
- Hyper Data Protector
- NetBak PC Agent
- Microsoft SQL Server
Prerequisites
To back up and restore your Microsoft SQL Server using the methods outlined in this guide, you need to install Hyper Data Protector (HDP) on your NAS or install NetBak PC Agent on your physical server. Ensure that you install the appropriate application before proceeding.
HDP Installation
- Log in to your NAS as an administrator.
- Open App Center.
- Click
, and then enter "Hyper Data Protector". - Click Install.
NetBak PC Agent Installation
Before installing NetBak PC Agent, ensure that you meet the system requirements. For details, see NetBak PC Agent Quick Start Guide.
- Install HDP following the steps above. NetBak PC Agent requires HDP to be running on your NAS to back up or restore your server.
- Download and install NetBak PC Agent.
Details
This section provides step-by-step instructions on how to back up and restore Microsoft SQL Server using HDP and NetBak PC Agent.
Back up Microsoft SQL Server
Choose the backup method based on your Microsoft SQL Server environment.HDP (for Virtual Machines)
- Add the hypervisor hosting the Microsoft SQL Server to the HDP inventory.
- Create a backup job.
- Configure the backup settings.
- Start the backup job.
For detailed instructions, see Using Hyper Data Protector to Back Up Hypervisors to a QNAP NAS.
NetBak PC Agent (for Physical Servers)
- Create a repository to store your backup data on your NAS.
- Create a backup job.
- Configure the backup settings.
- Start the backup job.
For detailed instructions, see NetBak PC Agent Quick Start Guide.
Restore Your Entire Microsoft SQL Server
Depending on your server environment, you can use HDP to restore your virtual machine to a hypervisor or use NetBak PC Agent to restore your physical server with a USB boot drive.
HDP (for Virtual Machines)
- Create a restore job.
- Select the source to restore.
- Configure the restore settings.
- Start the restore process.
For detailed instructions, see Using Hyper Data Protector to Back Up Hypervisors to a QNAP NAS.
NetBak PC Agent (for Physical Servers)
- Create a USB boot drive.
- Insert the USB boot drive into your server.
- Configure the BIOS boot order.
- Follow the Restore Wizard to restore your server.
For detailed instructions, see the NetBak PC Agent Quick Start Guide.
Restore a Microsoft SQL Database
To restore your Microsoft SQL database to a precise point in time using .mdf and .ldf files, follow the steps below.
- View database file paths.
- Open Microsoft SQL Server Management Studio (SSMS).
- Complete the fields in the Connect to Server dialog box if it appears. For instructions, see this tutorial.
If SSMS automatically connects to your desired server, proceed to the next step. Otherwise, go to Object Explorer > Connect > Database Engine to connect manually. - In the Object Explorer pane, expand Databases.
- Right-click the database you want to restore.
- Click Properties.
The Database Properties dialog box appears. - Click Files on the left panel to view file paths.

- Download database files.
- Open Backup Explorer in HDP.
- Select the database version you want to restore.
- Locate and download the
.mdfand.ldffiles to the desired restore destination.
For detailed instructions, see How do I restore files to my Windows PC or server with HDP Backup Explorer?.
- Configure file permissions.
- Open Command Prompt as Administrator.
- Run the following command twice, once for the
.mdffile and once for the.ldffile.icacls File_Path /grant MSSQLSERVER:(F)- First, replace
File_Pathwith the.mdffile path obtained in the "View database file paths" section. - Then, replace
File_Pathwith the.ldffile path obtained in the "View database file paths" section.
- First, replace
- Attach the database.
- Run the following command to open the SQL command-line interface.
sqlcmd -S localhost - Run the following SQL.
USE [master] GO CREATE DATABASE [Database_Name] ON ( FILENAME = N'Disk:\Path\File_Name.mdf' ), ( FILENAME = N'Disk:\Path\File_Name.ldf' ) FOR ATTACH GO - Replace the following placeholders.
[Database_Name]with your database name.Disk:\Path\File_Name.mdfwith the.mdffile path obtained in the "View database file paths" section.Disk:\Path\File_Name.ldfwith the.ldffile path obtained in the "View database file paths" section.
- The image below shows the typical output after executing the command.

Once completed, your database will be restored and available for use.
- Run the following command to open the SQL command-line interface.