Backing up client item mapping files

Client item mapping files are now automatically backed up when you create a client item tree.

About this task

If the Toolkit crashes, becomes unresponsive, or the mapping files become corrupted, you can restore client item tree mapping JSON files. These mapping files are a JSON representation of the client item tree, which is seen from the manufacturing perspective of the Toolkit.

A backup is created when any operation is performed on the client items/datasources (Create, Update, Delete, Rename, or Duplicate).

Run the following steps to configure the backup folder within an environmental variable.

Procedure

  1. Create client item tree to create multiple client items based on the OPC UA server source item tree. For more information, see Creating a client item.

    By default, the JSON files are created in <user_home_dir>/.acmfg/mappings. These JSON files are used to store data source details, and client item mappings.

    A Mapping_Backup folder is created under the specified directory path to store the backup these JSON files as follows.

    UnixLinux<user_home_dir>/Mapping_JSON/Mapping_Backup

    Windows C:\Mapping_JSON\Mapping_Backup
    Tip:
    • If the Toolkit crashes, becomes unresponsive, or the mapping files become corrupted, you cannot see the client items from the Manufacturing Perspective.
    • To restore the existing client items, you can copy the JSON file from the backup folder and place it in the respective client item tree mapping locations, so the client item mapping can be restored.
  2. Optional: You can opt to create the backup folder by setting the environment variable to store the client item tree data JSON files.
    • Unix Linux

      Edit /etc/bashrc file in any terminal text editor and enter the following lines.

      1. Set JSON files data storage by running the following command:
        export USE_DATABASE= "false"
      2. Set the directory path to store the JSON files by running the following command:
        For example, specify the path to store your JSON files.
        export ACMFG_MAPPING_FILES_DIR= "<user_home_dir>/Mapping_JSON"
    • Windows
      Set the variable from Windows Environment Variables user interface.
      1. Click Start > Settings > About > Adavanced system settings > Environment variables.
      2. In the System variables pane, click New and add the following details.
        Variable name Value
        USE_DATABASE Specify false.
        Note: By default, JSON files are used to store data source details, and client item mappings even if the USE_DATABASE environment variable is not set.
        ACMFG_MAPPING_FILES_DIR Specify a directory path to store the JSON files. For example, C:\Mapping_JSON.
        Note: If the environment variable is not set, by default the following directory path is used to store the JSON files.

        <user_home_dir>/.acmfg/mappings

      3. Click OK to save the changes and close the System variables pane.

Results

When any operation is performed in manufacturing perspective, the existing JSON files in the Mapping_Backup folder are automatically updated.
  1. Restart the toolkit.
  2. If the mapping files are corrupted, the files are restored automatically from the Mapping_Backup folder. The restoration is tried only once at the start of the toolkit.
  3. If the issue persists, that means either that the backup is not present or is corrupted. You then need to restart the toolkit again or delete files and create new data sources/client items.