Upgrading¶
Upgrading JIM means replacing the jim.web, jim.worker and jim.scheduler container images with a newer release. Your data stays put: the image swap leaves the database and encryption key volume alone, and the new worker applies any database upgrade as it starts.
Take a backup first, and make sure it includes the encryption keys
A JIM backup is two artefacts: the PostgreSQL database and the encryption key set (jim-keys-volume, or the path in JIM_ENCRYPTION_KEY_PATH). Restored without its matching keys, a database cannot decrypt any secret it stores, such as a Connected System's credentials. Falling back to your pre-upgrade backup needs both halves; see Backup & Disaster Recovery.
Before you upgrade¶
You can upgrade from v0.16.0 or any later release straight to the latest, without installing the releases in between. Upgrading an installation of v0.15.0 or earlier is not supported or tested, because those releases predate the installer and were set up by hand: install the latest release afresh, as Deployment describes, with an empty database.
- Read the release notes. Check the
CHANGELOG.mdfor the target release (on the releases page, or underdocs/in an air-gapped bundle) for breaking changes, new configuration variables, and security fixes. - Rehearse in staging against a copy of production data where practical.
- Take a full backup: database plus encryption keys, as a matched pair, following Backup & Disaster Recovery. Take it after stopping the services (below), so the two are consistent.
- Disable all Schedules, recording which you disabled, so no new runs start while you work (Pausing work first).
- Let in-flight work finish. With Schedules disabled, let running Activities complete before stopping services (why).
- Keep the outgoing images. Do not run
docker image pruneuntil the new version is verified; they are your fastest rollback. Air-gapped, keep the old bundle. - Compare
.env.examplewith your.env. New releases can add variables (Configuration Reference). - Upgrading from v0.18.0 or earlier:
- With Microsoft Entra ID, set
"requestedAccessTokenVersion": 2in the application's manifest. JIM's API no longer accepts Entra ID's version 1 access tokens (Microsoft Entra ID Troubleshooting). - Set
JIM_SSO_API_SCOPEif people sign in to JIM's API through your identity provider, withConnect-JIMor the API reference's Try It: where the audience JIM requires isJIM_SSO_CLIENT_ID(as with Keycloak and Entra ID), JIM now accepts an access token only when it grants that scope, and with none set it accepts none. API keys are unaffected (what JIM requires of a token).
- With Microsoft Entra ID, set
- Upgrading from v0.17.0 or earlier:
- Upgrading from v0.16.0 or earlier:
- Reinstall rather than upgrade, where you can, starting from an empty database. Five built-in Metaverse Attributes are renamed:
objectGUID,objectSid,sIDHistory,StreetAddressandWebPagebecome Object GUID, Object SID, SID History, Street Address and Web Page. An upgrade in place keeps the old attributes and adds the renamed ones beside them. - With AD FS, run
Register-JIMIdentityProvider -Provider ADFSagain first (Keep the registration right): the portal asks AD FS for theallatclaimsscope, and AD FS refuses sign-in until the registration permits it. - Upgrade the PowerShell module with JIM, and send API keys as
Authorization: Bearer. JIM refuses a key inX-API-Key, which earlier modules send (API Keys). - Afterwards, refresh each Connected System's schema (Refreshing the schema) and run a Full Import, to pick up changes to how attributes are discovered, such as date resolutions. Pending Exports that had Failed are queued again, for the next export run, and an Attribute Flow to a
passwordattribute exports nothing, as Credential errors after upgrading describes.
- Reinstall rather than upgrade, where you can, starting from an empty database. Five built-in Metaverse Attributes are renamed:
Pausing work first¶
Bring the system to a standstill in two steps, in this order.
1. Disable all Schedules. A Schedule that fires mid-upgrade starts a run you are about to interrupt. Disabling stops the trigger without touching the definition. Built-in Schedules can be disabled too.
Do this from Configuration > Schedules in the administration UI, or from PowerShell, recording which were enabled before you disable them, so you can re-enable exactly those:
# Record what is currently enabled, then disable it
$wasEnabled = Get-JIMSchedule | Where-Object { $_.IsEnabled }
$wasEnabled | Select-Object Id, Name | Export-Csv ./schedules-enabled-before-upgrade.csv -NoTypeInformation
$wasEnabled | Disable-JIMSchedule -ChangeReason "Paused for upgrade"
Record the list, do not re-enable everything afterwards
Enabling everything afterwards also switches on Schedules disabled on purpose before the upgrade, and they start synchronising. Keep the list.
2. Let running Activities finish. Wait until Activities in the administration UI shows nothing In Progress. Large runs can take a while: the main reason to plan an upgrade window.
A run you stop part-way anyway does not resume: when the worker starts again, it fails the run's Activity with an explanatory error and removes the task from the queue. Your data is not at risk, because JIM's synchronisation state lives in the database and the next run continues from it. An import stopped part-way is the one case that needs more: JIM refuses to synchronise its Connected System until a Full Import of it completes (Troubleshooting Synchronisation). Draining first spares you the failed Activity and a long first run afterwards.
Upgrading with the installer¶
On Docker, the installer upgrades an installation it made, connected or air-gapped, keeping its settings. Do the steps in Before you upgrade first, then:
# In the new release's extracted bundle; upgrades to that release
sha256sum -c checksums.sha256
sudo ./setup.sh --upgrade
Check the bundle when you download it, before carrying it to the server: see Checking the Download.
It upgrades /opt/jim, or the folder JIM_INSTALL_DIR names. In order, it:
- Stops if the new release is not newer than the one JIM runs.
- Stops if
docker-compose.ymlordocker-compose.production.ymlhas been edited since it installed them, because it replaces them. Put your own changes in a compose file beside them, such asdocker-compose.local.yml, and start JIM once with it added (-f docker-compose.local.yml): the upgrade starts JIM with every compose file it was last started with. An installation made before it recorded them, incompose-files.sha256, is upgraded with a warning instead. Then it asks you to confirm the database and encryption keys are backed up (setJIM_SETUP_BACKUP_CONFIRMED=trueto answer in advance; a "no" cancels the upgrade). Nothing changes when it stops at this step or the one before. - Installs the release's compose files, keeping the previous ones and
.envbeside them asdocker-compose.yml.previous,docker-compose.production.yml.previousand.env.previous, setsJIM_VERSION, and saves the release's.env.examplebeside.env, naming any setting it adds that your.envdoes not mention. With the bundled PostgreSQL, it sizes the database's memory to the host where.envdoes not already (see Bundled PostgreSQL Memory). - Loads the release's images from the bundle, or downloads them, while the current version keeps running. With the bundled PostgreSQL, it keeps the image JIM runs now as
postgres:jim-previous, for rolling back, then moves JIM onto the release's PostgreSQL image, checking it against the ID the bundle records where Docker's classic image store needsJIM_DB_IMAGE. - Restarts JIM on the new version, which applies any database upgrade as it starts, and waits until JIM is ready. It keeps the release's copy of
setup.shin the installation.
Anything that fails before the restart puts the previous compose files and .env back, leaving JIM running as it was, and an earlier upgrade's .previous files intact. Then carry on at Check it worked.
Upgrading a connected deployment¶
The same upgrade by hand. On Podman, see Upgrading on Podman.
-
Stop the services, leaving the database running if it is the bundled container:
-
Take your backup (database plus encryption keys) per Backup & Disaster Recovery.
-
Update the compose files: download the release's as By Hand does, but without replacing
.env, and reconcile them with yours as for an air-gapped upgrade. Then pin the new version in.env: -
Pull the new images:
-
Start the services with every compose file and profile you deployed with. Add
-ffor any compose file of your own, such as-f docker-compose.local.yml, and leave out--profile with-dbif you use your own PostgreSQL server: -
Verify, per Check it worked below.
Upgrading an air-gapped deployment¶
The same upgrade as the installer's, by hand.
-
Check, transfer and verify the new release bundle via your approved process: check the download where you downloaded it (see Checking the Download), then extract and verify it on the JIM server:
-
Stop the services and take your backup, as in steps 1 and 2 above.
-
Load the new images, PostgreSQL's included: a release can move the bundled database to a newer PostgreSQL 18 image, which only the bundle can supply. With the bundled PostgreSQL, first keep the image it runs, for rolling back, as the installer does.
-
Reconcile the compose files. The bundle ships its own
compose/directory. Diff it against your deployed copies rather than overwriting them, so local customisations (volumes, ports, reverse-proxy wiring) survive, and checkcompose/.env.examplefor new variables. Upgrading from v0.16.0 or earlier with the bundled PostgreSQL, add its memory settings to.env, sized as the installer would (see Bundled PostgreSQL Memory): without them it uses defaults for a 4 GB host. Copy the bundle'ssetup.shover the installation's copy (/opt/jim/setup.shby default), so maintenance uses the new release's installer.If your
.envsetsJIM_DB_IMAGE(the installer sets it on Docker's classic image store, which cannot find the bundled PostgreSQL by its pinned digest), point it at the new bundle's PostgreSQL image, after checking that image's ID is the one the bundle records. Otherwise JIM carries on running the previous release's PostgreSQL.# In the extracted bundle image=$(docker load -i docker-images/postgres-18.tar | sed -n 's/^Loaded image: //p') id=$(docker image inspect -f '{{.Id}}' "$image") grep -qxF "$id" docker-images/postgres-18.image-ids \ && sed -i "s|^JIM_DB_IMAGE=.*|JIM_DB_IMAGE=$id|" /opt/jim/.env \ || echo "Not the PostgreSQL image this bundle ships: check it with sha256sum -c checksums.sha256" -
Pin the new version in
.env(JIM_VERSION=0.14.0) and start the services, using the same-ffiles and--profileflags you deployed with:docker compose -f docker-compose.yml -f docker-compose.production.yml \ --profile with-db up -d --pull never--pull nevermakes Docker report an image the bundle did not load, rather than try the internet. -
Verify, per Check it worked below.
Upgrading on Podman¶
On Podman, an upgrade replaces the pod files and restarts JIM: see Upgrading on Podman. Do the steps in Before you upgrade first, and Check it worked afterwards.
What happens during the upgrade window¶
The web interface is briefly unavailable after an upgrade while JIM starts:
- The worker leads.
jim.workerinitialises first and applies any database upgrade. - Built-in configuration catches up. The worker then adds any built-in configuration the release ships that your instance lacks, such as a new Service Setting or built-in Schedule, and leaves everything already present as it is, including settings you have changed. Anything it adds appears in the change history under a System Initialisation Activity.
- The web and scheduler wait.
jim.webandjim.schedulerpoll JIM's readiness and do not start until the database upgrade has completed and JIM has left maintenance mode.jim.weblogsJIM.Application is not ready yet. Sleeping...once per second while it waits. - Readiness is externally observable.
GET /api/v1/health/readyreturns503 Service Unavailablewith"status": "not_ready"throughout, then200 OKwith"status": "ready"once JIM is serving.
Most database upgrades are near-instant; one that rewrites a large table scales with your object count, so time it against a production-sized staging environment first.
If the database upgrade fails
The worker logs the full error and JIM stays unready, so the web interface never opens. Fix the cause (usually a permissions problem on the database user) and restart the services. Do not restore a backup unless the upgrade has left the schema in a state you cannot move forwards from.
After the upgrade: export rule coverage¶
From v1.0.0 or earlier, the worker records, while idle, which accounts each export Synchronisation Rule already covers. Until then, a rule starting to cover an account sends only changed attributes, not everything it writes.
Check it worked¶
-
All services are healthy:
-
The new version is running:
Or from PowerShell:
-
JIM reports itself ready:
-
Secrets still decrypt. Run an import against a Connected System that authenticates with a stored credential; a successful connection proves JIM can decrypt what the database holds. A "Failed to decrypt credential" error means the key volume did not come across; stop and resolve that before any synchronisation.
-
Re-enable the Schedules you disabled. Only once the checks above pass, and from the list you recorded in Pausing work first, so Schedules already disabled before the upgrade stay disabled:
Import-Csv ./schedules-enabled-before-upgrade.csv | Enable-JIMSchedule -ChangeReason "Re-enabled after upgrade"Or from Configuration > Schedules in the administration UI.
-
Scheduled work resumes. Confirm each re-enabled Schedule shows a sensible next run time, and that its next run fires.
An upgrade is not finished until the Schedules are back on
Leaving Schedules disabled is a silent failure mode: JIM appears healthy, the version check passes, and nothing synchronises until someone reports stale data days later.
Credential errors after upgrading¶
JIM never moves a password through an Attribute Flow: attributes holding credentials, such as unicodePwd, userPassword and password, are never managed. When an upgrade adds a name to that list, any value JIM was holding for such an attribute in a Pending Export or on a Connected System Object is deleted as the database is upgraded. An Attribute Flow that uses one shows an error on its Synchronisation Rule, and every export run reports it as Credential Not Exported. To clear it:
- Remove the Attribute Flow. Open each Synchronisation Rule that shows the credential error and delete the Attribute Flow it names. Until you do, the rule cannot be saved.
- Remove the source of the value. The password usually came from an import Attribute Flow into a Metaverse Attribute. Remove that flow and clear the Metaverse Attribute, or the password stays in the Metaverse. To deliver passwords to the system, set up Password Synchronisation instead, where its Connector supports it (the SCIM Connector does not).
- Clear the change history. Change history from before the upgrade can still show the value until it passes the
History.RetentionPeriodService Setting (90 days by default), when it is removed; shorten that setting for a pass if it must go sooner, then restore it.
Upgrading the PowerShell module¶
The PowerShell module versions in step with JIM; upgrade it wherever it is installed, so automation matches the API it calls.
# Connected environments
Update-Module -Name JIM
# Air-gapped: copy from the new release bundle
Copy-Item -Recurse -Force ./powershell/JIM "$env:USERPROFILE\Documents\PowerShell\Modules\"
For the other ways to install it, see PowerShell Module.
Rolling back¶
Rolling back means returning both halves of JIM to their pre-upgrade state: the application version and its database. A release can upgrade the database, leaving the schema ahead of what the older version understands, so reverting the images alone is not a rollback.
-
Stop the services:
-
Restore your pre-upgrade backup, database and encryption keys together from the same backup set, by the procedure in Backup & Disaster Recovery. It restores the database into an empty one, which takes away everything the newer release added as well as everything JIM has written since the upgrade. Go on only once
pg_restorehas finished without reporting an error. -
Point
JIM_VERSIONback at the previous release in.env, and put back any compose file you replaced:After an upgrade by the installer, put its
.previousfiles back instead, which also returns the compose files and anyJIM_DB_IMAGEto the previous release's: -
Start the services with every compose file and profile JIM was started with before the upgrade, as in step 5 of a connected upgrade:
cd /opt/jim docker compose -f docker-compose.yml -f docker-compose.production.yml \ --profile with-db up -dIf Docker cannot resolve or download the PostgreSQL image, the previous one was not kept as
postgres:jim-previousand has gone. Load the previous release's images from its bundle, then run the command again:# In the previous release's extracted bundle for f in docker-images/*.tar; do docker load -i "$f"; doneWithout
docker-compose.production.yml, every container reports healthy butjim.webpublishes no port, so JIM is unreachable. The stoppedjim.webcontainer records which compose files JIM was started with: -
Verify as you would after an upgrade, per Check it worked, and re-enable your Schedules.
Do not run an older JIM against an upgraded database
Starting the previous version without restoring the database leaves the older application reading a schema built for the newer one. Always restore the backup first, and only by the restore procedure: restoring over the upgraded database (pg_restore --clean) leaves part of what the newer release added in place, and the older JIM starts on that mixture without complaint. If you have no usable pre-upgrade backup, do not roll back at all: stay on the new version and resolve the problem there, because an older JIM against a newer schema fails in subtle ways rather than refusing to start.
Roll back promptly, or not at all
A rollback discards everything JIM has written since the upgrade, the Connector Space included, so the next run re-evaluates whatever has changed since. Decide quickly, and prefer fixing forwards once real synchronisation has happened on the new version.
Upgrade checklist¶
- Release notes reviewed for breaking changes and new configuration.
- Upgrade rehearsed in staging.
- Enabled Schedules recorded, then disabled.
- Running Activities allowed to complete.
- Services stopped, then database and encryption keys backed up as a matched pair.
- Previous images retained for rollback.
-
.envreconciled against the new.env.example(the installer's upgrade names new settings for you), or on Podmanjim-config.yamlagainst the release's copy. - New version confirmed via
/api/v1/health/version. - Readiness confirmed via
/api/v1/health/ready. - A Connected System with a stored credential confirmed to connect (proves the keys survived).
- Previously-enabled Schedules re-enabled, and the next run confirmed to fire.
- PowerShell module upgraded to match.
Related¶
- Upgrading on Podman: the upgrade and rollback on Podman.
- Backup & Disaster Recovery: what to back up, how, and how to restore it.
- Deployment Guide: volumes, compose profiles, production readiness checklist.
- Configuration Reference: environment variables, including
JIM_VERSION. - Troubleshooting: diagnosing startup and connectivity problems.