> For the complete documentation index, see [llms.txt](https://help.qtech.co.nz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.qtech.co.nz/datran/datran-vi-scada/datran-database-import-utility/install.md).

# Install and connect the Database Import Utility

Install the DATRAN Database Import Utility and connect it to the DATRAN SQL database.

To set up the Database Import Utility, install it on a PC and connect it to the DATRAN SQL database.

{% hint style="info" %}
**Applies to:** Database Import Utility. It needs Windows 10 or later and .NET Framework 4.8.
{% endhint %}

## Install

1. Download the utility from the QTech website. See [Downloads](https://help.qtech.co.nz/datran/datran-vi-scada/datran-database-import-utility/downloads.md).
2. Before installing it is recommended that you close all applications running on the target machine.
3. Run the installer and review and accept the software licencing agreement to install the product. Follow any on screen instructions.

## Connect to the DATRAN database

Immediately after installation the user is prompted to configure a connection but a connection can also be configured at any time by selecting **Database connection** from the configuration menu.

| Field               | What to enter                                                                                                                                                                                                                                                                                              |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Server              | The computer name or IP Address of where the SQL Database resides, or `localhost`. If you are using SQL Express then the above may need to be postfixed with `\SQLExpress`. If the database is exposed on a specific IP Port then this needs to be specified after a comma, for example `<server>,<port>`. |
| Database            | This is the name of the DATRAN database. By default DATRAN installs this as DatranDatabase.                                                                                                                                                                                                                |
| User name, Password | A valid user account configured within your SQL database. The user account must have rights to add records to the database. Note: Currently Windows Authentication is not supported.                                                                                                                       |

1. Press the **Test** button. This will determine if the information you have entered is correct and allows a successful connection to the database. If the connection is not successful then you will be prompted with the reason for the failure and are then required to make appropriate changes and try again.
2. When a successful connection has been made the **Save** button will become enabled. Pressing this will store the settings for future sessions.

![The Database Import Utility main window](https://3621580088-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa5hMAUl7E1cWeN5Rghg0%2Fuploads%2Fe5aQttrDCNj3ogmQ6SrY%2Fdiu-main-window.png?alt=media)

## The main window

| Part                 | What it does                                                       |
| -------------------- | ------------------------------------------------------------------ |
| Current Map File     | The map file in use, with **Browse**, and **Create** or **Edit**   |
| Import Files         | Imports one RTU log, or one or more CSV files                      |
| Export CSV           | Creates a CSV file of the imported data, for inspection            |
| Upload to SQL Server | Uploads the results directly to the DATRAN Database in SQL Server  |
| Status Report        | The progress of import along with any errors (displayed in red)    |
| Error Log            | Opens the error log, updated during the mapping and import process |

The workflow requires you to: configure the database connection, select the type of import to undertake, create and use a mapping file to match data from the log to database fields, load the log file or files to import, run the importer (import files), export the results to a CSV file for inspection, or upload the results directly to the DATRAN Database in SQL Server. Then check the results using an application such as DATRAN Trending.
