> For the complete documentation index, see [llms.txt](https://docs.storware.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.storware.eu/backup-and-recovery-71/protecting-applications/applications/mssql.md).

# MSSQL

To create a new application for MSSQL instances backup, go to the tab: **Applications -> Instances**

Then select the **Create** button. The Creating an Application Definition section will be displayed, which needs to be completed.

This is a description of how your script is going to be invoked - you need to specify:

* **Name** - unique name of the application in the Storware Backup & Recovery system
* **Choose Node Config** - select which node should perform the task
* **Backup policy** - specify which backup policy should be used for this application
* **Command execution configuration** - select a prepared template for MSSQL backup

On the **Remote PowerShell access** subtab, complete the following fields:

* **Host** - set the address of the host where the MSSQL instance exists
* **Port** - set the host port

Next, select OS Credentials or create a new one and provide the following information:

* **Name** - unique name of the OS Credentials
* **User** - indicate a user for connecting to the PS
* **Password** - enter the connection password
* **SSH key path** - alternatively you can specify the ssh key path for authorization

After **saving** the changes to the application, you need to configure the **environment variables** in the **settings section** of your application as needed.

When using the built-in script for database backup, define:

* **VP\_MSSQL\_DBPASSWORD** - password to database user
* **VP\_MSSQL\_USER** - login username to MSSQL db
* **VP\_MSSQL\_DBNAME** - cmma separated list of database names to backup
* **VP\_MSSQL\_STOREPATH** - path on MSSQL server, where Storware Backup & Recovery can place the temporary backup file (no other files should be stored in the given path since everyting is removed after the backup is finished)
* **VP\_MSSQL\_COMPRESSION** - if backup should be compressed on MSSQL server, then please type "Yes"

{% hint style="info" %}
**Note:** After the new application is fully configured, **save** the changes and go to the [Backup SLAs](/backup-and-recovery-71/administration/applications/backup-slas.md) configuration.
{% endhint %}

**Note:** It is required to open port 5986 and 15702 in the firewall on the MSSQL host side. Start and enable use of WinRM, enable Basic authorization and add Storware Backup & Recovery Node to the list of trusted hosts.

For Storware Backup & Recovery Node it is required in the firewall to open port 15702.

You can always use prepared scripts that perform the above-mentioned actions:

* scripts/winrm\_firewall\_node.sh - execute the file on Storware Backup & Recovery Node
* scripts/winrm\_firewall\_windows.ps1 - copy from node to target host from MSSQL instance and execute
* scripts/winrm.ps1 - copy from node to target host from MSSQL instance and execute
