Docker Image for easy Migration

1
0
-1

No question here but I wanted to share a Docker image you may find useful (if you are using Docker that is...)

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

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.

1 answer

1
0
-1

Thanks a lot Chevdor, it is a nice contribution.

Notifications