Upgrade to Gluu Server 4.5#
Overview#
The Gluu Server cannot be upgraded with a simple apt-get upgrade. You will need to either use our in-place upgrade script or explicitly install the new version and export/import your data. Find the existing version below for upgrade instructions to Gluu Server 4.5.
Pre-requisites#
- Before upgrading, make sure to back up the Gluu container or LDAP LDIF.
- Upgrades should always be thoroughly scoped and tested on a development environment first.
-
This upgrade process only upgrades versions 4.0.x through 4.5.0. To upgrade from a previous version, first upgrade to 4.0.
-
Upgrade script runs on Python 3. You need to install Python 3 before running the script.
- On CentoOS/RHEL:
yum install -y python3 - On Ubuntu/Debian:
apt-get update && apt-get install -y python3
- On CentoOS/RHEL:
Online Upgrade from 4.x to 4.5.0#
The upgrade script downloads all needed software and applications from the internet. You can perform an online upgrade by following these steps:
- Download the upgrade script
wget https://raw.githubusercontent.com/GluuFederation/community-edition-package/master/update/4.5.0/upg4xto450.py
- Execute the script:
python3 upg4xto450.py
Your upgrade directory will be the /opt/upd/4.5.0/dist. The script will create these sub directories: app, gluu, and tmp. It also downloads latest setup files to /install/community_edition_setup_4.5.0.
Offline Upgrade from 4.x to 4.5.0#
If your machine is not open to public internet, you can download self extracting upgrade script form https://repo.gluu.org/upd/4.5-0.upg.run and you can run inside Gluu CE container as
sh 4.5-0.upg.run
The script extracts contents to /opt/upd/4.5.0/dist, and writes latest setup files to /install/community_edition_setup_4.5.0
Overview#
This guide introduces how to upgrade cloud native edition from one version to another.
We support both upgrading from different versions, for example 4.4 to 4.5, or doing a patch upgrade of the same version.
You can upgrade using either pygluu or helm.
pygluu upgrade#
In order to upgrade your deployment using pygluu, you have to first install and build the pygluu tool.
-
Clone latest stable manifests.
git clone --recursive --depth 1 --branch 4.5 https://github.com/GluuFederation/cloud-native-edition && cd cloud-native-edition/pygluu/kubernetes/templates/helm/gluu -
Modify all images inside main
values.yamlto the latest images according to the upgrade target version. Also make sure youroverride.yamlother options are moved correctly to the newvalues.yaml. -
Move the old
settings.jsonthat was used in the 4.4 installation into the same directorypygluu-kubernetes.pyzexists in. Thejsonfile can be generated using./pygluu-kubernetes.pyz generate-settings. -
Execute the following command:
./pygluu-kubernetes.pyz upgrade-values-yaml
helm upgrade#
Another way to upgrade your deployment is by simply going over your override.yaml used in 4.4 and adjust it according to the 4.5 values.yaml.
-
Inside your new
override.yamlsetglobal.upgrade.enabledtotrueandglobal.persistence.enabledtofalse.To perform a patch upgrade, where the source and target version are the same, yourglobal: upgrade: enabled: true sourceVersion: "4.4" targetVersion: "4.5" persistence: enabled: falseoverride.yamlwill be:global: upgrade: enabled: true sourceVersion: "4.5" targetVersion: "4.5" persistence: enabled: true -
Delete
oxAuthExpirationindexkubectl exec -ti gluu-opendj-0 -n <namespace> -- /opt/opendj/bin/dsconfig delete-backend-index --backend-name userRoot --index-name oxAuthExpiration --hostName 0.0.0.0 --port 4444 --bindDN 'cn=Directory Manager' --trustAll -fYou will be prompted to enter the
LDAP passwordand confirm the deletion. -
Run
helm upgradehelm upgrade <helm-release-name> gluu/gluu -f override.yaml -n <namespace> -
Once done revert
global.upgrade.enabledtofalseandglobal.persistence.enabledtotrue.
pygluu upgrade#
In order to upgrade your deployment using pygluu, you have to first install and build the pygluu tool.
-
Clone latest stable manifests.
git clone --recursive --depth 1 --branch 4.5 https://github.com/GluuFederation/cloud-native-edition && cd cloud-native-edition/pygluu/kubernetes/templates/helm/gluu -
Modify all images inside main
values.yamlto the latest images according to the upgrade target version. Also make sure youroverride.yamlother options are moved correctly to the newvalues.yaml. For example, make sure your couchbase url, crt and other configurations are filled and correctly. -
Move the old
settings.jsonthat was used in the 4.4 installation into the same directorypygluu-kubernetes.pyzexists in. Thejsonfile can be generated using./pygluu-kubernetes.pyz generate-settings. -
Execute the following command:
./pygluu-kubernetes.pyz upgrade-values-yaml
helm upgrade#
Another way to upgrade your deployment is by simply going over your override.yaml used in 4.4 and adjust it according to the 4.5 values.yaml.
-
Inside your new
override.yamlsetglobal.upgrade.enabledtotrueandglobal.persistence.enabledtofalse.To perform a patch upgrade, where the source and target version are the same, yourglobal: upgrade: enabled: true sourceVersion: "4.4" targetVersion: "4.5" persistence: enabled: falseoverride.yamlwill be:global: upgrade: enabled: true sourceVersion: "4.5" targetVersion: "4.5" persistence: enabled: true -
Run
helm upgradehelm upgrade <helm-release-name> gluu/gluu -f override.yaml -n <namespace> -
Once done revert
global.upgrade.enabledtofalseandglobal.persistence.enabledtotrue.
pygluu upgrade#
In order to upgrade your deployment using pygluu, you have to first install and build the pygluu tool.
-
Clone latest stable manifests.
git clone --recursive --depth 1 --branch 4.5 https://github.com/GluuFederation/cloud-native-edition && cd cloud-native-edition/pygluu/kubernetes/templates/helm/gluu -
Modify all images inside main
values.yamlto the latest images according to the upgrade target version. Also make sure youroverride.yamlother options are moved correctly to the newvalues.yaml. Also make sure youroverride.yamlother options are moved correctly to the newvalues.yaml. For example, make sure your couchbase url, crt and other configurations are filled and correctly. -
Move the old
settings.jsonthat was used in the 4.4 installation into the same directorypygluu-kubernetes.pyzexists in. Thejsonfile can be generated using./pygluu-kubernetes.pyz generate-settings. -
Execute the following command:
./pygluu-kubernetes.pyz upgrade-values-yaml
helm upgrade#
Another way to upgrade your deployment is by simply going over your override.yaml used in 4.4 and adjust it according to the 4.5 values.yaml.
-
Inside your new
override.yamlsetglobal.upgrade.enabledtotrueandglobal.persistence.enabledtofalse.To perform a patch upgrade, where the source and target version are the same, yourglobal: upgrade: enabled: true sourceVersion: "4.4" targetVersion: "4.5" persistence: enabled: falseoverride.yamlwill be:global: upgrade: enabled: true sourceVersion: "4.5" targetVersion: "4.5" persistence: enabled: true -
Run
helm upgradehelm upgrade <helm-release-name> gluu/gluu -f override.yaml -n <namespace> -
Once done revert
global.upgrade.enabledtofalseandglobal.persistence.enabledtotrue.
pygluu upgrade#
In order to upgrade your deployment using pygluu, you have to first install and build the pygluu tool.
-
Clone latest stable manifests.
git clone --recursive --depth 1 --branch 4.5 https://github.com/GluuFederation/cloud-native-edition && cd cloud-native-edition/pygluu/kubernetes/templates/helm/gluu -
Modify all images inside main
values.yamlto the latest images according to the upgrade target version. Also make sure youroverride.yamlother options are moved correctly to the newvalues.yaml. -
Move the old
settings.jsonthat was used in the 4.4 installation into the same directorypygluu-kubernetes.pyzexists in. Thejsonfile can be generated using./pygluu-kubernetes.pyz generate-settings. -
Execute the following command:
./pygluu-kubernetes.pyz upgrade-values-yaml
helm upgrade#
Another way to upgrade your deployment is by simply going over your override.yaml used in 4.4 and adjust it according to the 4.5 values.yaml.
-
Inside your new
override.yamlsetglobal.upgrade.enabledtotrueandglobal.persistence.enabledtofalse.To perform a patch upgrade, where the source and target version are the same, yourglobal: upgrade: enabled: true sourceVersion: "4.4" targetVersion: "4.5" persistence: enabled: falseoverride.yamlwill be:global: upgrade: enabled: true sourceVersion: "4.5" targetVersion: "4.5" persistence: enabled: true -
Run
helm upgradehelm upgrade <helm-release-name> gluu/gluu -f override.yaml -n <namespace> -
Once done revert
global.upgrade.enabledtofalseandglobal.persistence.enabledtotrue.
Exporting Data#
Note
This step is not needed.
-
Make sure to backup existing LDAP data
-
Set environment variable as a placeholder for LDAP server password (for later use):
export LDAP_PASSWD=YOUR_PASSWORD_HERE -
Assuming that existing LDAP container called
ldaphas data, export data from each backend:-
Export
o=gluukubectl exec -ti ldap /opt/opendj/bin/ldapsearch \ -Z \ -X \ -D "cn=directory manager" \ -w $LDAP_PASSWD \ -p 1636 \ -b "o=gluu" \ -s sub \ 'objectClass=*' > gluu.ldif -
Export
o=sitekubectl exec -ti ldap /opt/opendj/bin/ldapsearch \ -Z \ -X \ -D "cn=directory manager" \ -w $LDAP_PASSWD \ -p 1636 \ -b "o=site" \ -s sub \ 'objectClass=*' > site.ldif -
Export
o=metrickubectl exec -ti ldap /opt/opendj/bin/ldapsearch \ -Z \ -X \ -D "cn=directory manager" \ -w $LDAP_PASSWD \ -p 1636 \ -b "o=metric" \ -s sub \ 'objectClass=*' > metric.ldif
-
-
Unset
LDAP_PASSWDenvironment variable