Skip to content

Cookie preferences

We use cookies for our own analytics, to see how our campaigns perform and, if you allow it, to load content from other services such as the Google site search. We never sell your data. Necessary cookies keep the site working and cannot be switched off. See our Cookie Policy for details and our Privacy Policy for how we handle personal data.

Security, load balancing and remembering your cookie choice.

Show us which pages people read, how they find the site and where they get stuck, so we can improve it (Google Analytics, Microsoft Clarity).

Show us which of our ad campaigns bring visitors to the site and remember the campaign or partner link you arrived from (Google Ads, LinkedIn, Meta, partner program). We do not use these cookies to build advertising profiles.

Load the site search from Google when you use it. Google sets its own cookies and shows ads in the search results.

© 2026 The ThingsBoard Authors

Trendz Analytics Kubernetes 1.16.x Upgrade Instructions

← Back to all versions

Prepare for upgrading Trendz Analytics

Obtain Trendz Kubernetes scripts

Use the Kubernetes configuration files from your original installation. If you no longer have them, clone the repository and fill in your configuration values as described in the installation guide. Run only the command for your target version.

Trendz 1.16.1.1 and later: the master branch holds the files of the latest Trendz release.

Terminal window
git clone https://github.com/thingsboard/trendz-k8s.git --depth 1

An earlier version: clone the release branch of your target version. A release branch holds the files of the latest patch of its release. For example, release-1.16.0 holds the files of the latest 1.16.0.x patch:

Terminal window
git clone -b release-1.16.0 https://github.com/thingsboard/trendz-k8s.git --depth 1

Connect to your Kubernetes cluster

Select the correct kube-config context before running any commands:

Terminal window
kubectl config get-contexts
Terminal window
kubectl config use-context <your-config-name>

Set trendz as the default namespace, so the commands below run in it:

Terminal window
kubectl config set-context --current --namespace=trendz

Back up the database

Back up the trendz database with pg_dump or your PostgreSQL provider's backup tools.

Upgrading Trendz Analytics to 1.16.1.3 (latest 1.16.1 patch)

Update the Kubernetes files

Check whether your cluster still runs on the files of Trendz 1.16.1 or earlier:

Terminal window
kubectl get configmap trendz-app-db-config

If the command prints the ConfigMap, follow Migrate Trendz Kubernetes files from 1.16.1 or earlier instead of this step. If it prints NotFound, go on here.

In your trendz-k8s folder, commit your edits so that Git can merge them with the latest changes, then pull. The commit stays in this folder only, but it holds your passwords and license key: do not push it anywhere. If Git has no name and email for this folder yet, set them first with git config user.name "Your Name" and git config user.email "you@example.com".

Terminal window
git commit -am "My configuration"
git pull --no-rebase

If Git says there is nothing to commit, the pull still runs.

If Git reports conflicts, open each file it names, keep your configuration values and take everything else from the new version. Then finish the merge:

Terminal window
git add -u
git commit --no-edit

Apply the latest configuration. If you created the Secrets with kubectl create secret, leave out the first line, which applies trendz-db-app-secret.yml and trendz-python-executor-secret.yml. trendz-app-statefulset.yml and trendz-python-executor-deployment.yml are applied in the steps below.

Terminal window
kubectl apply -f trendz-db-app-secret.yml -f trendz-python-executor-secret.yml
kubectl apply -f trendz-app-env-config.yml -f trendz-app-files-config.yml
kubectl apply -f trendz-python-executor-env-config.yml -f trendz-python-executor-files-config.yml
kubectl apply -f trendz-app-shared-pvc.yml
kubectl apply -f trendz-cache-deployment.yml
kubectl apply -f trendz-python-executor-network-policy.yml

Update image versions

Set the image versions to 1.16.1.3. Do not apply the files yet.

  • trendz-app-statefulset.yml: thingsboard/trendz:1.16.1.3
  • trendz-python-executor-deployment.yml: thingsboard/trendz-python-executor:1.16.1.3

Stop Trendz

Terminal window
kubectl scale statefulset trendz-app --replicas=0
kubectl wait --for=delete pod -l app=trendz-app-pod-label --timeout=120s

If the pods are already gone, kubectl wait may print no matching resources found. This is expected.

Create the upgrade job

trendz-upgrade.yml
apiVersion: batch/v1
kind: Job
metadata:
name: trendz-upgrade
namespace: trendz
spec:
backoffLimit: 0
template:
spec:
restartPolicy: Never
containers:
- name: trendz-upgrade
image: thingsboard/trendz:1.16.1.3
env:
- name: UPGRADE_TRENDZ
value: "true"
envFrom:
- configMapRef:
name: trendz-app-env-config
- secretRef:
name: trendz-db-app-secret
volumeMounts:
- name: trendz-app-files-config
mountPath: /trendz-config-files
volumes:
- name: trendz-app-files-config
configMap:
name: trendz-app-files-config
items:
- key: trendz.conf
path: trendz.conf
- key: logback.xml
path: logback.xml

The ConfigMap and Secret names and the namespace must match your trendz-app-statefulset.yml.

Run the upgrade job

Terminal window
kubectl apply -f trendz-upgrade.yml
kubectl wait --for=condition=complete job/trendz-upgrade --timeout=900s

The job does not retry. If the wait does not return, check the job log for the error (see the next step).

Verify the upgrade

Terminal window
kubectl logs job/trendz-upgrade

Expected output:

Starting Trendz installation ...
…
Trendz upgrade triggered
…
Start upgrading Trendz from version …
…
Trendz upgrade from ENV completed. Stopping as requested.

The job does not mount /data, so it first runs the installation check. It finds the existing database and installs nothing.

Delete the job

Terminal window
kubectl delete job trendz-upgrade

Start Trendz

Terminal window
kubectl apply -f trendz-python-executor-deployment.yml
kubectl apply -f trendz-app-statefulset.yml

If you run more than one pod, restore the replica count:

Terminal window
kubectl scale statefulset trendz-app --replicas=<pod-count>

If you came here from Migrate Trendz Kubernetes files from 1.16.1 or earlier, go back to its last step once the new Trendz pod is running.

Sync Trendz with ThingsBoard

After the upgrade, sync Trendz with ThingsBoard to update widgets and JS modules automatically. See the sync instructions for details.

Upgrading Trendz Analytics to 1.16.1.2 (latest 1.16.1 patch)

Update the Kubernetes files

Check whether your cluster still runs on the files of Trendz 1.16.1 or earlier:

Terminal window
kubectl get configmap trendz-app-db-config

If the command prints the ConfigMap, follow Migrate Trendz Kubernetes files from 1.16.1 or earlier instead of this step. If it prints NotFound, go on here.

In your trendz-k8s folder, commit your edits so that Git can merge them with the latest changes, then pull. The commit stays in this folder only, but it holds your passwords and license key: do not push it anywhere. If Git has no name and email for this folder yet, set them first with git config user.name "Your Name" and git config user.email "you@example.com".

Terminal window
git commit -am "My configuration"
git pull --no-rebase

If Git says there is nothing to commit, the pull still runs.

If Git reports conflicts, open each file it names, keep your configuration values and take everything else from the new version. Then finish the merge:

Terminal window
git add -u
git commit --no-edit

Apply the latest configuration. If you created the Secrets with kubectl create secret, leave out the first line, which applies trendz-db-app-secret.yml and trendz-python-executor-secret.yml. trendz-app-statefulset.yml and trendz-python-executor-deployment.yml are applied in the steps below.

Terminal window
kubectl apply -f trendz-db-app-secret.yml -f trendz-python-executor-secret.yml
kubectl apply -f trendz-app-env-config.yml -f trendz-app-files-config.yml
kubectl apply -f trendz-python-executor-env-config.yml -f trendz-python-executor-files-config.yml
kubectl apply -f trendz-app-shared-pvc.yml
kubectl apply -f trendz-cache-deployment.yml
kubectl apply -f trendz-python-executor-network-policy.yml

Update image versions

Set the image versions to 1.16.1.2. Do not apply the files yet.

  • trendz-app-statefulset.yml: thingsboard/trendz:1.16.1.2
  • trendz-python-executor-deployment.yml: thingsboard/trendz-python-executor:1.16.1.2

Stop Trendz

Terminal window
kubectl scale statefulset trendz-app --replicas=0
kubectl wait --for=delete pod -l app=trendz-app-pod-label --timeout=120s

If the pods are already gone, kubectl wait may print no matching resources found. This is expected.

Create the upgrade job

trendz-upgrade.yml
apiVersion: batch/v1
kind: Job
metadata:
name: trendz-upgrade
namespace: trendz
spec:
backoffLimit: 0
template:
spec:
restartPolicy: Never
containers:
- name: trendz-upgrade
image: thingsboard/trendz:1.16.1.2
env:
- name: UPGRADE_TRENDZ
value: "true"
envFrom:
- configMapRef:
name: trendz-app-env-config
- secretRef:
name: trendz-db-app-secret
volumeMounts:
- name: trendz-app-files-config
mountPath: /trendz-config-files
volumes:
- name: trendz-app-files-config
configMap:
name: trendz-app-files-config
items:
- key: trendz.conf
path: trendz.conf
- key: logback.xml
path: logback.xml

The ConfigMap and Secret names and the namespace must match your trendz-app-statefulset.yml.

Run the upgrade job

Terminal window
kubectl apply -f trendz-upgrade.yml
kubectl wait --for=condition=complete job/trendz-upgrade --timeout=900s

The job does not retry. If the wait does not return, check the job log for the error (see the next step).

Verify the upgrade

Terminal window
kubectl logs job/trendz-upgrade

Expected output:

Starting Trendz installation ...
…
Trendz upgrade triggered
…
Start upgrading Trendz from version …
…
Trendz upgrade from ENV completed. Stopping as requested.

The job does not mount /data, so it first runs the installation check. It finds the existing database and installs nothing.

Delete the job

Terminal window
kubectl delete job trendz-upgrade

Start Trendz

Terminal window
kubectl apply -f trendz-python-executor-deployment.yml
kubectl apply -f trendz-app-statefulset.yml

If you run more than one pod, restore the replica count:

Terminal window
kubectl scale statefulset trendz-app --replicas=<pod-count>

If you came here from Migrate Trendz Kubernetes files from 1.16.1 or earlier, go back to its last step once the new Trendz pod is running.

Sync Trendz with ThingsBoard

After the upgrade, sync Trendz with ThingsBoard to update widgets and JS modules automatically. See the sync instructions for details.

Upgrading Trendz Analytics to 1.16.1.1 (latest 1.16.1 patch)

Update the Kubernetes files

Check whether your cluster still runs on the files of Trendz 1.16.1 or earlier:

Terminal window
kubectl get configmap trendz-app-db-config

If the command prints the ConfigMap, follow Migrate Trendz Kubernetes files from 1.16.1 or earlier instead of this step. If it prints NotFound, go on here.

In your trendz-k8s folder, commit your edits so that Git can merge them with the latest changes, then pull. The commit stays in this folder only, but it holds your passwords and license key: do not push it anywhere. If Git has no name and email for this folder yet, set them first with git config user.name "Your Name" and git config user.email "you@example.com".

Terminal window
git commit -am "My configuration"
git pull --no-rebase

If Git says there is nothing to commit, the pull still runs.

If Git reports conflicts, open each file it names, keep your configuration values and take everything else from the new version. Then finish the merge:

Terminal window
git add -u
git commit --no-edit

Apply the latest configuration. If you created the Secrets with kubectl create secret, leave out the first line, which applies trendz-db-app-secret.yml and trendz-python-executor-secret.yml. trendz-app-statefulset.yml and trendz-python-executor-deployment.yml are applied in the steps below.

Terminal window
kubectl apply -f trendz-db-app-secret.yml -f trendz-python-executor-secret.yml
kubectl apply -f trendz-app-env-config.yml -f trendz-app-files-config.yml
kubectl apply -f trendz-python-executor-env-config.yml -f trendz-python-executor-files-config.yml
kubectl apply -f trendz-app-shared-pvc.yml
kubectl apply -f trendz-cache-deployment.yml
kubectl apply -f trendz-python-executor-network-policy.yml

Update image versions

Set the image versions to 1.16.1.1. Do not apply the files yet.

  • trendz-app-statefulset.yml: thingsboard/trendz:1.16.1.1
  • trendz-python-executor-deployment.yml: thingsboard/trendz-python-executor:1.16.1.1

Stop Trendz

Terminal window
kubectl scale statefulset trendz-app --replicas=0
kubectl wait --for=delete pod -l app=trendz-app-pod-label --timeout=120s

If the pods are already gone, kubectl wait may print no matching resources found. This is expected.

Create the upgrade job

trendz-upgrade.yml
apiVersion: batch/v1
kind: Job
metadata:
name: trendz-upgrade
namespace: trendz
spec:
backoffLimit: 0
template:
spec:
restartPolicy: Never
containers:
- name: trendz-upgrade
image: thingsboard/trendz:1.16.1.1
env:
- name: UPGRADE_TRENDZ
value: "true"
envFrom:
- configMapRef:
name: trendz-app-env-config
- secretRef:
name: trendz-db-app-secret
volumeMounts:
- name: trendz-app-files-config
mountPath: /trendz-config-files
volumes:
- name: trendz-app-files-config
configMap:
name: trendz-app-files-config
items:
- key: trendz.conf
path: trendz.conf
- key: logback.xml
path: logback.xml

The ConfigMap and Secret names and the namespace must match your trendz-app-statefulset.yml.

Run the upgrade job

Terminal window
kubectl apply -f trendz-upgrade.yml
kubectl wait --for=condition=complete job/trendz-upgrade --timeout=900s

The job does not retry. If the wait does not return, check the job log for the error (see the next step).

Verify the upgrade

Terminal window
kubectl logs job/trendz-upgrade

Expected output:

Starting Trendz installation ...
…
Trendz upgrade triggered
…
Start upgrading Trendz from version …
…
Trendz upgrade from ENV completed. Stopping as requested.

The job does not mount /data, so it first runs the installation check. It finds the existing database and installs nothing.

Delete the job

Terminal window
kubectl delete job trendz-upgrade

Start Trendz

Terminal window
kubectl apply -f trendz-python-executor-deployment.yml
kubectl apply -f trendz-app-statefulset.yml

If you run more than one pod, restore the replica count:

Terminal window
kubectl scale statefulset trendz-app --replicas=<pod-count>

If you came here from Migrate Trendz Kubernetes files from 1.16.1 or earlier, go back to its last step once the new Trendz pod is running.

Sync Trendz with ThingsBoard

After the upgrade, sync Trendz with ThingsBoard to update widgets and JS modules automatically. See the sync instructions for details.

Upgrading Trendz Analytics to 1.16.1

Update image versions

Set the image versions to 1.16.1. Do not apply the files yet.

  • trendz-app-deployment.yml: thingsboard/trendz:1.16.1
  • trendz-python-executor-deployment.yml: thingsboard/trendz-python-executor:1.16.1

Stop Trendz

Terminal window
kubectl scale deployment trendz-app-deployment --replicas=0
kubectl wait --for=delete pod -l app=trendz-app-pod-label --timeout=120s

If the pods are already gone, kubectl wait may print no matching resources found. This is expected.

Create the upgrade job

trendz-upgrade.yml
apiVersion: batch/v1
kind: Job
metadata:
name: trendz-upgrade
namespace: trendz
spec:
backoffLimit: 0
template:
spec:
restartPolicy: Never
containers:
- name: trendz-upgrade
image: thingsboard/trendz:1.16.1
env:
- name: UPGRADE_TRENDZ
value: "true"
envFrom:
- configMapRef:
name: trendz-app-db-config
volumeMounts:
- name: trendz-app-config
mountPath: /trendz-config-files
volumes:
- name: trendz-app-config
configMap:
name: trendz-app-config
items:
- key: trendz.conf
path: trendz.conf
- key: logback.xml
path: logback.xml

The ConfigMap names, keys and namespace must match your trendz-app-deployment.yml. Installations created before 1.15 use the keys conf and logback.

Run the upgrade job

Terminal window
kubectl apply -f trendz-upgrade.yml
kubectl wait --for=condition=complete job/trendz-upgrade --timeout=900s

The job does not retry. If the wait does not return, check the job log for the error (see the next step).

Verify the upgrade

Terminal window
kubectl logs job/trendz-upgrade

Expected output:

Start upgrading Trendz from version …
…
Current version is …, upgrade is not needed.

Delete the job

Terminal window
kubectl delete job trendz-upgrade

Start Trendz

Terminal window
kubectl apply -f trendz-python-executor-deployment.yml
kubectl apply -f trendz-app-deployment.yml

If you run more than one pod, restore the replica count:

Terminal window
kubectl scale deployment trendz-app-deployment --replicas=<pod-count>

Sync Trendz with ThingsBoard

After the upgrade, sync Trendz with ThingsBoard to update widgets and JS modules automatically. See the sync instructions for details.

Upgrading Trendz Analytics to 1.16.0.2 (latest 1.16.0 patch)

Update image versions

Set the image versions to 1.16.0.2. Do not apply the files yet.

  • trendz-app-deployment.yml: thingsboard/trendz:1.16.0.2
  • trendz-python-executor-deployment.yml: thingsboard/trendz-python-executor:1.16.0.2

Stop Trendz

Terminal window
kubectl scale deployment trendz-app-deployment --replicas=0
kubectl wait --for=delete pod -l app=trendz-app-pod-label --timeout=120s

If the pods are already gone, kubectl wait may print no matching resources found. This is expected.

Create the upgrade job

trendz-upgrade.yml
apiVersion: batch/v1
kind: Job
metadata:
name: trendz-upgrade
namespace: trendz
spec:
backoffLimit: 0
template:
spec:
restartPolicy: Never
containers:
- name: trendz-upgrade
image: thingsboard/trendz:1.16.0.2
env:
- name: UPGRADE_TRENDZ
value: "true"
envFrom:
- configMapRef:
name: trendz-app-db-config
volumeMounts:
- name: trendz-app-config
mountPath: /trendz-config-files
volumes:
- name: trendz-app-config
configMap:
name: trendz-app-config
items:
- key: trendz.conf
path: trendz.conf
- key: logback.xml
path: logback.xml

The ConfigMap names, keys and namespace must match your trendz-app-deployment.yml. Installations created before 1.15 use the keys conf and logback.

Run the upgrade job

Terminal window
kubectl apply -f trendz-upgrade.yml
kubectl wait --for=condition=complete job/trendz-upgrade --timeout=900s

The job does not retry. If the wait does not return, check the job log for the error (see the next step).

Verify the upgrade

Terminal window
kubectl logs job/trendz-upgrade

Expected output:

Start upgrading Trendz from version …
…
Current version is …, upgrade is not needed.

Delete the job

Terminal window
kubectl delete job trendz-upgrade

Start Trendz

Terminal window
kubectl apply -f trendz-python-executor-deployment.yml
kubectl apply -f trendz-app-deployment.yml

If you run more than one pod, restore the replica count:

Terminal window
kubectl scale deployment trendz-app-deployment --replicas=<pod-count>

Sync Trendz with ThingsBoard

After the upgrade, sync Trendz with ThingsBoard to update widgets and JS modules automatically. See the sync instructions for details.

Upgrading Trendz Analytics to 1.16.0.1 (latest 1.16.0 patch)

Update image versions

Set the image versions to 1.16.0.1. Do not apply the files yet.

  • trendz-app-deployment.yml: thingsboard/trendz:1.16.0.1
  • trendz-python-executor-deployment.yml: thingsboard/trendz-python-executor:1.16.0.1

Stop Trendz

Terminal window
kubectl scale deployment trendz-app-deployment --replicas=0
kubectl wait --for=delete pod -l app=trendz-app-pod-label --timeout=120s

If the pods are already gone, kubectl wait may print no matching resources found. This is expected.

Create the upgrade job

trendz-upgrade.yml
apiVersion: batch/v1
kind: Job
metadata:
name: trendz-upgrade
namespace: trendz
spec:
backoffLimit: 0
template:
spec:
restartPolicy: Never
containers:
- name: trendz-upgrade
image: thingsboard/trendz:1.16.0.1
env:
- name: UPGRADE_TRENDZ
value: "true"
envFrom:
- configMapRef:
name: trendz-app-db-config
volumeMounts:
- name: trendz-app-config
mountPath: /trendz-config-files
volumes:
- name: trendz-app-config
configMap:
name: trendz-app-config
items:
- key: trendz.conf
path: trendz.conf
- key: logback.xml
path: logback.xml

The ConfigMap names, keys and namespace must match your trendz-app-deployment.yml. Installations created before 1.15 use the keys conf and logback.

Run the upgrade job

Terminal window
kubectl apply -f trendz-upgrade.yml
kubectl wait --for=condition=complete job/trendz-upgrade --timeout=900s

The job does not retry. If the wait does not return, check the job log for the error (see the next step).

Verify the upgrade

Terminal window
kubectl logs job/trendz-upgrade

Expected output:

Start upgrading Trendz from version …
…
Current version is …, upgrade is not needed.

Delete the job

Terminal window
kubectl delete job trendz-upgrade

Start Trendz

Terminal window
kubectl apply -f trendz-python-executor-deployment.yml
kubectl apply -f trendz-app-deployment.yml

If you run more than one pod, restore the replica count:

Terminal window
kubectl scale deployment trendz-app-deployment --replicas=<pod-count>

Sync Trendz with ThingsBoard

After the upgrade, sync Trendz with ThingsBoard to update widgets and JS modules automatically. See the sync instructions for details.

Upgrading Trendz Analytics to 1.16.0

Update image versions

Set the image versions to 1.16.0. Do not apply the files yet.

  • trendz-app-deployment.yml: thingsboard/trendz:1.16.0
  • trendz-python-executor-deployment.yml: thingsboard/trendz-python-executor:1.16.0

Stop Trendz

Terminal window
kubectl scale deployment trendz-app-deployment --replicas=0
kubectl wait --for=delete pod -l app=trendz-app-pod-label --timeout=120s

If the pods are already gone, kubectl wait may print no matching resources found. This is expected.

Create the upgrade job

trendz-upgrade.yml
apiVersion: batch/v1
kind: Job
metadata:
name: trendz-upgrade
namespace: trendz
spec:
backoffLimit: 0
template:
spec:
restartPolicy: Never
containers:
- name: trendz-upgrade
image: thingsboard/trendz:1.16.0
env:
- name: UPGRADE_TRENDZ
value: "true"
envFrom:
- configMapRef:
name: trendz-app-db-config
volumeMounts:
- name: trendz-app-config
mountPath: /trendz-config-files
volumes:
- name: trendz-app-config
configMap:
name: trendz-app-config
items:
- key: trendz.conf
path: trendz.conf
- key: logback.xml
path: logback.xml

The ConfigMap names, keys and namespace must match your trendz-app-deployment.yml. Installations created before 1.15 use the keys conf and logback.

Run the upgrade job

Terminal window
kubectl apply -f trendz-upgrade.yml
kubectl wait --for=condition=complete job/trendz-upgrade --timeout=900s

The job does not retry. If the wait does not return, check the job log for the error (see the next step).

Verify the upgrade

Terminal window
kubectl logs job/trendz-upgrade

Expected output:

Start upgrading Trendz from version …
…
Current version is …, upgrade is not needed.

Delete the job

Terminal window
kubectl delete job trendz-upgrade

Start Trendz

Terminal window
kubectl apply -f trendz-python-executor-deployment.yml
kubectl apply -f trendz-app-deployment.yml

If you run more than one pod, restore the replica count:

Terminal window
kubectl scale deployment trendz-app-deployment --replicas=<pod-count>

Sync Trendz with ThingsBoard

After the upgrade, sync Trendz with ThingsBoard to update widgets and JS modules automatically. See the sync instructions for details.