Skip to content

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.

JIM through an upgrade, from paused to finished Before an upgrade, disable the Schedules, recording which were enabled, and let running Activities finish, so JIM is paused with nothing In Progress. Once the services are stopped and backed up, the new release starts: while the worker applies any database upgrade, JIM is not ready and /api/v1/health/ready returns 503. If the database upgrade fails, JIM stays unready. Once it completes, JIM is ready and the endpoint returns 200, but the Schedules are still off. The upgrade is finished only when you have checked it worked and re-enabled the Schedules you recorded, so scheduled work resumes. new release started database upgraded failed: stays unready Schedules back on once checked; those you recorded Finishedscheduled work resumes PausedSchedules off,nothing In Progress Not readyreadiness: 503 Ready200; Schedules off JIM through an upgrade, from paused to finished Before an upgrade, disable the Schedules, recording which were enabled, and let running Activities finish, so JIM is paused with nothing In Progress. Once the services are stopped and backed up, the new release starts: while the worker applies any database upgrade, JIM is not ready and /api/v1/health/ready returns 503. If the database upgrade fails, JIM stays unready. Once it completes, JIM is ready and the endpoint returns 200, but the Schedules are still off. The upgrade is finished only when you have checked it worked and re-enabled the Schedules you recorded, so scheduled work resumes. new release started database upgraded failed: stays unready Schedules back on once checked; those you recorded Finishedscheduled work resumes PausedSchedules off, nothing In Progress Not readyreadiness: 503 Ready200; Schedules off

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.md for the target release (on the releases page, or under docs/ 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 prune until the new version is verified; they are your fastest rollback. Air-gapped, keep the old bundle.
  • Compare .env.example with your .env. New releases can add variables (Configuration Reference).
  • Upgrading from v0.18.0 or earlier:
    • With Microsoft Entra ID, set "requestedAccessTokenVersion": 2 in 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_SCOPE if people sign in to JIM's API through your identity provider, with Connect-JIM or the API reference's Try It: where the audience JIM requires is JIM_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).
  • Upgrading from v0.17.0 or earlier:
    • With your own PostgreSQL server, run ALTER DATABASE jim SET jit = off; (why).
    • Expect a longer first Delta Import per LDAP partition: each reads every object once.
    • On OpenLDAP, keep olcAccessLogPurge over twice the longest gap between Delta Imports (why).
  • 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, StreetAddress and WebPage become 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 ADFS again first (Keep the registration right): the portal asks AD FS for the allatclaims scope, 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 in X-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 password attribute exports nothing, as Credential errors after upgrading describes.

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:

# Upgrades to the latest release
curl -fsSL https://junctional.io/get | sudo bash -s -- --upgrade
# 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:

  1. Stops if the new release is not newer than the one JIM runs.
  2. Stops if docker-compose.yml or docker-compose.production.yml has been edited since it installed them, because it replaces them. Put your own changes in a compose file beside them, such as docker-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, in compose-files.sha256, is upgraded with a warning instead. Then it asks you to confirm the database and encryption keys are backed up (set JIM_SETUP_BACKUP_CONFIRMED=true to answer in advance; a "no" cancels the upgrade). Nothing changes when it stops at this step or the one before.
  3. Installs the release's compose files, keeping the previous ones and .env beside them as docker-compose.yml.previous, docker-compose.production.yml.previous and .env.previous, sets JIM_VERSION, and saves the release's .env.example beside .env, naming any setting it adds that your .env does not mention. With the bundled PostgreSQL, it sizes the database's memory to the host where .env does not already (see Bundled PostgreSQL Memory).
  4. 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 needs JIM_DB_IMAGE.
  5. 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.sh in 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.

  1. Stop the services, leaving the database running if it is the bundled container:

    docker compose stop jim.web jim.worker jim.scheduler
    
  2. Take your backup (database plus encryption keys) per Backup & Disaster Recovery.

  3. 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:

    # Previously JIM_VERSION=0.13.0
    JIM_VERSION=0.14.0
    
  4. Pull the new images:

    docker compose pull
    
  5. Start the services with every compose file and profile you deployed with. Add -f for any compose file of your own, such as -f docker-compose.local.yml, and leave out --profile with-db if you use your own PostgreSQL server:

    docker compose -f docker-compose.yml -f docker-compose.production.yml \
      --profile with-db up -d
    
  6. Verify, per Check it worked below.

Upgrading an air-gapped deployment

The same upgrade as the installer's, by hand.

  1. 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:

    # Where you downloaded it, before transferring it
    sha256sum -c jim-release-0.14.0.tar.gz.sha256
    
    # On the JIM server
    tar -xzf jim-release-0.14.0.tar.gz
    cd jim-release-0.14.0
    sha256sum -c checksums.sha256
    
  2. Stop the services and take your backup, as in steps 1 and 2 above.

  3. 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.

    docker tag "$(docker inspect -f '{{.Image}}' jim.database)" docker.io/library/postgres:jim-previous
    
    # In the extracted bundle
    for f in docker-images/*.tar; do docker load -i "$f"; done
    
  4. 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 check compose/.env.example for 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's setup.sh over the installation's copy (/opt/jim/setup.sh by default), so maintenance uses the new release's installer.

    If your .env sets JIM_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"
    
  5. Pin the new version in .env (JIM_VERSION=0.14.0) and start the services, using the same -f files and --profile flags you deployed with:

    docker compose -f docker-compose.yml -f docker-compose.production.yml \
      --profile with-db up -d --pull never
    

    --pull never makes Docker report an image the bundle did not load, rather than try the internet.

  6. 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.worker initialises 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.web and jim.scheduler poll JIM's readiness and do not start until the database upgrade has completed and JIM has left maintenance mode. jim.web logs JIM.Application is not ready yet. Sleeping... once per second while it waits.
  • Readiness is externally observable. GET /api/v1/health/ready returns 503 Service Unavailable with "status": "not_ready" throughout, then 200 OK with "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

  1. All services are healthy:

    docker compose ps
    
  2. The new version is running:

    curl -s https://jim.your-domain.local/api/v1/health/version
    

    Or from PowerShell:

    Get-JIMVersion -Url "https://jim.your-domain.local"
    
  3. JIM reports itself ready:

    Get-JIMHealth -Url "https://jim.your-domain.local" -Ready
    
  4. 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.

  5. 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.

  6. 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:

  1. 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.
  2. 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).
  3. Clear the change history. Change history from before the upgrade can still show the value until it passes the History.RetentionPeriod Service 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.

  1. Stop the services:

    docker compose stop jim.web jim.worker jim.scheduler
    
  2. 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_restore has finished without reporting an error.

  3. Point JIM_VERSION back at the previous release in .env, and put back any compose file you replaced:

    JIM_VERSION=0.13.0
    

    After an upgrade by the installer, put its .previous files back instead, which also returns the compose files and any JIM_DB_IMAGE to the previous release's:

    cd /opt/jim
    for f in docker-compose.yml docker-compose.production.yml .env; do cp -p "$f.previous" "$f"; done
    
  4. 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 -d
    

    If Docker cannot resolve or download the PostgreSQL image, the previous one was not kept as postgres:jim-previous and 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"; done
    

    Without docker-compose.production.yml, every container reports healthy but jim.web publishes no port, so JIM is unreachable. The stopped jim.web container records which compose files JIM was started with:

    docker inspect -f '{{index .Config.Labels "com.docker.compose.project.config_files"}}' jim.web
    
  5. 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.
  • .env reconciled against the new .env.example (the installer's upgrade names new settings for you), or on Podman jim-config.yaml against 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.