Recovering midPoint with Ninja

When midPoint will not start or the administrator is locked out, Ninja can work directly on the repository. This page explains what it does, where it bypasses safeguards, and how to plan a recovery with controls.

On this page

When teams reach for Ninja to recover midPoint

Ninja is the tool teams reach for when midPoint cannot be administered through its normal interface. Ninja is Evolveum's command-line tool for working directly on the midPoint repository layer, so it is the path to take when the administrator is locked out of the web interface or when midPoint will not start after a bad configuration change, a failed schema update or a corrupted object. In those cases, the choice is rarely between Ninja and a clean fix in the GUI. It is between Ninja and a rebuild or restore from backup, and the team should make that comparison deliberately before running anything.

Ninja should be a last resort, and it needs controls around it before anyone types a command. Confirm who on your side is authorized to run it, where it will be executed, and how the change will be recorded, because it operates below the layer that enforces authorizations, writes audit records and runs the model. Take a verified database backup and a copy of the midPoint home directory first, and agree in advance which operations the team may perform. Check the Ninja documentation for the commands and versions that match your installed release, and test the procedure on a non-production copy before you rely on it in an incident.

A short incident record is the most useful control. Note the symptom, the midPoint version and the Java and PostgreSQL versions in use, the change that preceded the failure, and each Ninja command with its output. This record helps the Evolveum support team if you open a subscription case, and it tells your security and compliance staff what changed without going through governance. Plan the follow-up work too: restore normal administrator access through the standard path once it is possible, review whether any object was changed outside the model, and decide whether the bypass needs to be reported under your change policy.

Recovery options and when each fits

This table compares the four ways to recover a locked-out or broken midPoint: Ninja commands, direct object repair, restoring from backup, and Evolveum support. Read each row for when the option fits, what it skips, and what to confirm before you touch production. The main takeaway is that Ninja is a targeted tool that bypasses midPoint's safety checks, so it should be the step after a backup and a clear diagnosis, not the first move.

Recovery pathWhen it fitsWhat it bypassesWhat to confirm before use
Ninja password reset or account unlockAdministrator is locked out and no other administrator can sign in to the GUI or REST APIAuthorizations, audit logging and model-level processing, because Ninja works on the repository layerWho approves the change, that a backup exists, and that the account is reset to a known state afterward
Ninja direct repair of a corrupted objectA stored object cannot be read or loaded and the fault is confined to one objectModel validation, mappings and provenance, so the repaired object may be accepted without the checks normal edits triggerThe exact object and field at fault, a copy of the original XML, and that a midPoint recompute or reconciliation is planned afterward
Restore from backupCorruption is widespread, the cause is unclear, or several objects and the schema state are in doubtNothing in midPoint is bypassed, but changes made after the backup point are lostBackup age, restore procedure tested in a non-production environment, and whether the audit database must be restored to match
Evolveum support under a subscriptionDiagnosis is uncertain, a product bug is suspected, or the repair needs a vendor-confirmed procedureNothing is bypassed; the work follows vendor guidance on your environmentWhich Product Support SLA applies (8x5 next-business-day or 24x7, per Evolveum's support subscriptions page) and whether your subscription covers the affected release
Start from a non-production copy firstYou need to test a repair or reset before changing productionNothing is bypassed in the copy, which lets you verify the effect of a Ninja command safelyThat the copy matches production's repository version and that the copy can be discarded afterward
Record the change after recoveryAny Ninja action has been taken on productionNot applicable; this step restores the audit trail that Ninja did not writeTicket reference, operator name, command used, and a follow-up review of affected objects

How to run a Ninja recovery safely

This sequence turns an unplanned recovery into a controlled change: you confirm the failure is one Ninja can fix, protect the repository and midPoint home, make a single documented change, and leave a record that someone else can review.

  1. Confirm the failure type first

    The administrator who owns the platform decides whether Ninja is the right tool. Check the midPoint logs and the startup output to identify whether the problem is a forgotten administrator password, a locked account, or an object in the repository that the model cannot load. Write down the exact error, the midPoint version, and the node affected. Ninja is the wrong tool for a misconfigured connector or a network fault, so if the symptom points elsewhere, stop here and investigate that first. This step is complete when the failure is named in one sentence that the rest of the team agrees with.

  2. Take a verified backup

    Before any change, back up the PostgreSQL repository and the midPoint home directory, including the keystore that holds encryption keys. Ninja writes directly to the repository, so this backup is the only reliable way back if the command makes things worse. Store the copy outside the affected host and confirm that the backup file or snapshot can be read. A restore test on a separate environment is the strongest check, and the backup topic in this group covers what a complete backup includes. The step is done when a named, readable copy exists and someone other than the operator has confirmed it.

  3. Stop the affected nodes

    Stop every midPoint node that connects to the repository you are about to change, so no running task or user session writes over the Ninja change. In a multi-node deployment, check that the load balancer no longer routes traffic to the stopped nodes. Confirm the process is gone, not just unresponsive, by checking the service status and the listening ports. Record which nodes were stopped and when. The step is complete when no midPoint process is writing to the target repository.

  4. Run the documented Ninja command

    Run the single Ninja operation that matches the failure type, using the exact command syntax in Evolveum's Ninja documentation rather than a command recalled from memory or copied from a forum. Use a configuration file that points to the correct repository, and keep the command and its output in your change record. Do not combine several operations in one run, because a single change is easier to verify and reverse. The step is complete when Ninja reports that the operation finished without error and the output matches what the documentation describes for that command.

  5. Restart and verify login

    Start one midPoint node, then watch its startup log until the application reports that it is ready. Log in with the account you repaired and confirm that the password or lock status is what you expected. Check that the affected object loads in the user interface or through a read-only API call. Only then bring the remaining nodes back. The step is complete when a fresh login succeeds and the repaired object can be viewed without errors in the logs.

  6. Audit the change manually

    Because Ninja works at the repository layer, midPoint does not record the change in its audit trail, and authorizations and model processing are skipped. Write down what changed, which rows or objects were touched, who ran the command, and why. Compare the object before and after the change where you can, and ask a second administrator to review the record. Confirm that no other objects were altered during the run. The step is complete when the manual record exists and the reviewer has signed off.

  7. Record the recovery and close the incident

    Add the incident to your operations log with the failure type, the Ninja operation used, the backup reference, the restored state, and the follow-up actions. Ask whether the root cause needs a fix in configuration, a connector, or a process change, so the same failure does not require Ninja again. Confirm with your security team whether the administrator account needs a new credential and whether any access review is needed. The step is complete when the incident is closed with an owner for each follow-up item.

Security risks of bypassing the model layer

Ninja writes directly to the repository, so the usual checks that midPoint applies to a change are not there to catch a mistake or misuse. The cards below cover what that gap exposes and the control to put in place for each one before anyone runs a recovery command.

Unaudited changes

Ninja operations do not pass through the model layer, so the change is not recorded in midPoint's audit trail. A password reset or object edit made this way can look like it never happened when someone reviews the audit history later. Before a recovery window, agree who records the command, the object affected and the reason in your change ticket, and capture the repository state before and after the operation.

Ninja docs

Skipped authorizations

Because Ninja works at the repository layer, midPoint's authorization rules are not enforced. Any operator with Ninja access can change objects that the normal administrator roles would block, including other administrator accounts. Check which OS users can run Ninja, and confirm that the approval for a recovery names the individual who will execute it rather than a shared administrative login.

Values written without mappings

Attributes set directly in the repository bypass mappings, object templates and policy rules. The object may look correct while downstream resources still hold stale or contradictory data, and the next reconciliation can then overwrite the fix or push the wrong value to target systems. After any Ninja change, run a targeted recompute or reconciliation on the affected objects and compare the results with the intended state.

Policies that do not run

Approval, assignment and lifecycle policies are evaluated by the model, so a repository-level edit can leave a user with access that should have required sign-off or been removed on a leaver event. Review the assignments and role memberships of every object touched during recovery, and confirm that no access was granted or kept without the policy path that would normally govern it.

Credentials handled outside normal controls

Password resets performed through Ninja can leave the new secret in shell history, terminal logs or chat messages, and the stored credential may not follow the password storage policy your team expects. Use a dedicated recovery procedure that avoids putting secrets on the command line, rotate any credential that was exposed, and require the administrator to change the password at the next login.

Access to the Ninja host and database

Anyone with shell access to the midPoint server or with write access to the repository database can make the same changes Ninja makes, with no midPoint audit record at all. Limit login to the Ninja host to a named group, use separate database accounts for application and maintenance work, and log database sessions and privileged shell use so that recovery access can be reviewed afterward.

Fixing corrupted objects without creating new drift

Start by deciding whether the object is actually corrupted or simply wrong in midPoint's view of the world. A corrupted object is one that midPoint cannot read, parse or process correctly, typically surfacing as errors when the object is opened in the GUI or during a task. Before running any Ninja command, capture the object's XML from the repository, note the error text from the logs, and record which connected resources the object feeds. This evidence tells you whether you are repairing data inside midPoint, or whether the fault lies in a resource attribute that midPoint is correctly reflecting. Confirm the exact Ninja subcommands and their options for your release in the Evolveum Ninja documentation before you touch the repository.

The core risk is that a repository-level repair changes what midPoint stores without running the model. Because Ninja skips model-level processing, mappings, policy rules and provisioning do not run, so target systems are not told about the change. An account that looks correct in midPoint can therefore still differ from what a connected resource holds, and the next reconciliation may then produce unexpected changes in either direction. Ninja also does not enforce authorizations or write audit records, so the repair leaves no trace in the audit history that your reviewers would expect to see. Treat any direct edit as a change that must be reconciled against each affected resource afterwards.

Choose the recovery path before you edit anything. Use a reconciliation task when the repository data is valid and the drift is between midPoint and a resource, because the model will then apply changes and record them. Restore from a verified backup when the corruption is widespread, when you cannot establish what the correct state was, or when the damage may have been written by a faulty change that already reached resources. Ask your team to confirm the backup's age and completeness first, and plan a reconciliation of the affected resources after any restore so that the restored state and the live systems agree again.

Limits to confirm before a recovery

Ninja works directly against the midPoint repository, so the version pairing, runtime stack and database reachability decide whether a recovery is possible at all. Support coverage decides who you can call if the procedure goes wrong. Confirm each item below before you touch production data.

Matching midPoint and Ninja versions

Confirm that the Ninja distribution you run matches the exact midPoint release installed in the environment, including the minor version. Check the release you are on against the support window before choosing a recovery path. A mismatched Ninja can read or write the repository in ways the running midPoint does not expect, so record both versions in the change ticket before running any command.

LTS release line
4.8
midPoint releases

Java runtime for the release

Confirm the Java version the midPoint release recommends, and run Ninja on a supported runtime from the same platform. midPoint recommends Java 25 for 4.11 and later, with Java 21 supported, and Java 21 for 4.10 and older, with Java 17 supported. A recovery host on an unsupported JVM can fail in ways that look like database faults, so check before you troubleshoot the data.

System requirements

PostgreSQL version and reachability

Confirm the PostgreSQL version against the midPoint system requirements and check that the recovery host can reach the database server directly, including firewall rules, TLS settings and credentials. Ninja needs the repository connection to do anything useful. If the database is only reachable through the midPoint application network path, plan the recovery host placement before the incident starts.

Whether support covers the incident

Check your Evolveum subscription type before the incident. Product Support subscriptions cover resolving product bugs under an 8x5 next-business-day or 24x7 SLA, while Platform Subscriptions add feature development and roadmap influence. Confirm in writing whether a recovery caused by a suspected product defect is covered, and how a recovery performed by your own team or a partner is handled.

Support subscriptions

Backups and a rollback point

Confirm that a recent backup of the repository exists, that it has been restored successfully in a test environment, and that the keystore and midPoint home configuration are captured with it. Ninja changes are not audited through the normal path, so a verified backup is the only reliable way back. Record the backup timestamp and the exact commands you expect to run before starting.

Authority to bypass the model layer

Confirm who approves a repository-level change, since Ninja skips authorizations, audit records and model processing. Agree in advance which objects may be edited, who reviews the before and after state, and how the change is recorded in your own log. Without that approval, a fast fix can leave identity data inconsistent with the rest of the system.

Ninja docs

Questions teams ask before a midPoint recovery

Can our internal team run Ninja recovery on its own?

Yes, if your administrators already operate midPoint, have database access and can work from a tested backup in a non-production copy first. Ninja works directly on the repository layer, so the person running it needs to understand what the command changes and what it skips. Teams without a PostgreSQL and midPoint operations background usually benefit from a second pair of eyes before touching production. Evolveum's Ninja documentation is the starting point, and you should confirm the command set and options against the version you run.

What drives the effort of a midPoint recovery?

The effort depends on how the failure looks and how much of the system is affected. The main drivers are whether the midPoint node will not start or only one account is locked, how many objects are corrupted, whether backups exist and have been restored before, and whether the audit database is separate. Each change also needs to be recorded and reviewed, because Ninja changes bypass normal audit. Ask any provider to split the work into diagnosis, repair in a copy, production repair, verification and a written record of what changed.

What does the recovery need from the business and security teams?

The business owner needs to confirm which identities, roles and resources matter most, so the team restores the right access first. Security needs to approve the use of an out-of-band administrative path, agree who may authorize it, and review the change record afterward. Compliance teams should know that changes made through Ninja are not audited by midPoint itself, so they need an alternative evidence trail. Agree these roles and sign-offs before an incident, not during one.

Does Evolveum support work differently from a Ninja operation?

Yes. Evolveum Product Support subscriptions cover resolving product bugs, with an 8x5 next-business-day or 24x7 SLA depending on the plan, while a Ninja operation is hands-on repair of your own installation. Support helps diagnose whether the problem is a product defect and what the fix path is, but your team or a partner still runs the commands in your environment. Check the current terms on Evolveum's support subscription page before assuming coverage for a specific incident.

How long does a midPoint recovery take?

The duration is driven by the same factors as effort: scope of corruption, quality of the latest backup, the time needed to restore to a copy, and the approvals required before production changes. A lockout on a single administrator account is usually a much smaller task than a corrupted repository with a failed startup. No duration figure is given here because it depends on your environment. Ask for a timeline that separates each phase and states which dependencies sit outside the work, such as backup access or change windows.

How do we prevent a repeat of a Ninja recovery?

Most repeats come from the same gaps: no tested restore, no clear owner for the administrator account, and no monitoring of startup or database health. Keep a documented break-glass procedure, store a current backup that includes the repository, audit database and keystore, and test restoration on a schedule. Review who holds administrative roles and how passwords and keys are stored. Keep midPoint on a supported release so that fixes are available, and monitor the node so that failures are seen early.

Should we bypass the model layer ourselves to save time?

Only for well-understood, narrow repairs, and only after the change is rehearsed in a copy. Bypassing the model layer means authorizations are not enforced, changes are not audited and model-level processing is skipped, so related attributes, links or provisioning side effects may not update as expected. Write down each change, run reconciliation or a recompute afterward where appropriate, and confirm the result with the business owner. Broad or unclear repairs are better handled by an experienced operator or the vendor.

Which recovery path fits a midPoint lockout or startup failure?

The path starts when midPoint fails to start or the administrator is locked out, then moves to checking logs and confirming that a recent backup exists. From there the team chooses one of three routes: a targeted Ninja repair, a restore from backup, or engaging Evolveum support. Whichever route is taken, the change must be verified and recorded, because Ninja works at the repository layer and skips authorization, auditing and model processing.

Decision path from failure detection to verified and recorded recovery.

How DeployOpen scopes and delivers midPoint recovery

DeployOpen approaches Ninja recovery as a bounded engagement inside your own infrastructure, starting with the written scope and a clear record of what was changed. We work on midPoint deployments we plan, implement, harden and support, and we document each recovery step so your team can review and repeat it.

How we scope

  • Confirm the midPoint version, database, and deployment model before any Ninja command is run.
  • Agree in writing which accounts, objects or repository records are in scope for recovery.
  • Define which changes must be audited through midPoint and which will be recorded manually.
  • Fix deliverables and timelines in a fixed-scope agreement before the work starts.

How we build

  • Take and verify a repository backup before touching any object or credential.
  • Run Ninja commands against a copy of the environment first, where your setup allows it.
  • Review each corrupted object and its dependencies to avoid repairs that break related assignments.
  • Test that administrator sign-in and the affected workflows work again before closing the change.

How we hand over

  • Deliver a written record of each command, its purpose, the affected objects and the outcome.
  • Document the root cause and the steps needed to prevent a repeat lockout or corruption.
  • Walk your administrators through the recovery runbook and the cases where Ninja should not be used.
  • Agree which follow-up items, such as audit review or access re-certification, belong to your team.

How we support

  • Offer ongoing support, upgrades and continuous testing as a retainer after the recovery is complete.
  • Plan regular backup restore tests so recovery steps stay current with your environment.
  • Review midPoint version and support dates with you so upgrades stay on supported releases.
  • Confirm with you and Evolveum where vendor product support subscriptions fit your recovery plan.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.