Device Migration from FAI Pro to FAI Local Server

Device migration is "moving" devices from FAI Pro (cloud-based) to an FAI Local (on-premises) server, so the data collected by the device will be transmitted to, stored on, and accessed from, an on-premises server.

The migration process consists of exporting each device's metadata (such as the Site and device names, descriptions and configurations) from the cloud server, importing the device metadata into the on-premises server and changing the server communication parameters so that each device will send all new stream data to the on-premises server, rather than to the cloud.

The device's firmware is also exported, and then imported into the on-premises server.  

Note:  Data that has been stored on the cloud server is not migrated to the on-premises server as part of the Device Migration process.

Contents

Prerequisites

Migrating New Devices from the Cloud to the On-Premises Server

Step 1: Prepare Site Files

Step 2: Import the FW and Exported Site Metadata into the On-Premises Server Repository

Step 3: Reconfigure MQTT and HTTP Communication for Migrated Devices

 

 

Prerequisites

  • You must know the user credentials in the FAI Pro instance that has the AccountOwner role.
  • You must know the following information about your FAI Local server instance:
    • Server IP address or host name 
    • Server operating system administrator user name and password (SUDO user)
    • The Account ID number with which the devices will be associated on the on-premises server

Note: Accounts into which the new Sites will be imported must already be set up in your FAI Local server. 

  • The  administrator user name and password
  • FTP client to transfer the export file from the client machine to the on-premises server

Migrating New Devices from the Cloud to the On-Premises Server

You will export the Site from the Ayyeka cloud server to a zip file on your computer work station. The contents of the export file depend on the software version of FAI Local:

  • If the software version is older than 3.42.2, the export file contains the following files:
    • JSON file with the Site metadata and the configuration of all defined streams and of any default streams
    • A zip file called "template" with the appropriate firmware template for the device in *.bin and *.xml format. 

  • If the software version is 3.42.2 and newer, the export file contains the following files:
    • JSON file with the Site metadata and the configuration of all defined streams and of any default streams
    • Binary and xml files of the firmware that are needed for the Site

You will transfer (via FTP client) the Site's zip file to your on-premises server, and then import the file into your FAI Local server instance. 

Finally, you will configure the MQTT and HTTP server properties for each migrated device to communicate with the on-premises server rather than with the cloud server.

 

Step 1: Prepare Site Files

  1. On a client machine, log in to FAI Pro as a user that has the AccountOwner (or Partner) role. 
  2. In the left pane, click Fleet. The Devices window opens to display devices. Do the following steps:
    1. In the Search field, type in your Account, Organization, or other identifiers to filter a subset list of your devices. Select all of the relevant filtered devices. In this example, we'll look for the QA  Account and select all of them for export. 
    2. Click the Set Action button, and then select Export Sites. The Export Sites window opens.

  3.    In the Export Sites window, do the following steps:
    1. If the software version of your on-premises server is older than 3.42.2, select the For version earlier than 3.42.2 check box.
    2. Accept the default task name or type in some name. In this example, we call the task  New_Export_Sites_Task_(8/16/2020_11:08:19AM). Save the file to a directory on your client machine.
 

Important:  Do not include spaces ( ), forward slashes (/), back slashes (\), colons (:), asterisks (*), question marks (?), quotation marks ("), and angle brackets (<>) in the file name. They will be replaced with an underscore (_).

If you accept the default task name, replace the spaces with an underscore (_).

 
 c.    Click Submit.

 4.   When the task is finished, click Close.

 

If, at some later time, you need to download the exported Site file, do the following steps in Fleet:

  1. In the left pane, click Tasks
  2. In the Search box, type Export to list all exports, and then select the exported Site that you need.
  3. Click the Download icon near the check box. The downloaded file will be called Export Sites - <Display_Name>.zip.

 

Step 2: Import the Exported Site Metadata and FW onto the On-Premises Server Repository

You can import a file up to 8 MB to the on-premises server.

If the software version is older than 3.42.2, you must import each Site individually. If the version is 3.42.2 and newer, you can import all Sites simultaneously.

If the software version is older than 3.42.2, do the following steps on the on-premises server for each Site:

  1. On a command-line screen, go to the folder /var/ayyeka/firmwares/new. If it does not exist, create it now. 

  2. Extract the contents of the template.zip file into the folder  /var/ayyeka/firmwares/new.
  3. Run the command: dimport_firmware  template.zip.

  4. Rename the exported zip file from Step 1 (in this example,  New_Export_Sites_Task_ (8/16/2020_11:08:19AM)) to a name that indicates the device serial number. For example, you might rename New_Export_Sites_Task_(8/16/2020_11:08:19AM) to be SN_1234567890.zip.

  5. Copy the renamed exported zip file (in this example, SN_1234567890.zip) to /var/ayyeka/sites/new.

  6. Run the command: 

dimport_sites <renamed exported zip file>

 

If the software version is 3.42.2 and newer, do the following steps on the on-premises server:

  1. Log in to FAI Pro as a user that has the AccountOwner or Partner role. 
  2. In the left pane, click Fleet, and then click Accounts. The Devices window opens to display devices. Do the following steps:
    1. In the Search field, type in your Account, Organization, or other identifiers to filter a subset list of your devices. Select the relevant Account. In this example, we'll look for the QA  Account. 
    2. Click the Set Action button, and then select Import Sites. The Upload File window opens.
    3. Click Browse to go to the zip file, and then click Upload. An import task is scheduled.
  3. In the left pane, click Tasks. The Tasks window opens to display all tasks.
  4. In the Display Name column, look for the name Import sites. Click it to open and see the import details.

Step 3: Reconfigure MQTT and HTTP Communication for Migrated Devices

On a client machine, log in to FAI Pro as a user that has the AccountOwner (or Partner) role. Configure each migrated device that was exported in step 1.

Tip: If you need to change the HTTP and MQTT addresses of many devices, go to Fleet > Hardware. In the Set Action drop-down list, select Send Server Address.

 
  1. In the left pane, click Devices, and then select the device.
  2. In the Configuration tab, scroll down to Advanced Device Configuration, and then open GSM. 
  3. In the GSM section, do the following actions:
    • Click gsm_mqtt_enable. Confirm that the setting is 1.
    • Click MQTT Server Port. Confirm that the port is 8883.
    • Click MQTT Server Address. Replace the default address, mqtt.ayyeka.com, with the IP address or host name of your on-premises server.
    • Click HTTP SSL Port. Confirm that the port is 9443.
    • Click HTTP Server Address. Replace the default address, cnc.ayyeka.com, with the IP address or host name of your on-premises server.
    • Check all entries for correctness, and then click Submit.
 

The next time that the device connects to FAI Pro, the device will be reprogrammed to communicate with your FAI Local server instance. From thereon, the device will communicate directly with your on-premises server instance.

The device will stop transmitting to FAI Pro after receiving the above commands. Setting a wrong address will cause you to lose control of the device.

For troubleshooting transmission problems, see Transmission Problems - Device is on an On-Premises Server.