Skip to main content

# Update instructions

### Update BAF to a new version​

This section provides general instructions for updating the system to a new version. If no specific instructions for the target version are provided in the subsequent sections, follow the procedure described below.

note

The `license-server` licensing module does not require an update and remains unchanged.

Before starting the update, create a full data dump of the current system. This backup will be required for restoration in case of issues, as the BAF system does not support a migration rollback with data preservation.

Next, manually transfer all custom settings from the configuration files of the current version (such as values.yaml, secrets.yaml, settings.cfg for modules) to the corresponding files in the new release. The transfer is performed by matching fields: a value is copied only if a field with the same name exists in the new version. Fields that are absent in the old files but present in the new ones must be filled in according to the new version's documentation.

After filling in all the values, proceed to install the modules of the new version, executing commands from its release folder.

The process is similar to the initial installation: first, update the module's secrets if necessary via `./cli.sh <module_name> install-secrets` (this will replace the secrets of the current version with new ones), and then install the module itself using the command `./cli.sh <module_name> install`, which will perform a `helm upgrade` for the corresponding chart.

The update sequence of the modules must match the order of their initial installation.

### Update BAF from version 1.1.0 to 1.2.0 and higher​

1. Before updating BAF, to maintain access to the database and the main configuration, transfer existing field values to the files of the new version.

   note

   You don't need to transfer secrets for stunner, just fill them in again according to the instructions.

   ATTENTION!

   It is not recommended to replace the files, as some fields in the installed release may be lost.

2. Uninstall the old release of the stunner, as it has been drastically updated in the new BAF version. Go to the folder with the old BAF version and run the following command:

       ./cli.sh stunner uninstall

   note

   New stunner generates new TURN ports. Web-component settings need to be updated.

3. Move to the folder with the new BAF version and run the command below:

       ./cli.sh platform install-secrets

   This action is mandatory, otherwise the services will not receive the required set of fields and won't be able to start.

4. Download new images by executing the command below:

       ./cli.sh generic load-images

5. Go back to the installation section and continue as if you were doing a clean installation.

   note

   Do not overwrite the values from the previous version, only update the new values if required using the instructions.

### Update BAF from version 1.6.0 to 1.7.0 and higher​

The main changes introduced in version 1.7.0 include splitting the LRS service into two subsystems: the Video Recorder for video recording and LRS for calculating liveness based on video. For a successful update, it's necessary to correctly transfer secrets and settings.

1. Transfer values from the lrs.secrets.json file of the previous version to the video-recorder.secrets.json file of the new version. Replace lrs with video-recorder in the secret names. For example, lrs-postgres becomes video-recorder-postgres.

2. Transfer values from the lrs.values.yaml file to the video-recorder.values.yaml file. The lrs block from the old values is moved to the video-recorder block, excluding the host and image fields. The remaining blocks are transferred one-to-one, excluding the image fields.

3.Transfer values from the baf.values.yaml file to the new baf.values.yaml file. From the old lrs block to the new video-recorder block, only the enabled value needs to be transferred. The values of the other blocks are transferred one-to-one, excluding the image fields.

4. Return to the deployment section and continue following the steps as you would for a clean installation.

### Update BAF from version 1.9.0​

If your cluster uses Docker as an image source, change kube_cri to dockerd in settings.cfg file of generic and smc modules. This way images from the generic module will be loaded into Docker instead of containerd.

If you want to upgrade the cluster version completely, uninstall the old cluster and go through the installation instructions again on the new delivery.

### Update BAF from version 1.10.0​

Starting with version 1.11.0 the decoder service is included in the video-recorder service, so after upgrading to 1.11.0 the separate decoder chart can be removed.

### Update BAF from version 1.8.0 to 1.13.0​

As of version 1.13.0, the automatic creation of the default BAF user and all k8s secrets related to it have been removed. If you have not updated to any version between 1.9.0 and 1.12.0 inclusive, then when updating to 1.13.0 the migration will not be able to correctly handle the BAF account and add an access token to it from an existing

account.

To bring the account data to the correct state, you need to execute the following SQL command in the BAF database:

    UPDATE "Accounts" SET "PlatformAccessToken"='---';

where `PlatformAccessToken` is the platform token that used to be in the platform-token section of the ./cfg/baf.secrets.yaml file of v1.8.0 package.

### Update BAF from version 1.12.0 to 1.13.0​

In version 1.13.0, the old mechanism for configuring motion control patterns has been removed. If you need to transfer patterns from version 1.12.0, you should use the following command from the distribution of the new version before updating:

    ./cli.sh baf motion-pattern-transfer - <domain>

where domain refers to the domain on which BAF publicai is hosted.

The command also requires the BAF sk-token to make a request to publicapi for patterns.

The successful command execution will result in the following output in the console:

.

And in the baf.values.yaml file, the variable baf.default_motion_control_patterns will contain the current list of patterns for the account that owns the sk-token.

The variable contains a list of lists, where each internal list reflects a pattern. In case of finding inconsistencies it is necessary to correct the list.

note

The script transfer patterns only for the account that owns the sk-token. If you have multiple accounts, you need to run the script again, but with the sk-token of another account.