Assuming keycloak is unpacked in the user’s home directory
for instance
/home/keycloak/keycloak-9.0.0
is the old version and
/home/keycloak/keycloak-9.0.2
is the new version
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
#!/usr/bin/env bash OLD=9.0.0 NEW=9.0.2 OLDPATH=~/keycloak-$OLD NEWPATH=~/keycloak-$NEW cd ~/ wget https://downloads.jboss.org/keycloak/$NEW/keycloak-$NEW.tar.gz tar xvf keycloak-$NEW.tar.gz mkdir -p $NEWPATH/modules/system/layers/base/org/postgresql/jdbc/main cp -a $OLDPATH/modules/system/layers/base/org/postgresql/jdbc/main/* $NEWPATH/modules/system/layers/base/org/postgresql/jdbc/main/ cp -a $OLDPATH/standalone/* $NEWPATH/standalone/ cd $NEWPATH bin/jboss-cli.sh --file=bin/migrate-standalone.cli cd ~/ rm -f keycloak-gatekeeper-linux-amd64.tar.gz wget https://downloads.jboss.org/keycloak/$NEW/gatekeeper/keycloak-gatekeeper-linux-amd64.tar.gz tar xvf keycloak-gatekeeper-linux-amd64.tar.gz echo "Next steps:\nnano -w /etc/systemd/system/keycloak.service\nsystemctl daemon-reload\nsystemctl restart keycloak.service\n\n" |