Runbooks/Upgrades

Upgrades

This document covers how to roll forward (and back) between IdentityMesh releases without losing data or breaking running connectors.

What changes between releases

ComponentCarries state?How it’s upgraded
SQL schemaYes — the source of truth.The installer’s database step runs Deploy_All.sql, which adds whatever the release needs and leaves existing tables and data in place.
Service / API binariesNo — stateless.MSI version.
Relay agent binariesNo — stateless.MSI version (separate installer).
Connector DLLsImplicitly — connector configs reference connector type names. Renaming a connector type breaks existing schedules.Shipped in the Connectors\ folder of each host (service + each relay).
License fileYes — separate from binaries.Re-issued out-of-band by sales. RSA-4096 signed.
DPAPI secretsYes — see secrets-and-dpapi.md.Encrypted blob in the IdentityMesh database.

Pre-upgrade checklist

  1. Take a SQL backup. See backup-and-restore.md. This is the only thing that lets you roll back if the upgrade goes sideways.
  2. Snapshot the Connectors\ folder on every host (service + each relay) so you can roll a connector DLL back independently of the service version.
  3. Note the running version by checking the file properties on the .exe files under %ProgramFiles%\IdentityMesh\engine and %ProgramFiles%\IdentityMesh\api, or the Admin UI’s About page.
  4. Stop active sync runs. Either pause schedules in the Admin UI or wait for in-progress runs to complete. Any sync running when the service is stopped is marked Interrupted; the next service start reconciles the bookkeeping automatically.

Upgrade procedure

Same-version connector upgrade only

Drop replacement DLLs into the Connectors\ folder and restart the service (or relay agent). Connectors are loaded on startup.

Service / API version upgrade

  1. Pre-upgrade checklist above.
  2. Stop services:
    sc stop IdentityMeshEngine
    sc stop IdentityMeshAdmin
  3. Run the new MSI. It upgrades binaries in-place and preserves appsettings.json — file-copy rules are documented in installer.md.
  4. Database changes are applied automatically by the installer’s database step, which runs Deploy_All.sql against the configured database. The script only adds what is missing, so running it on an already-current database changes nothing. You do not need to run any SQL yourself. If your database is updated outside the installer, see Running the database step yourself.
  5. Start services:
    sc start IdentityMeshAdmin
    sc start IdentityMeshEngine
  6. Smoke test: dashboard loads, license shows valid, run history queryable, kick off one sync.

Running the database step yourself

Most installations never need this section. The MSI runs the database step on every install and upgrade and logs it to %TEMP%\IdentityMesh.DbSetup.log (a copy lands in the installed sql folder as dbsetup.log).

Run the step yourself only when the installer did not: your database team applies IdentityMesh database changes separately, or the database step failed during an upgrade. Always run the whole Deploy_All.sql. Do not pick individual scripts out of the folder; the master script runs every script in the right order and skips anything that already exists.

  1. Stop both services:
    sc stop IdentityMeshEngine
    sc stop IdentityMeshAdmin
  2. On the server where IdentityMesh is installed, open a command prompt as an account that can create tables in the IdentityMesh database. sqlcmd must be on the path (it ships with SQL Server Management Studio and with the SQL Server command-line tools).
  3. Change to the installed sql folder and run the master script. The script must be started from that folder:
    cd "C:\Program Files\IdentityMesh\sql"
    sqlcmd -S <server\instance> -d IdentityMesh -E -i Deploy_All.sql
    Replace <server\instance> with your SQL Server, and IdentityMesh with your database name if you changed it during install. Use -U <user> -P <password> instead of -E for SQL authentication. The script prints each phase as it runs.
  4. Start the services:
    sc start IdentityMeshAdmin
    sc start IdentityMeshEngine

Signs the step was skipped. After an upgrade, a page that depends on a new table shows its defaults and reports an error when you save, or the Sync Engine logs a startup error and runs no sync cycle. Run the steps above and restart the services. Each feature runbook names the symptom to look for.

Relay agent upgrade

Each relay agent is independently upgradeable. Order:

  1. Upgrade the central API/service first (or at least confirm the API is at a version that still accepts the relay’s old protocol — see “Version skew” below).
  2. For each relay host: stop the service, install the new MSI, start the service. The agent re-registers with the API on next connection.

Behaviour changes in this release

Most releases are drop-in. This one changes what several existing settings do, so read this section before you run the MSI and again before you re-enable schedules. Roll them out on a staging copy first if you can.

Act before the upgrade

Act after the upgrade

Expect to see

Version skew

The relay protocol is conservative — older relays against newer APIs generally work, and newer relays against older APIs generally work, as long as no hub method has been removed or changed in incompatible ways.

For deployments with many relays that can’t be upgraded simultaneously: a staged rollout (one canary relay first) catches incompatibilities cheaply during the upgrade window.

Connector DLL versioning

Connectors are loaded by name from the Connectors\ folder. IM_ConnectorSchedules references each connector by type name.

Rollback

Binary rollback

  1. Stop services.
  2. Run the previous version’s MSI:
    msiexec /i previous.msi REINSTALL=ALL REINSTALLMODE=vomus
  3. Roll back the schema if the upgrade applied any. The release notes for each version document whether down-migration is supported and what data, if any, is lost in the down direction. Test rollbacks in a staging copy of production data first.
  4. Start services.

Schema-only rollback (binary stays at new version)

Don’t. Migrations are designed to be applied in order. A binary that expects a column the schema doesn’t have will throw at runtime. If the new binary version is broken in a way that requires reverting just the schema, the right move is to roll back the binary too.

Data-only rollback (revert to backup)

See backup-and-restore.md.

Upgrade frequency considerations