Skip to main content

KAPPA-Automate IT Infrastructure

Shadowing and Migration from KAPPA-Server to KAPPA-Automate

Once KAPPA-Automate has been successfully installed, the process of shadowing and migrating production data from KAPPA-Server can begin. This approach is designed to keep operations running smoothly while the transition from KAPPA-Server to KAPPA-Automate takes place, ensuring that the integrity of the data remains intact and accessible throughout. The shadowing and migration are broken down into three distinct steps, each with a clear focus and purpose. Breaking the process into these steps makes it easier to validate progress at each step, helps reduce risk, and provides a clear, manageable path for moving production workloads. Details of each phase are outlined below.

  • Step 1 - Shadowing

    The first step is shadowing which imports the structure of your KAPPA-Server into KAPPA-Automate field by field. The purpose of this is to replicate your organization's current production data and structure so that you do not need to create any items from scratch. KAPPA-Server can also be used as a historian for your KAPPA-Automate so that the data is updated in parallel to when it is updated in KAPPA-Server.

    Shadowing defines the process of replicating data only for the mirrors (gauges and direct datasets) in the context of an evaluation, whilst other time series such as filters and derived channels are recomputed. Migration prepares for a production transition and replicates all existing time series.

    For the purposes of shadowing, your organization’s IT Support must have access to the server hosting KAPPA-Server as well as the username and password used to run the KAPPA-Server service.  

    The KSApi Extension must also be configured for KAPPA-Automate to communicate with KAPPA-Server

  • Step 2 - Migration (Datasource Caching)

    The second step moves to migration and involves building a cache of all the connections between KAPPA-Server and its connected historians to convert them into connections between KAPPA-Automate and the historians.

  • Step 3 - Migration (Tag Remapping)

    The third and final step is to remap all of the tags which have been shadowed to KAPPA-Automate to point to the KAPPA-Automate historians which should by now be connected.

KAPPA-Server Shadowing Services Installation

Prerequisites

  • Registered username and password for https://www.kappaeng.com

  • Local Administrator access to the server hosting your organizations KAPPA-Server

  • Access to the username and password of the account used to run the KAPPA-Server service

Note

If you wish to configure the KSApi to use HTTPS then please refer to HTTPS Configuration of KSApi

In order to proceed with the shadowing and migration from KAPPA-Server to KAPPA-Automate, it is required that two new services be installed and deployed onto the server hosting KAPPA-Server in order to extend the KSApi's capabilities.

The below steps will highlight how to download, install and configure the services correctly.

  1. Download the KS Shadowing Services package from the KAPPA website https://www.kappaeng.com/downloads/ka

  2. Right click the zip folder, navigate to Properties and ensure that the downloaded folder is not blocked. If it is, please select the Unblock checkbox and then click Apply and OK.

    Point_2_-_KS_Services_-_Unblock.png
  3. Place the package onto the server hosting KAPPA-Server and extract it.

  4. Rename the extracted folder to KAShadowingServices.

  5. Copy the 'KAShadowing Services' folder into the folder which contains the KAPPA-Server installation (the default path is C:\Program Files\KAPPA\KServer).

  6. Copy the 'KS.App.ConfigurationManager.dll.config' file from the KServer folder into the KAShadowingServices folder and replace it.

    This step is to ensure you are obtaining the configuration parameters of the current KAPPA-Server installation.

  7. On the server hosting KAPPA-Server, launch Command Prompt as an Administrator.

  8. Browse to the folder 'KAShadowingServices' (for example cd C:\Program Files\KAPPA\KServer\KAShadowingServices ) and run the following commands respectively:

    KServerDataService.exe -i

    KServerExportService.exe -i

    Step7_without_red_borders.png
  9. Once the KAPPA-Server Data and KAPPA-Server Export services have been installed, you will now need to configure their respective configuration files in order for the services to point to the location of the KAPPA-Server BLI files. The examples below show the default location of the KAPPA-Server BLI files.

    You will need to make the change of the file locations under the follwing parameter; <setting name="ServerRootFolder" serializeAs="String">

    1. KServerDataService.exe.config (the default path is C:\Program Files\KAPPA\KServer\KSShadowingServices)

      KServerDataServiceBLIFiles_exe_config.png
    2. KServerExportService.exe.config (the default path is C:\Program Files\KAPPA\KServer\KSShadowingServices)

      KServerExportServiceBLIFiles_exe_config.png
  10. After the configuration of the files, open Windows Services and search for the 'KAPPA-Server Data' service, right click it and select Properties.

  11. Navigate to the Log On tab, enter the username and password for the service account used to run the KAPPA Server service and then press Apply and OK.

    KAPPA_Server_Data__Windows_Services_.png
  12. Search for the 'KAPPA-Server Export' service, right click it and select Properties.

  13. Navigate to the Log On tab, enter the username and password for the service account used to run the KAPPA-Server service and then press Apply and OK.

    KAPPA_Server_Export__Windows_Services_.png
  14. You can now right click each of the services respectively and click Start to start both the 'KAPPA-Server Data' service and the 'KAPPA-Server Export' service.

  15. Whilst still in windows services, you can now search for the 'KAPPA-Server' service, right click it and select Restart.

  16. All three services should now be running.

    Final_Window_Services_screenshot_for_Installing.png

Testing Shadowing Services

In order to test that the KAPPA Data Server service and KAPPA Export Server service have been properly installed, you will need to open a web browser and browse to the following URLs;

http://yourKAPPAServerName:8088/KSApi/DataServer/Help

KAPPA_Server_Data__KSApi_.png

http://yourKAPPAServerName:8088/KSApi/ExportServer/Help

KAPPA_Server_Export__KSApi_.png

If you have configured the KSApi to use HTTPS then you will need to browse to the following URLs;

https://yourKAPPAServerName:8088/KSApi/DataServer/Help

https://yourKAPPAServerName:8088/KSApi/ExportServer/Help

HTTPS Configuration for KSApi (Recommended)

Prerequisites

  • HTTPS certificate for the server hosting KAPPA-Server

  • Local Administrator access to the server hosting KAPPA-Server

  • Access to the username and password of the account used to run the KAPPA Server service

In order to configure the KSApi to use HTTPS please follow the below steps;

  1. Obtaining Certificate Thumbprint

    1. On the server hosting KAPPA-Server, launch command prompt and run the following command to:

      Open the certificates panel: certlm.msc

      CMD_Certificates_without_red_borders.png
    2. Double click your certificate.

      Certificate.png
    3. Select the Details tab and copy the certificate thumbprint.

      Certificate_Thumbprint.png
  2. Registering KSApi HTTPS URL

    On the server hosting KAPPA-Server, launch command prompt and run the following commands to;

    1. Remove the previous registration: netsh http delete urlacl url=http://+:8088/OpenServer

    2. Register the certificate: netsh http add sslcert ipport=0.0.0.0:**8088 or your specified port** certhash="yourCertificateThumbprint" appid="{0afa133a-c65a-4019-b661-7ecb604c620a}"

    3. Add the new registration: netsh http add urlacl url=https://+:**8088 or your specified port**/KSApi user="domain\username"

  3. Activating HTTPS

    The following changes will need to be made in the following configuration files on the server hosting KAPPA-Server;

    1. KServerAsService.exe.config (Default location: C:\Program Files\KAPPA\KServer)

      As shown in the below examples;

      • Comment out lines 1155 using '<!-- ' at the start and 1164 using '-->' at the end.

      • Uncomment lines 1175 removing '<!-- ' at the start and 1184 removing '-->' at the end.

      • As shown below, enter port **8088 or your specified port** on line 1181.

      • Comment line 1210 using '<!-- ' at the start and ' -->' at the end.

      • Uncomment line 1212 removing '<!-- ' at the start and ' -->' at the end.

      • Save the configuration file.

      KServerAsService_exe_config_1.png
      KServerAsService_exe_config_2.png
    2. KServerDataService.exe.config (Default location: C:\Program Files\KAPPA\KServer\KSShadowingServices)

      As shown in the below example;

      • Comment lines 107 using '<!-- ' at the start and ' -->' at the end.

      • Uncomment line 109 removing '<!-- ' at the start and ' -->' at the end.

      • Save the configuration file.

      KServerDataService_exe_config.png
    3. KServerExportService.exe.config (Default location: C:\Program Files\KAPPA\KServer\KSShadowingServices)

      As shown in the below example;

      • Comment lines 82 using '<!-- ' at the start and ' -->' at the end.

      • Uncomment line 84 removing '<-- ' at the start and ' -->' at the end.

      • Save the configuration file.

      KServerExportService_exe_config.png

Step 1 - Shadowing

Prerequisites

  • Registered username and password for https://www.kappaeng.com

  • Access to your organizations KAPPA-Server

  • Access to your organizations KAPPA-Automate

  • Access to the username and password of the account used to run the KAPPA Server service

In order to proceed with the shadowing from KAPPA-Server to KAPPA-Automate, it is required that the Shadowing Tool be downloaded and configured appropriately onto a machine which is able to communicate with both KAPPA-Server and KAPPA-Automate.

  1. Download the Shadowing Tool package from the KAPPA website https://www.kappaeng.com/downloads/ka

  2. Right click the zip folder, navigate to Properties and ensure that the downloaded folder is not blocked. If it is, please select the Unblock checkbox and then click Apply and OK.

    Point_2_-_KA_Shadowing_Tool_-_Unblock.png
  3. Extract the Shadowing Tool folder.

  4. Launch command prompt and browse to the extracted Shadowing Tool folder.

  5. Run the following command to initiate the KA Shadowing Tool:

    KAShadowingTool.exe

    Note

    Once the KAShadowingTool.exe is run, it may install some prerequisites. For example .NET Framework. However, it may run through if the prerequisites are already present.

  6. Run the KAShadowingTool.exe again if prerequisites are installed to ensure nothing is pending.

    Point_7_-_KAShadowingTookl_exe.png
  7. Open the extracted folder, locate the config.json file and open it with Notepad or Notepad++ (Preferable option).

  8. You will need to amend the config.json file with the configuration of your KAPPA-Server and KAPPA-Automate. Below is the sample of the config.json file with the elements that require amending (in bold);

    "KS_ServerName": "FQDN of your KAPPA-Server",
    "KS_ApiName": "KSApi",
    "KS_ExportPort": "Port configured during the installation of the Shadowing services", (for example, default 8088 or your specified port)
    "KS_ExportSecured": true,
    "KS_DataPort": "Port configured during the installation of the Shadowing services", (for example, default 8088 or your specified port)
    "KS_DataSecured": true,
    
    "externalServices": [	
        {	  
            "name": "Field",	  
            "url": "https://KAPPA-Automate Address/KSApi/generic/field/"	
        },	
        {	  
            "name": "ExternalData",	  
            "url": "https://KAPPA-Automate Address/KSApi/generic/externaldata/"	
        },	
        {	  
            "name": "Filtering",	  
            "url": "https://KAPPA-Automate Address/KSApi/generic/filtering/"	
        },	
        {	  
            "name": "Data",	  
            "url": "https://KAPPA-Automate Address/KSApi/generic/data/"	
        },	
        {	  
            "name": "Automation",	  
            "url": "https://KAPPA-Automate Address/KSApi/generic/automation/"	
        },	
        {	  
            "name": "Processing",	  
            "url": "https://KAPPA-Automate Address/KSApi/generic/processing/"	
        },	
        {	  
            "name": "EventStore",	  
            "url": "https://KAPPA-Automate Address/KSApi/generic/eventstore/"	
        },	
        {	  
            "name": "Authorization",	  
            "url": "https://KAPPA-Automate Address/oauth2/"	
        }  
    ]
  9. Save the file once you have made the appropriate amendments.

    Warning

    For the next three steps, please ensure that you have access to the username and password for the KAPPA-Server service account as you will be prompted to enter these details.

  10. Launch command prompt and browse to the folder extracted Shadowing Tool folder.

  11. Run the following command to extract the list of fields from your KAPPA-Server.

    KAShadowingTool.exe -l

    Note

    This command will provide you with the Name and Unique ID of the Fields within your KAPPA-Server. The Unique ID is required for step 12.

  12. Run the following command to initiate the shadowing of your selected field from KAPPA-Server to KAPPA-Automate.

    KAShadowingTool.exe -f "Unique ID of field" --step 1

    Note

    This command will initiate the shadowing from the field you have entered the Unique ID for.

    Once the shadowing process has begun, you can verify from your KAPPA-Automate if the data is successfully being shadowed from your KAPPA-Server.

  13. You can now change the Unique ID for the next field to perform Step 1.

Step 2 - Migration (Datasource Caching)

Once you have shadowed all your fields from KAPPA-Server to KAPPA-Automate and appropriate testing has been carried out, you can then proceed to Step 2 of the Shadowing and Migration process.

  1. Open the extracted KA Shadowing Tool folder (from Step 1), locate the configDatasources.sample.json file and open it with Notepad or Notepad++ (Preferable option).

  2. You will need to amend the configDatasources.sample.json file with the relevant datasources from your KAPPA-Server and also the relevant datasources in KAPPA-Automate (which should of been added already at this stage). Below is the sample of the configDatasources.sample.json file with the elements that require amending (in bold)

    {  
        "DataSourceMapping": [    
            {      
                "ksName": "Friendly name of Datasource in your KAPPA-Server",      
                "kaName": "Friendly name of Datasource in your KAPPA-Automate",      
                "EnableCache": "true",      
                "UseCacheIfExist": "true",      
                "UseRequest": "false"    
            },  
        ]
    }

    Note

    You can discard any entries from the sample file which are not used but you will need to ensure you keep the start and end syntax intact.

  3. Save the file once you have made the appropriate amendments and then rename it to configDatasources.json, removing the .sample.

  4. Launch command prompt and browse to the folder extracted Shadowing Tool folder.

  5. Run the following command to extract the list of fields from your KAPPA-Server.

    KAShadowingTool.exe -l

    Note

    This command will provide you with the Name and Unique ID of the Fields within your KAPPA-Server. The Unique ID is required for step 6.

  6. Run the following command to initiate the generation of the datasource cache file of your selected field from KAPPA-Server.

    KAShadowingTool.exe -f "Unique ID of field" --step 2

    Note

    This command will initiate the generation of the cache file for the field you have entered the Unique ID for.

    Once you have completed the first field, the cache file will then continue to grow with the rest of the fields you perform Step 2 on.

  7. You can now change the Unique ID for the next field to perform Step 2.

Step 3 - Migration (Tag Remapping)

Once you have cached your Datasources in Step 2, you can then proceed to Step 3 of the Shadowing and Migration process.

  1. Launch command prompt and browse to the folder extracted Shadowing Tool folder.

  2. Run the following command to extract the list of fields from your KAPPA-Server.

    KAShadowingTool.exe -l

    Note

    This command will provide you with the Name and Unique ID of the Fields within your KAPPA-Server. The Unique ID is required for step 3.

  3. Run the following command to initiate the tag remapping for the selected field from KAPPA-Server.

    KAShadowingTool.exe -f "Unique ID of field" --step 3

    Note

    This command will initiate the tag remapping for the field you have entered the Unique ID for.

    Once you have completed the first field, you can then change the Unique ID for the next field if applicable.

  4. You can now change the Unique ID for the next field to perform Step 3.