> 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-trending/install.md).

# Install and license DATRAN Trending

Install DATRAN Trending, connect it to the DATRAN database, and enter the licence key for the PC.

To set up DATRAN Trending on a PC, install it with administrator rights, connect it to the SQL Server that holds the DATRAN database, and enter a licence key for that PC. Please forward this page to your IT team as System Administrator privileges are required for the installation.

{% hint style="info" %}
**Applies to:** DATRAN Trending V5.04 and later. Earlier versions store the licence key and database connection string in the local user instead of the local machine registry: see [The licence won't stick or Enter License is greyed out](https://help.qtech.co.nz/datran/datran-vi-scada/datran-trending/troubleshooting/licence-will-not-stick.md).
{% endhint %}

## Before you start

* The latest installation software can be downloaded directly from our website in the members area. To install DATRAN Trending, simply run `DATRAN_Trending_vxxx_Setup.exe`. DATRAN Trending is provided to all current software maintenance agreement (SMA) holders.
* Make sure .NET Framework 2.0 to 3.5 is turned on in **Windows Features**.
* You will need to enter the SQL server name and authentication method for the SQL Server that contains the DATRAN Database.
* Please ensure that all DATRAN programs are stopped. It is also recommended that you close all other applications running on the target machine.

## Install

1. The installation must be performed by someone with administrative (domain) privileges.
2. This is the Welcome screen, click **Next**.
3. Please read all of the terms and conditions and if you agree click **I accept the agreement** and then click **Next**.
4. Click **Next** to accept the default (recommended) location.
5. To create a shortcut in the default location (recommended) click **Next**.
6. To create a desktop icon check the box and click **Next**.
7. To start installation click **Next**. For the installation to be complete click **Finish**.

This is a full installation and not a patch. Therefore, there are no minimum versions of DATRAN Trending as a prerequisite. The installation needs to be performed on every machine that uses DATRAN Trending, including Terminal Servers if used. No rebooting of the DATRAN Server or the user's machine is required after the installation.

## Connect to the DATRAN database

The very first time that DATRAN Trending is run from your computer it will ask you for the connection details to your DATRAN database. This connection information can also be changed at any time from the **Database > Switch Database** menu item, which opens the Data Link Properties dialog box.

1. On the **Provider** tab, select **Microsoft OLE DB Provider for SQL Server**, and click **Next**.
2. On the **Connection** tab, ensure that the server name is set to the SQL Server computer where your DATRAN database resides. The alternative is to use the IP address of the SQL Server computer and the port number of the SQL Server instance. Each SQL Server instance should have its own port number. Do not type in the IP address together with the SQL Server instance.
3. Choose either **Use Windows NT Integrated security** or **Use a specific user name and password**. Note that the former is the preferred method of authentication.
4. Ensure that DATRANdatabase is selected under **Select the database on the server** (if DATRANdatabase is the name of your database).
5. Click on the **Test Connection** button to ensure that it will connect properly. To end, click **OK** two times.

Check your spelling, especially the name of the SQL server and database name. Where possible, choose these values from the drop down combo boxes.

After entering your specific connection details and clicking OK, it will ask you to set up the very first plot if no plot is available in the DATRAN database. See [Create a plot](https://help.qtech.co.nz/datran/datran-vi-scada/datran-trending/plots.md#create-a-plot).

{% hint style="warning" %}
When a new version of Trending is run for the first time, it will automatically try to update the database if necessary to add/remove columns from the database tables and stored procedures. Check that you have run Trending 5 at least once using a Windows or SQL user that has administrative access over the DATRAN database. See [Trending won't start or says it isn't a valid DATRAN database](https://help.qtech.co.nz/datran/datran-vi-scada/datran-trending/troubleshooting/not-a-valid-database.md).
{% endhint %}

## Enter the licence key

DATRAN Trending is a licensed software application and the licensing is tied to the machine it is installed on.

1. Right click "Run as Administrator" on Trending when attempting to install the license.
2. Go to **Help > Enter License**. You will need to provide the product serial number as displayed in the dialog box. The PC HDD serial number is an 8 digit hexadecimal number.
3. QTech needs the PC Name and the HDD serial number. To get the serial number before installing, click the start/windows icon, type "cmd", click cmd.exe and type "vol" then enter. If there are multiple drives on the machine, we need the "vol" of the one where Trending will be installed, e.g. vol C:.
4. Once the License Key is supplied, simply enter it in the text box and click **OK**.
5. The license is saved into the computer registry when you close DATRAN Trending, so it is advisable to do so immediately after entering the license, and then to open DATRAN Trending again to verify the license has been applied correctly.

The licence key and database connection string are now stored in the local machine registry instead of the local user. Configuration is now done once and not for every user. A message is now displayed if the user enters a licence key without admin privileges.

For more licences, or to move a licence to a new PC, contact QTech. Licences for client programs are covered in [Licensing](https://help.qtech.co.nz/datran/datran-vi-scada/datran-vi/licensing.md).

## Upgrade from V5.01 or earlier

The structure of the database has changed between v5.01 and v5.03. When you first run Trending after installing v5.03 you may see an error message displayed.

1. If **Force Version Update** is greyed out, first ensure that Trending is in Expert Mode. This can be selected from the **View** menu.
2. To update the database you will need to select **Force Version Update** from the **Database** menu, and confirm.
3. Restart Trending.

If for some reason a newer version of Trending has been run and made changes to the database, and you need to return to a prior version of Trending that isn't compatible with the changed database stored procedures, you can force a database upgrade to be run using Force Version Update.

V5.05 coexists with installations of Trending v5.02 or later. This version does not coexist with installation of Trending v5.01 or earlier. Any remaining installations of v5.01 or earlier must be upgraded if sharing the same database. Running a version of Trending v5.01 or earlier at the same time as a copy of v5.03 Trending is running will cause error messages to be displayed by the version of Trending that was started first. If you continue with the changes to the database, having other users sharing the database and running later versions of Trending will have the effect of undoing your version update when they next start their version of Trending.
