# Microsoft SQL Server Restore

This restore mode allows the restoration of Microsoft SQL Server databases from backups created with DPX. The restore process is designed to be flexible, allowing for the recovery of selected databases to their original location or a new one. With DPX, you can also perform point-in-time restores, leveraging SQL Server's transaction logs to recover databases to a specific moment before an incident occurred.

## Creating a SQL Server Restore Job

1. In the main web interface view, go to **Job Manager** in the sidebar. Then select the **New Restore Job** button.

<figure><img src="https://379745832-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F44DSK1a5lUDd8dUgwDQP%2Fuploads%2FmFyfoigneWm7EA1s6XeU%2Fnew-restore.png?alt=media&#x26;token=e90e9e8c-23ae-495c-9393-e6f0ff79af4f" alt=""><figcaption></figcaption></figure>

2. Select **Application Restore** and Click **Next**.

<figure><img src="https://379745832-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F44DSK1a5lUDd8dUgwDQP%2Fuploads%2F99rfwejBh61oNe1wi45D%2F2024-03-21-11-23-16.png?alt=media&#x26;token=ca92b42d-1901-451b-8682-4968ea1022b5" alt=""><figcaption></figcaption></figure>

3. The Object to Restore view shows all Application nodes that you backed up. The available objects to restore can be sorted by Name, Type, associated Job Name, or the backup Date/Time. Find the Node that contains the SQL Server you want to restore and click **Next**.

{% hint style="info" %}
<mark style="color:blue;">**Tip.**</mark> Restoring a SQL object will include all local volumes referenced by the SQL object, potentially increasing the restore size.
{% endhint %}

4. Choose the appropriate recovery point from the available backups of the selected node.

<figure><img src="https://379745832-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F44DSK1a5lUDd8dUgwDQP%2Fuploads%2FGVUhJRPpN82AVBOK7NUG%2F2024-03-21-11-55-44.png?alt=media&#x26;token=11cc4eb8-2310-45a7-9eda-23338d400a15" alt=""><figcaption></figcaption></figure>

5. In the **File Browsing** step, choose the specific databases you wish to restore. DPX allows for granular selection, enabling you to restore individual databases. Select all databases you want to restore and click **Next**.

<figure><img src="https://379745832-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F44DSK1a5lUDd8dUgwDQP%2Fuploads%2FNyC3OfcJDbe2gK8JkN9Q%2F2024-03-21-11-57-13.png?alt=media&#x26;token=48c3ff93-2053-4b7c-acdd-1ed61c19e135" alt=""><figcaption></figcaption></figure>

6. In the **Options** step, specify the Job Name. The name may be up to 64 characters long and may only contain letters, digits and `-` `_` characters.
7. Specify job options. You can use the following options:

## Basic Job Options

### **Delete the restore job on successful completion**

<table data-header-hidden><thead><tr><th width="123"></th><th></th></tr></thead><tbody><tr><td><strong>Toggle on</strong></td><td>The restore job defined in this process will be deleted upon successful completion. If the job fails, it will not be deleted.</td></tr><tr><td><strong>Toggle off</strong></td><td>The restore job will be saved and will be accessible later in Job Manager.</td></tr></tbody></table>

### **Job e-mail notification**

<table data-header-hidden><thead><tr><th width="122.969696969697"></th><th></th></tr></thead><tbody><tr><td><strong>Toggle on</strong></td><td>The notification is sent as specified below the toggle (additional fields will appear – see below).</td></tr><tr><td><strong>Toggle off</strong></td><td>The notification is sent to the default e-mail address configured in the <a href="../../../../web-interface/configuring-enterprise-information#administrator-e-mail-settings">Administrator E-mail Settings</a> section.</td></tr></tbody></table>

<details>

<summary>E-mail Notification Fields</summary>

#### **Subject**

The subject of your message. The subject line usually contains a combination of straight text and variable elements. Variables, which must begin with `%`, are replaced with actual corresponding values. If you enclose variables in double quotation marks, those variables are treated as literal values. You can embed the following variables:

* `%JOBNAME`
* `%JOBID`
* `%JOBTYPE`
* `%RC`

Use **%RC** to include the return code in the message for this run of the job, when applicable.

#### **To**

The email address of the primary recipient of your message. Only one “To” address is permitted.

#### **Cc**

Carbon Copy. The email address(es) of the secondary recipient(s) of your message. Use a semicolon to delimit multiple email addresses.

#### **Bcc**

Blind Carbon Copy. The email address(es) of the secondary recipient(s) not identified to other recipients. Use a semi-colon to delimit multiple email addresses.

<mark style="color:blue;">**Note.**</mark> Note that the following characters are invalid in all fields: `<` `>` `;` and `'`.

<mark style="color:blue;">**Note.**</mark> DPX emailing must be enabled when you first configure your Enterprise. At that time, you supply general system information, including SMTP Host Name and SMTP Port. See the [Administrator E-mail Settings](../../../../web-interface/configuring-enterprise-information#administrator-e-mail-settings) section.

</details>

## MSSQL Options

### **MSSQL with Replace**

When this option is enabled, DPX will overwrite an existing database without performing the usual SQL Server pre-restore tests. This can be useful when you are certain that the restore should proceed, but it bypasses SQL Server's built-in safety checks, so use it with caution1.

### **MSSQL New Location**

This option allows you to restore the database to a different location than the original. It's essential when the original location is not available or when you want to restore the database for testing purposes.

### **MSSQL New Location Logs**

If you're restoring the database to a new location and want to specify a different location for the transaction logs, use this option. This is particularly useful for separating data files from log files1.

### **MSSQL Point in Time Restore**

This option enables you to restore the database to a specific point in time, using the transaction logs. Ensure that the necessary transaction log backups are available for the point in time you wish to restore to.

{% hint style="info" %}
<mark style="color:blue;">**See also.**</mark> To learn more about other available options, see [Advanced Job Options](../agent-based-file-restore/advanced-job-options).
{% endhint %}

<figure><img src="https://379745832-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F44DSK1a5lUDd8dUgwDQP%2Fuploads%2FH7C6nrAPOrsUU2jqN3zv%2FSQL_Restore.png?alt=media&#x26;token=aee2297f-ae23-42a9-a058-7bb5238ce480" alt=""><figcaption></figcaption></figure>

8. Click **Next**. Review the summary of your job and click **Save**. You will see the **Run Job** prompt.

<figure><img src="https://379745832-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F44DSK1a5lUDd8dUgwDQP%2Fuploads%2F1dGRCfp70ttGZNEiaiLP%2FRestore%20-%20Agent-based%20file%20restore%20-%20Run%20Job%20prompt.png?alt=media&#x26;token=72a02a8d-5609-4640-a635-42f838959e19" alt=""><figcaption></figcaption></figure>

9. Click **Yes** to run the job immediately or **No** if you want to run it later from the Job Manager.
