.. _activate:

Activate 
========

After deploying and starting of the Industrial Data Collector, it needs to be activated with activation code, following steps below.

Initial Activation
-----------------------

1. Obtain activation key.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  * Activation key for ``Community`` and ``Standard`` editions can be obtained via the product web page https://onewayautomation.com/idako/. 

    .. image:: images/idako/get-license-key.png

    * Click on the link for checkout page for desired edition. This will redirect you to the online payment system web page.
     
      .. note:: Although it is called payment system, no credit card is required for free Community Edition.

      .. image:: images/idako/get-license-key-2.png

    * On the online payment system web page, enter your contact information and click on ``Submit`` button. 

      .. image:: images/idako/get-license-key-3.png

    * The system will generate activation code and send it to the e-mail address you provided. From that e-mail you will need activation key, which starts by letters VL:


      .. image:: images/idako/get-license-key-4.png
        :class: with-border

  * For Academic Edition license keys please contact :ref:`support`.
  
  * To get the quote and / or license key for the Enterprise Edition please contact sales@onewayautomation.com.  

2. Activate Industrial Data Collector 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Use web configuration GUI which is by default available at http://localhost:4880. All license related activities can be done via ``License Information`` dialog window, opened by menu ``License/Status``.

  .. note:: You need first login in order to access the menu ``License``. Before starting of the application very first time, default login credentials should be set by using environment variables ``OVL_USER_ID`` and ``OVL_USER_PASSWORD``. If environment variables are not defined, then values ``admin`` / ``password`` will be used. After first login using these credentials, the application will display warning message and will force password change.

  In case if the machine where Industrial Data Collector is running has access to the Internet, activation can be done in online mode. If that machine has no access to the Internet, use offline activation mode. Steps to activate for these 2 cases are described in subsections below.

2.1. Online activation.
""""""""""""""""""""""""""""
 
    Screenshot below shows ``License Information`` dialog window to activate in on-line mode. Note that checkbox ``Activate off-line`` is off. 

    .. image:: images/idako/activate-online.png

..

    * In the e-mail received in the previous step, find activation code (it is started by letters ``VL``) and copy it into clipboard.
    * Paste activation code into the ``Activation Code`` field. After entering the value, call to the backend is made, after that appearance / visibility of GUI controls might change. For example, if the activation key was already used before, label on the button ``Activate`` will change to ``Reactivate``.
    * In the ``Password`` field enter password, which will be used by online License Portal to access your activation code in the future, as well as that password is required to de-activate license and activate in other computer when such transfer is required. 
    * In the next field confirm password.
    * Enter email address, which will be used by online License Portal to restore your password in case if you forgot it.
    * Click on the ``Activate`` button to complete activation. Dialog window will popup asking to accept license terms. 
    * After accepting license terms, Industrial Data Collector will connect to the online licensing server and will be activated in case of success. After completion, notification message will appear displaying result of activation.
    * Refresh web page to display content which was not displayed in non-licensed state.

..

2.2. Offlie activation.
"""""""""""""""""""""""""""""""""
    
    If Industrial Data Collector runs in a host or VM or Docker container that has no access to the Internet, then:

    * Turn on the checkbox ``Activate offline``.    
    * Paste activation code into the ``Activation Code`` field;
    * Click on the ``Activate`` button.
    * In the popup dialog window accept licensing terms.
    * In case of success, intermediate offline activation file ``ogamma-logger.lic`` will be created by the backend, and become available to download by link ``Download offline activation file``. Download it.

..

    .. image:: images/idako/activate-offline.png

..

    * In the host that has access to the Internet, in a web browser open offline activation portal by the link ``https://www.softworkz.com/offline/offline.aspx``

    * Upload the file with extension ``.lic`` that was downloaded in the previous step. If the host where web-browser is running does not have access to the Internet, you need to copy it from the host where it was downloaded to.

..

      .. image:: images/idako/activate-offline-page.png
        :class: with-border

..

    * Enter new password and email.
    * Cick on the ``Activate`` button.

      .. image:: images/idako/activate-offline-page-2.png
        :class: with-border

..

    * Download generated license file ``ogamma-logger.cdm``.  

      .. image:: images/idako/activate-offline-page-3.png
        :class: with-border

..
..

    * Return to the ``License Status`` dialog window of the Industrial Data Collector.
    * By clicking on the button ``Select offline license activation file`` select file ``ogamma-logger.cdm`` and upload it by clicking on the button ``Upload``.

      .. image:: images/idako/activate-offline-end.png

    * The license activation file will be uploaded, and dialog window will show current status as licensed.

      .. image:: images/idako/licensed-status.png

..

    .. note:: License file `ogamma-logger.cdm` is expected to be located always in the  folder ``./data/[InstanceId]/`` (relative to the work directory) where ``[InstanceId]`` is unique identifier of the applicaion instance. The folder is created at the very first startup of the application. If you change location of the application installation folder or work directory, make sure to move license file accordingly too.

..

.. note:: To manage your licenses, you can login to the License Portal, which is accessible via `License/My License Portal` menu.

.. _uploadamul:

Upload Annual Maintenance and Upgrades License
------------------------------------------------------

Starting from version 2.2.0 valid ``Annual Maintenance and Upgrades License`` (AMUL) is required. Note that the original license includes AMUL for one year period. For details about this license please refer to this section:  :ref:`amul`

After obtaining the AMU license file from the vendor, to install it, open the dialog window by menu command ``License / Status``, and click on the button ``Upload AMU License file``. A new dialog window will be opened. Select the license file from the filesystem, and click on the button ``Upload``. 

To view the current status of the AMU License, open the ``License Information`` dialog window by menu command ``License / Status``. The current status of the AMU License and its expiration date will be displayed in the section ``Annual Maintenance and Upgrades License``.

One or more AMU license files can be uploaded. Also, if the same file is uploaded by mistake multiple times, that does not cause a problem. After uploading the AMUL file neither restart nor connection to the Internet is required to apply it. 

.. note:: AMU licenses are associated with the original license. You can figure out what the original license the AMU License file is associated with by its file name. The format of the file name is ``amu-XXXX-YYYYYYYYYYYYYYYY.lic``, where ``XXXX`` is the last 4 letters of the original license activation code.

.. image:: images/idako/amul.png

..
				
Reactivate.
---------------------

If you need to move the instance of Industrial Data Collector to another machine, that instance can be de-activated. The password which was used at the activation stage will be required.

To re-activate instance in another machine, repeat activation steps on that machine. In case if it fails with error message saying that re-activation is expected, button Re-activate will be enabled and after entering of **old password** and **new password** fields, re-activation should succeed. That is, during re-activation the password is changed to the new one.

Upgrade with a key for different edition.
---------------------------------------------------

In order to upgrade existing Community Edition license to commercial product edition:

* Deactivate existing license.
 
  * Via menu ``License/Status``, open the ``License Information`` dialog window.
  * Click on the button ``Deactivate``.

  .. note :: For de-activation it will ask you to enter the old password used at the activation. If you do not remember that password:

    * Copy existing license key into clipboard (from the ``License Information`` dialog window).
    * Close that window, open Licensing portal (via menu ``License / My license Portal``).
    *	In the ``Manage License Info / License Code`` field paste license key from clipboard.
    *	Click on the ``Recover Password`` button.
    
    An email will be sent to your address with your password.

* Activate with the new license key.

  This is done the same way as original activation.