How to apply a midPoint database schema upgrade without losing data
If your midPoint deployment is on a supported line and must move to a newer release, the database schema has to change with it. Each midPoint release ships non-destructive SQL upgrade scripts, usually ALTER TABLE commands that can run against a populated database, and the Reindex Repository task then fills the new columns from the object data already stored. This section covers that schema and reindex step within a wider upgrade. The step only makes sense once you have chosen a target release and confirmed the path, because midPoint's direct-upgrade rules require you to step through the supported versions in order rather than jumping straight to the newest one.
Before you run any script, take a full backup of the PostgreSQL repository and confirm that you can restore it, since the scripts change live tables. Confirm with Evolveum's database schema upgrade documentation which script belongs to your current and target versions, and match the midPoint distribution and the Ninja version to the release you are moving to. Also check the PostgreSQL server version against the midPoint system requirements, because the database and the application can be upgraded on different schedules.
After the scripts finish, start the Reindex Repository task as Evolveum highly recommends, and treat it as part of the upgrade rather than an optional tuning step. Until it completes, new columns may be empty for existing objects, so queries and policies that depend on them can return incomplete results. Plan a verification window to compare object counts, check that the midPoint UI and key tasks behave as expected, and keep the pre-upgrade backup until you have confirmed the result. Ask your DeployOpen or internal team to confirm how long the reindex is expected to run on your data volume before you schedule the change.
What a midPoint schema upgrade changes and what you must do
This table compares what each part of a midPoint schema upgrade changes, what that means for your database and running system, and what your team must do. Read the rows in order: schema scripts first, then the reindex, then the support dates that set how urgently you need to plan the move.
| Change | Impact | Action needed |
|---|---|---|
| New columns added by ALTER TABLE scripts | The scripts are non-destructive and can run on a populated database, so existing object data stays in place while new columns are added. | Back up the repository database first, then apply the script for your target release in a test environment before production. |
| New columns empty until reindex runs | Newly added columns hold no values for existing objects until the Reindex Repository task fills them from stored object data, so features that read those columns may behave incompletely. | Run the Reindex Repository task after the schema upgrade and confirm completion in the task logs before returning the system to normal use. |
| PostgreSQL-only repository change in 4.10 | Deployments on other repository databases must move to PostgreSQL before the 4.10 upgrade can proceed, which adds a migration step beyond the schema script. | Check your current repository type early and see the 4.9 to 4.10 upgrade topic for the required migration sequence. |
| midPoint 4.9 support end, 18 October 2026 | Running 4.9 after this date means no further support from Evolveum under the published release schedule. | Plan your move off 4.9 onto a supported line and confirm current support terms with Evolveum. |
| midPoint 4.10 support end, 26 November 2027 | Feature release 4.10 leaves support on this date, so a deployment on it will need a further move before then. | Schedule your next upgrade window with the 4.10 end date in mind, or choose the LTS line instead. |
| midPoint 4.8 LTS support end, 17 October 2028 | The LTS line is supported until this date, which gives a longer window between schema upgrades than feature releases. | Confirm your plan for the 4.8 LTS line and the upgrade path you will take before this date. |
Why the Reindex Repository task follows every midPoint database schema upgrade
The schema upgrade script adds structure, but it does not fill that structure. midPoint distributions ship non-destructive scripts, usually ALTER TABLE commands, that run against a populated database. Those scripts add new columns, but objects written before the upgrade may still hold no value in them. Queries, searches and features that read the new columns can then return incomplete results, and nothing in the schema change itself reports the gap. Evolveum highly recommends running the Reindex Repository task after schema upgrades so that new columns are filled from the object data already in the repository. Treat the reindex as part of the upgrade, not an optional tidy-up.
The task works because it re-reads each existing object and rewrites it so that the new columns are derived from the stored data. Its duration depends on how many objects the repository holds, so the reindex is a separate step with its own time window, and it should be planned as one. Before you schedule it, confirm in the release notes for your target version which columns and features depend on the reindex, and whether any other step must complete first. The Evolveum database schema upgrade documentation is the reference to check against those notes.
Do not assume the task completed because the upgrade script finished or because the scheduler shows the task as started. Open the task result in the midPoint user interface and confirm its final state, the number of objects processed and whether any errors were recorded. Compare the processed count with the number of objects you expect in the repository, and spot-check a few records that rely on the new columns. If the task failed or stopped early, rerun it before you start user-facing testing, because partially reindexed data can look correct until a specific query or report reads an unfilled column.
Preparing a verified backup and test environment before the schema change
A schema upgrade changes the database that holds every midPoint object, so the rollback path has to exist before the first ALTER TABLE runs. The cards below cover the backup, the restore test, the inventory of what touches the repository, the staging rehearsal and the PostgreSQL version check that together make the change reversible and verifiable.
Full PostgreSQL backup and restore test
Take a full backup of the midPoint repository database immediately before the upgrade window, then restore it on a separate PostgreSQL server and confirm midPoint starts against the restored copy. A backup that has never been restored is an assumption, not a rollback plan. The database administrator owns the backup and restore test, and the upgrade lead signs off on it. Keep the backup command output, checksum, restore log and the midPoint startup log from the restored server.
Schema upgrade docsContinuous archiving for point-in-time recovery
A nightly dump only restores the state at the moment it was taken, so any change made after it is lost if the upgrade fails hours later. Continuous archiving with a base backup and archived WAL files lets the team restore to a chosen moment just before the script ran. The database administrator decides whether this exists in production; the team should confirm it actually restores by testing it on the separate server. Record the recovery target time used in the rehearsal.
PostgreSQL archiving docsInventory of repository-touching customizations
Custom schema extensions, mappings, object templates, scripts and connectors can read or write fields that the upgrade changes, so they need to be listed before the change. Include anything that writes directly to the midPoint database tables, any external reporting that queries them, and any custom connector versions. The midPoint architect owns the inventory, and the reviewer should be able to match each item to a test case. Keep the inventory with the change ticket so later troubleshooting has a reference point.
Staging copy with matching versions
Build a staging environment from a recent copy of production data, running the same midPoint release and the same PostgreSQL major version as production. Run the full upgrade there first, then run the Reindex Repository task and time it against production-sized data. Differences in version or data volume make the rehearsal less useful, so confirm both with the platform owner before relying on the results. Keep the staging run log, the object counts before and after, and the list of failed tests.
PostgreSQL version on a supported line
Confirm the production database is on a PostgreSQL major version that still receives fixes, because a schema upgrade is a poor moment to discover an unsupported database engine. At the time of the supplied facts, supported majors were 14 through 18, with 14 ending on 12 November 2026. Ask the database owner to confirm the current minor release and the planned major upgrade date in your environment. Keep the version query output and the upgrade plan reference in the change record.
PostgreSQL versioning policyHow the backup, schema, reindex and verification phases connect
The sequence starts with confirming the starting version and taking a backup that you have tested for restore. Midpoint nodes are stopped before the target release's schema upgrade scripts run against the PostgreSQL repository, then the upgraded nodes start and the Reindex Repository task fills new columns from existing object data. Verification decides whether the upgrade is accepted or whether you roll back from the backup.
Phase order for a midPoint schema upgrade, with the rollback branch and the PostgreSQL repository.
The upgrade sequence with checks and rollback points
This sequence turns a midPoint schema upgrade into a series of checkpoints, so each change has a verified backup behind it and a clear point to stop or roll back. It produces a database that matches the target release, with repository objects populated for the new columns and evidence that the platform works.
Confirm the release path and current maintenance level
Before touching anything, confirm which release line you are on and which steps the target release requires. Check the midPoint releases page for support dates, confirm you are on the latest maintenance release of your current line, and review the Evolveum schema upgrade page for the target release. Owner: the midPoint platform lead with the DBA. Done when you have a written upgrade path that lists every intermediate release and the maintenance level each one needs. Rollback point: none yet, since nothing has changed.
Take a backup and prove it restores
Take a full database backup of the midPoint repository and, if you run one, the audit database. Restore that backup to a separate test copy of the database and start a test midPoint node against it, confirming it reaches the login page and lists objects. Owner: the DBA with the midPoint administrator. Done when the restored copy opens in midPoint and the restore time and steps are recorded. This verified backup is your primary rollback point for everything that follows, so do not proceed until the restore test succeeds.
Freeze changes and stop every node
Announce a change freeze so no one edits roles, resources or tasks during the window. Stop all midPoint nodes so no process writes to the repository during the schema change. Confirm that no node is still running, including any node in a separate cluster or a standby environment that reads the same database. Done when the process list and load balancer show zero active midPoint nodes. Rollback point: restart the nodes on the old version against the untouched database, which is still valid because no schema change has been applied yet.
Apply the schema upgrade scripts from the target release
Run the database schema upgrade scripts that ship with the target release distribution against the production repository, in the order the Evolveum schema upgrade page gives. Use the exact script names and commands from that release and the distribution you deploy, not from an older version. The scripts are usually non-destructive ALTER TABLE statements, but confirm this for your release. Owner: the DBA with the midPoint administrator. Done when every script reports success and the schema version recorded in the database matches the target release. Rollback point: if a script fails, restore the verified backup from the previous step before any node starts.
Start one node and check the logs
Start a single midPoint node running the target release, and leave the others stopped. Watch the startup log for schema errors, connector load failures, and warnings about missing columns or configuration keys. Log in through the user interface and confirm that the administrator account works and that a sample of resources and roles loads. Done when startup completes without errors and the single node serves requests. Rollback point: if the node cannot start cleanly, restore the verified backup and return to the old version, since no production writes have occurred yet.
Run the Reindex Repository task to completion
Create and run the Reindex Repository task from the midPoint administration interface on the one running node. Evolveum highly recommends this step after schema upgrades so that new columns are filled from existing object data. Monitor the task progress, error count and log output until it reports completion, and do not start other nodes or allow users to write during the run. Done when the task finishes with no unresolved errors and the new columns contain values for the sampled objects. Rollback point: until this task completes and is verified, the restored backup remains the safe point to return to.
Verify counts, sample reads and key tasks
Compare object counts for users, roles, organizations, resources and shadows with the counts recorded before the upgrade, and explain any difference. Read a sample of objects across each type, including accounts with assignments, and confirm the values match expectations. Run key scheduled tasks, such as a reconciliation or synchronization task against a test resource, and confirm they complete. Done when the counts reconcile and the sampled reads and tasks succeed. Only after this sign-off should you start the remaining nodes and reopen change control, since the first production write marks the point after which a rollback means restoring the backup and accepting the loss of later changes.
How PostgreSQL version changes alter the schema upgrade window
A minor PostgreSQL release fixes bugs and security issues within the same major version. PostgreSQL states that minor releases never change the internal storage format, so the database files stay as they are and the update amounts to replacing the executables and restarting the server. Because the data format is unchanged, the midPoint schema step does not depend on the minor update in the way a major change would, but the two should still be sequenced deliberately so that a failure has one clear cause.
- Sequencing: Apply the minor update in a separate change window before the midPoint upgrade, so any restart problem is not confused with a schema problem.
- Backup: Take a logical or physical backup before the restart, and confirm you can restore it to a test server.
- Version check: Record the exact PostgreSQL version before and after, and confirm the midPoint node reconnects cleanly.
- Support window: Check the current minor release for your major version against the PostgreSQL versioning policy.
- Rollback: Confirm the rollback step is replacing the old binaries and restarting, and that this has been rehearsed.
Ask your DBA to confirm the package source, the restart procedure for your packaging, and whether standbys are updated in the same window.
A major PostgreSQL upgrade changes the internal storage format, so the cluster must be converted or rebuilt before midPoint can run against it. The two common routes are a dump and restore with pg_dumpall, or pg_upgrade, which converts the data files in place. In PostgreSQL 18, pg_upgrade keeps planner statistics across the upgrade, adds parallel jobs and offers a --swap option, which can shorten the offline period for large databases. The midPoint schema upgrade script and reindex run after the new major version is live and the midPoint connection is verified.
- Sequencing: Upgrade PostgreSQL first, confirm midPoint connects and starts, then apply the midPoint schema upgrade scripts and run Reindex Repository.
- Backup: Take a full dump and a file-level backup before pg_upgrade, and keep the old cluster intact until verification is complete.
- Planner statistics: Plan for the statistics behavior on PostgreSQL 18, but still schedule an ANALYZE if the DBA recommends it.
- Downtime: The offline period depends on database size and the chosen method, so measure it on a copy of production before booking the window.
- Rollback: Confirm that the old binaries and data directory are preserved until the new cluster is accepted.
Ask your DBA to confirm the target major version against the supported list, the pg_upgrade options for your build, and the rollback point.
Logical replication copies data from the running old-version server to a new-version server, which lets you cut over with a short pause rather than a full offline conversion. PostgreSQL documents that logical replication works between different major versions and allows a major upgrade with only several seconds of downtime. The midPoint schema step still has to run against the new server, so the cutover timing and the schema scripts must be planned together, and the replication setup must be verified before the midPoint connection moves.
- Sequencing: Build the new server, replicate the data, apply the midPoint schema upgrade on the new server only after the copy is consistent, then run Reindex Repository before midPoint returns to full service.
- Backup: Take a backup of the source before replication starts and another immediately before cutover, since the cutover is the point of no easy return.
- Schema changes: Confirm with midPoint support that replicated tables and the schema upgrade do not conflict, because the upgrade alters tables that replication may be tracking.
- Downtime: The several-second figure is PostgreSQL's documented expectation, not a commitment for your environment, so test the cutover.
- Connectivity: Confirm that the midPoint connection string, pooling layer and any standby nodes are switched in one controlled step.
Ask your DBA to confirm the replication slot management, the conflict handling for schema changes and the monitoring of replication lag before cutover.
How to test a midPoint schema upgrade and roll back if it fails
Test the upgrade on a restored copy of production before touching the live repository. Restore the most recent verified backup into a separate PostgreSQL instance, run the same midPoint release, Java version and ALTER TABLE scripts you plan to use in production, then run the Reindex Repository task to completion. Record object counts by type before and after, and spot-check sample users, resources, roles and scheduled tasks by comparing their key attributes and links. Also confirm that the upgraded test node starts, that connector references still resolve and that scheduled tasks reappear with the expected schedules. Ask the vendor or your own runbook which objects should match exactly and which should change, because reindexing fills new columns and can legitimately alter some values. Treat any unexplained difference as a blocker.
Define rollback as restoring the verified backup to the pre-upgrade midPoint distribution and the pre-upgrade database schema state, then starting the old version against it. Rehearse this on the test copy so the team knows the commands, the time it takes and who approves the decision. The main risk is timing. Once the upgraded system accepts new writes, such as approvals, certifications, provisioning results or user changes, rolling back to the backup discards those changes, and any target systems already updated may now disagree with the repository. Set an explicit go or no-go point, usually before users and automated tasks resume, and agree how post-cutover changes would be recovered or reconciled if you must roll back later.
High availability does not replace a backup. A hot standby or a synchronous or asynchronous replica copies changes from the primary, so an incorrect schema change or a bad reindex is replicated too. Replication protects against hardware loss, not against logical damage. PostgreSQL also does not detect a primary failure and promote a standby on its own, so automatic failover requires external tooling that your team must select, configure and test. Point-in-time recovery from archived WAL, described in the PostgreSQL continuous archiving documentation, is the mechanism that can return the database to a moment before a bad change. Confirm with your DBA that archiving is active and that a restore to a chosen point has been tested before the production window.
What makes a midPoint schema upgrade take longer
This table compares the factors that lengthen a midPoint schema upgrade and repository reindex, and what each one adds to the work. Read each row as a question to answer about your own environment before you agree a plan or a quote. The main takeaway is that reindex time and rollback risk grow with data volume, customization and the number of environments, so size those first.
| Driver | Why it adds effort | How to size it |
|---|---|---|
| Repository size and object count | The Reindex Repository task reads existing object data to fill new columns, so more objects mean a longer run and a longer window where the system is not fully usable. | Ask for the object counts per type from a copy of production and run a timed reindex in a test environment first. |
| Custom schema extensions and mappings | Extensions and mappings can depend on columns or object structures that change between releases, which adds review and retesting after the schema change. | List every schema extension, object template and mapping, and mark which ones touch objects the reindex will populate. |
| Connectors and resources that depend on the database | Resources and synchronization tasks read from midPoint's repository, so a stalled or inconsistent reindex can affect provisioning and reconciliation. | Count the active resources and scheduled tasks, and decide which must be paused during the window. |
| PostgreSQL version gap and major upgrade scope | Minor releases keep the storage format, but a major upgrade needs a separate migration method and its own rehearsal, so the work grows with the version gap. | Confirm the current PostgreSQL major version against the supported versions list, and state whether a major upgrade is in scope or separate. |
| Number of midPoint nodes and maintenance window | Nodes share one central database, so the schema change and node restarts must be coordinated, and mixed versions across nodes are not allowed. | Count nodes and the load balancer steps, then agree a window that includes stopping, upgrading and restarting all nodes. |
| Restore-tested backup | A backup that has never been restored gives little protection if the upgrade fails, and restore testing adds time before the change. | Confirm a recent full backup exists and that a restore into a separate database has been tested and timed. |
| Number of environments upgraded in order | Test, staging and production must each run the same steps in sequence, so every environment multiplies the rehearsal and verification work. | Plan one rehearsal per environment, and record the reindex duration from each to refine the production window. |
What teams ask before running a midPoint schema upgrade themselves or with a partner
How much does a midPoint schema upgrade and reindex cost?
The cost depends on the work involved, not on a fixed rate. The main components are planning the upgrade path, taking and verifying backups, running the schema scripts in a test environment, running the Reindex Repository task, checking results and writing the change record. Some of this is one-time for each upgrade, while the database backup routine, monitoring and staff time for future releases recur. Costs rise with database size, the number of supported environments, custom schema extensions and how many release steps sit between your current version and the target. Ask any provider for a written scope listing each component, who performs it, what you must supply and which environments are included. DeployOpen does not publish prices; a quote follows from the agreed scope.
How long does a midPoint schema upgrade and reindex take?
Duration is set by the size of your repository, the number of release steps, the hardware and database server, and how many environments must be tested before production. The Reindex Repository task runs against existing object data, so its runtime grows with the number of objects, which is why you should measure it on a copy of production data before the change window. The upgrade scripts themselves are usually ALTER TABLE commands, so the schema step is typically short compared with the reindex. Check the release dates on the midPoint releases page when planning, since end-of-support dates affect how soon you must move. Ask for a timeline that separates test runs from the production window.
Can our in-house team run the schema upgrade without a partner?
Yes, many teams do, provided they have the right skills and time to test. The team needs working knowledge of PostgreSQL administration, including backup, restore and verifying a restored copy, plus enough midPoint experience to read release notes, run the upgrade scripts in order and interpret the Reindex Repository task output. They also need access to a test environment that mirrors production closely enough to catch problems. The risk is usually not the scripts but unfamiliar steps that appear in a specific release. Assess your team honestly against the release notes for your target version before deciding.
What does the upgrade need from our team?
The work needs four things from your side. First, database access with rights to take backups, restore copies and run the schema scripts under an account you approve. Second, a test environment with a recent copy of the production repository, so the scripts and reindex run on realistic data. Third, a defined change window long enough for the backup, the schema step, the reindex and a post-upgrade check. Fourth, named owners who can approve go or no-go decisions and confirm functional checks afterwards. Confirm each item in writing before work begins, including how backup copies are stored and who can access them.
Can we skip the Reindex Repository task after a schema upgrade?
No, skipping it is not recommended. Evolveum highly recommends running the Reindex Repository task after schema upgrades because it fills new columns from existing object data. If you skip it, the new columns stay empty or incomplete for existing objects, so any feature that depends on them may return wrong or partial results. The failure can be silent, so users and administrators may not notice until a report, search or policy check behaves differently. Plan the reindex as a required step with its own verification, and record the task result in your change log.
What happens if the schema upgrade fails?
The outcome depends on where the failure happens and on the backup you took first. Because the upgrade scripts are designed to be non-destructive, a failed script can often be investigated and rerun after the cause is fixed, but this must be confirmed for each script and release. If the database is damaged or the result is unclear, restore from the verified backup and return to the previous midPoint version. Decide the rollback trigger and the restore steps before the window opens, and rehearse them in the test environment. Ask any partner how they record failures, how they restore and who makes the call to roll back.
Which PostgreSQL version and backup method should we confirm before upgrading?
Confirm the PostgreSQL version against the supported list before the midPoint upgrade, because a database out of support adds a second migration to plan. PostgreSQL 14 is supported until 12 November 2026, 15 until 11 November 2027, 16 until 9 November 2028, 17 until 8 November 2029 and 18 until 14 November 2030, according to the PostgreSQL versioning policy. For the backup, use a method your team can restore and test, and confirm that continuous archiving or point-in-time recovery is in place for production. Verify that a restored copy works before relying on it.
How DeployOpen scopes, delivers and supports a midPoint schema upgrade
DeployOpen treats a midPoint database schema upgrade as a planned change to a production repository, not a single command. We scope the release steps, back up and verify the database, apply the schema scripts and run the Reindex Repository task inside your own infrastructure, then document and hand over the result.
How we scope
- Written scope names the source and target midPoint releases and the database platform in use.
- Scope lists the SQL upgrade scripts to apply, in order, for each release step in the path.
- Scope states who takes the backup, who approves the maintenance window and who runs the reindex.
- Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
How we build
- We confirm the current database version and check it against the PostgreSQL versions midPoint supports.
- We rehearse the schema scripts on a copy of your repository in a non-production environment first.
- We test a restore from the pre-upgrade backup before any change touches the production database.
- We run the Reindex Repository task and check that new columns are populated from existing object data.
How we hand over
- You receive a runbook with backup, script, restore and reindex steps tied to your environment.
- The handover records script versions, task outcomes, timings and the rollback point used during the change.
- We document the checks that confirm the upgraded repository and reindex finished without errors.
- Your team runs a repeat of the procedure with the runbook so the next release step is not new work.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers for the next release steps.
- Retainers can cover review of each new midPoint release's schema scripts before your next upgrade window.
- We can retest the upgraded environment after changes to connectors, configuration or the database server.
- Ask any provider to confirm how they handle rollback, restore testing and post-change verification in writing.

