How to migrate on ECS AWS

Hello guys;

I was wondering if you were smarter than me!
I’m currently running version 11 on ECS with docker entrypoint
And was wondering how can I smartly migrate to version 16 and more later.

ENTRYPOINT [ "/opt/jboss/tools/docker-entrypoint.sh" ] CMD ["-b", "0.0.0.0"] (currently running version 11)

CMD /opt/jboss/keycloak/bin/jboss-cli.sh --file=/opt/jboss/keycloak/bin/migrate-standalone.cli
(i would use this to migrate)

How can we smartly “switch” between those two lines? i create a “migration service” on ECS? I have multiples environments (dev;staging;prod;etc) that’s why i’m looking for smartness.

I could push an image with the migrate-standalone.cli command and resend another image after the migration is over but that’s not perfect.

Thanks alot guys;

I’m not very familiar with versions earlier than 16, but as you are using a container image, there is nothing to be upgraded by the migrate-standalone.cli, as its purpose, as I understand it, is to migrate configurations files.

So, you can prepare the new Keycloak 16 image (I mean, apply your customizations over the Keycloak 16 base image, if you have any customization) and then running the new image.

Note that Keycloak 16 (at least until the current version 21) does not support zero downtime upgrades. So the safe approach is to interrupt user traffic and run a single instance of the new container image, which will upgrade the database schema. After that, you can run the other instances and resume traffic.

Hope this helps.