Docker Bonita Migration

I am running Bonita in docker containers and using Kubernetes. Using Kubernetes or not it not that relevant but if you are using docker, the following is probably interesting for you. I used to run the migrations manually (ie sopping my container, mounting a volume with the config and migration scripts, restarting the container, running the tool, restarting a new container on the new version). While that works... it is not the simplest...

Ironically, the documentation on the Official Docker hub page mentions some wget, unzip, etc... All kind of stuff no one really want to do :)

I just published the following image: https://hub.docker.com/r/chevdor/bonita-migration/tags?page=1&ordering=l...
You can find the source and doc here: https://gitlab.com/chevdor/docker-bonita-migration

The following is using markdown which does not seem to be supported yet on this forum. For a more pleasant read, jump here: https://gitlab.com/chevdor/docker-bonita-migration


You do NOT need to mount any volume. I guess this solution only works for the versions of Bonita after 7.3.x

The image does support "dry-run" as well we "run" so you can easily test before you migrate.

You control the migration by providing ENV and the config is generated from that. If you are using postgres, you will pass the following (as for example):

```

ENV DB=postgres

ENV URL=jdbc:postgresql://postgres:5432/bonitadb

ENV DRIVER=org.postgresql.Driver

ENV USER=postgres

ENV PASSWD=secret

ENV ZIP=https://github.com/bonitasoft/bonita-platform-releases/releases/download...

ENV TARGET=7.12.0
```

You can see that you can pass the "ZIP" you want depending on your version. The "TARGET" is also important and should be for instance "7.12.0" and not "7.12" (don't ask me... that's what the doc mentions...)

I successfully test a migration from 7.11.4 to 7.12.1.

If you are into Kubernetes, you can use a Job looking like this (after fixing the intendation that this stupid forum is killing...)

```

apiVersion: batch/v1

kind: Job

metadata:

name: bonita-migration-7-11-2021-1

namespace: registrar1

spec:

template:

spec:

containers:

- name: bonita-migration-7-11-2021-1

image: chevdor/bonita-migration

imagePullPolicy: Always

command: ["dry-run"]

# command: ["run"]

env:

- name: URL

value: jdbc:postgresql://postgres:5432/bonitadb

- name: USER

value: postgres

- name: PASSWD

valueFrom:

secretKeyRef:

name: bonita

key: password

- name: ZIP

value: https://github.com/bonitasoft/bonita-platform-releases/releases/download...

restartPolicy: Never

backoffLimit: 2

```

Hopefully that can help others.


Repository URL : https://gitlab.com/chevdor/docker-bonita-migration
1 Like

I thought I would post an update.

Since the image was made to avoid being rebuilt despite new versions of the migration tool, the image was not updated much, as intended :slight_smile:

Having deployed a more recent version, I realized the migration tool was deprecated in favor of the “update” tool (not sure why btw… whatever…).

I have updated and also renamed the image to keep in sync with the naming.
The repo was renamed as well. You can find the latest version at:

I just succesfully migrated from 7.15 to 9.0.0 using it.

2 Likes