> For the complete documentation index, see [llms.txt](https://helpcenter.xopero.com/xopero-one-en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://helpcenter.xopero.com/xopero-one-en/backup-and-recovery/workstations-and-servers/database-backup-recovery/restoring-microsoft-sql-database.md).

# Restoring Microsoft SQL database

#### Microsoft SQL database can be restored to its original location or to a new temporary directory.

***

## How to restore Microsoft SQL database from backup

The first step in restoring a **Microsoft SQL** database from backup is to restore the database files from storage to a temporary directory. These files will then be imported into the **Microsoft SQL** database environment.

To restore files backed up using a file-level backup plan follow [this guide](/xopero-one-en/backup-and-recovery/workstations-and-servers/file-level-backup-recovery.md). If your database was backed up using an **image-level backup**, use granular recovery to restore it as described in [this article](/xopero-one-en/backup-and-recovery/workstations-and-servers/image-level-backup-recovery/granular-recovery.md).

{% hint style="warning" %}
**Xopero** recommends restoring the database files to their original directory to avoid potential permission issues in a different location.
{% endhint %}

Once the database files are restored, the next step is to import them into the **Microsoft SQL** environment.

{% stepper %}
{% step %}
Open the **Microsoft SQL Management Studio**.
{% endstep %}

{% step %}
Log in to the directory tree, right-click **Databases**, and select the **Restore Database** option.

<figure><img src="/files/xmZNFTW5DmZheRAaDReM" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
In the opened window, select **Device** as the backup source and provide the path to the folder containing the **\*.bak** database dump file.

<figure><img src="/files/YKOIoXc8U9tTRvafgBzF" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
After selecting the **\*.bak** file, click **OK**.

<figure><img src="/files/j6YQanoex8NLCzsYXWmp" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
The database has been successfully restored and is now listed in the directory tree.
{% endstep %}
{% endstepper %}
