Monitoring long-running Medplum post-deploy migrations

After a self-hosted Medplum upgrade, background data migrations can run for hours or days on large datasets. This page explains how to watch them, when it is safe to move to the next minor and what failure looks like.

On this page

Why Medplum post-deploy migrations need active monitoring

A running server does not mean a finished upgrade. When a self-hosted Medplum server has just been deployed at a new minor version and its post-deploy data migrations are still running, track the migration jobs until they complete, and only move to the next minor once they have finished. The server accepting requests tells you the application is up. It does not tell you that every stored resource has been rewritten to the new schema, and a team that treats a healthy health check as the finish line can start the next step while data is still in an intermediate state.

The upgrade path is sequential. Self-hosted Medplum must be taken through each minor version in order, and skipping one, such as going from v3.1.2 straight to v4.3.4, causes startup failures. The same sequencing applies to the migrations: each minor's post-deploy work has to be complete before the next minor begins. On large datasets those migrations can run for hours or days, so the window in which the deployment is partly migrated can be long. Your team should confirm, against the Medplum upgrading guide and the release notes for your target version, what each step's migration involves and how your database size is likely to affect it.

This monitoring belongs to the team that owns the database and the upgrade window, not to the application team that ran the deploy. That team controls the PostgreSQL instance, its load, its backups and the rollback decision, and it is the one that will be paged if a migration stalls or fails. Assign a named owner before the deploy starts, agree who checks job status and at what interval, and write down the condition that counts as complete. Without that assignment, a stalled migration can sit unnoticed while the rest of the team assumes the upgrade has succeeded.

What changes between Medplum releases and what the migrations mean for you

This table pairs each Medplum release pattern with what it means for watching post-deploy migrations and what you should do in response. Use it to decide how much monitoring time to plan, when a release needs a staging rehearsal, and which release notes to read before you move to the next step.

ChangeImpact on your migrationsAction needed
Annual major releases in Q4A major version crosses a boundary that can change application code and data, so its migrations need the most planning time.Read the release notes for the target major version on the releases page and budget a staging run before any production move.
Two to three minor releases a yearEach minor can start its own post-deploy migration, so the number of monitoring windows grows with every stop on your path.Plan one monitoring window per minor and confirm that the previous migration has finished before you begin the next upgrade.
Weekly patch releasesPatches arrive often, so it is easy to lose track of which patch is running in each environment.Record the exact version in every environment and read the notes for each patch you adopt on the releases page.
One-year Active and one-year Maintenance support windowsStaying on an older line shortens the time you have before support changes, which affects when you must schedule the next upgrade.Track the support end date for your current major line and plan the upgrade with enough time for monitoring and rollback.
Enterprise extension of 12 more months of security patchesIf you hold the Enterprise extension, security patches continue for a longer period, which can change the timing of your upgrade plan.Confirm with Medplum whether your contract includes the extension and what end date applies to your line.
Security patch targets of 7 days (critical) and 14 days (high)Security fixes may arrive on a short timeline, which can compete with a migration that is still running.Decide in advance who can pause or continue a migration when a critical or high patch is announced, and test that patch in staging first.
Sequential minor upgrades requiredSkipping a minor version can cause startup failures, so each migration must complete before the next minor starts.Confirm each intermediate minor on the upgrading guide and do not move to the next minor until the current async jobs are finished.
Post-deploy migrations can run for hours or days on large datasetsMonitoring time is not predictable from the release alone, and a slow job can hold up your schedule for days.Measure job progress in a staging copy of your data, ask Medplum what throughput to expect for your dataset size, and keep a rollback window open while jobs run.

How the server, migration jobs and the upgrade gate fit together

The flow starts when the target minor version is deployed and the server starts. Post-deploy migration jobs are queued as AsyncJob records, which the team watches on the async job admin page and through AsyncJob queries. Each job lands in one of three states: complete, still running or errored. Only a complete state should open the gate to the next minor, so a team should confirm every job is finished before it moves on.

Post-deploy migration jobs must reach complete before the next minor starts.

Which signals to watch on the async job admin page and in AsyncJob queries

A long-running post-deploy migration is quiet by default, so the team has to read a few independent signals to know whether it is moving. The cards below cover what to watch on the async job admin page, in AsyncJob queries, and on the database and server side, with the exact field names and status values to confirm against the documentation for your version.

Job state over time

Record the status of each post-deploy migration job at fixed intervals, not just when someone opens the page. Confirm the exact status values in the documentation for your version, then note whether jobs move between states or stay in one state for a long stretch. A job that never leaves its initial state usually means it was never picked up, which is a different problem from a job that is slow.

Upgrading guide

Progress between checks

Compare progress between two checks taken at the same interval, using whatever counter or timestamp your version exposes on the job. Confirm the field names in the documentation first. On large datasets a migration can run for hours or days, so a flat reading over one interval is normal, while no movement across several intervals warrants investigation before you wait longer.

Errors and repeated retries

Read the error message on any failed job and check whether the same failure repeats across retries. A repeating error on the same record or batch points to bad data or a schema assumption, and retries will not clear it. Capture the first error text before a retry overwrites it, since the message is the main clue for whether the migration can resume safely.

Database load and lock waits

Watch load on the Medplum PostgreSQL database while the migration runs, including active connections, CPU, I/O and lock waits on the tables the migration rewrites. Heavy lock waits that build up alongside a stalled job often mean the migration is blocked by another query, not that it is doing work. Agree with your database team on thresholds before the upgrade window opens.

Server logs for the migration

Filter the Medplum server logs for the migration job identifier and for startup or worker messages around the time of the upgrade. Confirm the log format and message text for your version, since those are not covered here. Logs show whether a worker crashed, restarted or is still processing, which the admin page alone may not reveal.

Jobs left in the queue

Count the migration jobs still waiting to run, and track whether that number falls between checks. A queue that is not shrinking tells you the worker capacity is too low or that jobs are blocked behind a stuck one. Use the same count at each check so the trend is comparable, and confirm the query for queued jobs against your version's documentation.

What makes a migration take longer on large datasets

This table lists the factors that change how long a Medplum post-deploy migration runs and what to check for each one. Duration depends on these factors together and cannot be predicted from published information, so measure it in a staging environment with comparable data before setting a rollback window or a cutover date.

DriverWhy it mattersWhat to check
Record volume and resource sizeMigrations rewrite or reindex stored FHIR resources, so the number and size of affected rows drive runtime more than the version number does.Count rows per affected resource type in production and note the largest resource types and their average payload size.
Database instance size and I/OMigrations are heavy reads and writes on PostgreSQL, so limited CPU, memory or IOPS stretches the run and can slow live traffic.Compare the production database class and provisioned IOPS with staging, and watch CPU, memory and storage latency during the run.
Concurrent writes from integrations and BotsNew writes during the migration can compete for locks and throughput, and records changed mid-run may need reprocessing.List every integration, Subscription and Bot that writes during the window, and decide whether any can be paused or throttled.
Minor versions still ahead in the pathEach minor on the path can carry its own post-deploy migration, so the total wait is the sum of the stops, not a single run.Map every remaining minor from your running version to the target and plan a separate migration wait at each stop.
Custom search parameters and extended dataCustom search parameters or nonstandard extensions can add work when the migration rebuilds indexes or touches fields your team defined.Inventory custom SearchParameter resources and extensions, and confirm with Medplum whether the migration touches them.
Staging data volumeA staging copy with far less data will finish faster than production and can hide slow queries that only appear at full scale.Confirm staging holds a comparable volume, index layout and write pattern before using its timings to plan production.

How to run the monitoring sequence for each minor

This sequence takes one Medplum minor version from deployment to a confirmed finish of its post-deploy migrations. It produces a dated record of job state, named owners and the point at which the next minor is allowed to start, with the rollback decision point marked at each stage.

  1. Confirm the target minor and patch

    Open the Medplum releases page and identify the target minor version and its newest patch release. Confirm that the patch you deploy is the latest one listed for that minor, and read its release notes for mentions of migrations or configuration changes. Record the exact version string in the change ticket. The step is done when the ticket names one version and the release notes have been reviewed. Rollback is not needed yet because nothing is deployed, so this is the cheapest point to change the target. If a newer patch appears before deployment, repeat the review.

  2. Confirm the server started cleanly

    After the rollout, check the server logs and health endpoint to confirm the new version is serving API requests. Look for startup errors, and confirm that post-deploy migrations are reported as pending or running rather than failed. Startup failures are a common symptom of skipping a minor in the upgrade path, so treat any startup error as a stop condition. The step is done when the expected version responds normally. On failure, do not start or trigger any migration. Roll back to the previous image while migrations have not begun, and check the rollback guidance for the migration setting before you do.

  3. Locate the migration AsyncJob records

    Find the post-deploy migration jobs through the admin page for async jobs and by querying AsyncJob resources through the API with an admin client. Record each job's identifier, name, creation time and current status, including which are queued, running, completed or failed. Compare the list against the migrations the release notes describe, and investigate any expected migration that does not appear. The step is done when you hold a complete list with identifiers. If jobs are missing, confirm the server runs the expected version and that your admin credentials can read AsyncJob records. Do not trigger jobs manually at this stage.

  4. Record a baseline of job state

    Before the migrations make progress, save a snapshot of every job's status and timestamps, then capture database load for the same moment. Useful signals include CPU, connection count, lock waits, replication lag if you run replicas, slow queries and free storage. Store the snapshot with its time in the change ticket so later checks have something to compare against. The step is done when the baseline is saved and a second person has reviewed it. If the database is already under heavy load before the migration starts, record that fact and decide with the owner whether the window should open now. Rollback is still possible while jobs remain queued.

  5. Set a check cadence and owner

    Assign one named owner who makes go or no-go decisions for the migration, plus a backup who can act if the owner is unavailable. Agree in writing how often the checks run, who is paged on failure, and which database or platform contacts you escalate to. Define the conditions that stop the next minor from starting, such as any failed job or any job that stops making progress across checks. The step is done when the names, cadence and stop conditions appear in the ticket and each named person has acknowledged them. Without a named owner, slow jobs tend to be noticed late, so do not skip this step on a quiet release.

  6. Watch progress and errors against baseline

    At each scheduled check, compare every job's status and progress with the baseline. Scan for failed jobs, retries and error messages in the server logs, and review the database signals for long-running queries, lock waits and connection saturation. Log each check with its time, result and any action taken. If a job fails or shows no progress across consecutive checks, escalate to the owner and collect the job's error details and logs before anyone restarts it. Restarting without that evidence hides the cause. Once data has been migrated, rolling back may no longer be safe, so confirm the release notes before any reversal is considered.

  7. Verify completion before the next minor

    Confirm that every migration AsyncJob has finished successfully, that none remain queued or running, and that error counts are zero. Run your application smoke tests against the upgraded server, and check the upgrading guide for any stop condition that applies to this minor. The owner signs off in the ticket only when all of these are met. The step is done when the sign-off is recorded. Do not deploy the next minor while any job is incomplete or any check is unresolved. From this point, the next minor is the planned path forward, and rolling back is no longer a routine step.

  8. Record the outcome for the next stop

    Write the final job list, the errors seen, the database metrics at completion and every decision made into the upgrade record. Note the version now running and the next stop in the planned path. Link the record from the change ticket so the next minor's baseline starts from these results. The step is done when the record is filed, reviewed by the owner and linked from the ticket. Keeping the outcome written down makes the next minor's checks faster to set up, because the cadence, owners and known slow jobs are already documented.

When it is safe to move to the next minor

Advancing to the next minor is safe only when every post-deploy migration for the current minor has completed. Before you move on, confirm in the async job admin page that no migration jobs are still queued, running or errored, and check the AsyncJob records for the current minor's migrations. Then let the server run under real traffic long enough to show whether it behaves normally. Look for new error spikes in logs and request metrics, and confirm that the database is free of lingering locks and of migration-driven load, such as long-running queries against the tables the migration rewrites. Finally, the current minor must have passed staging tests. The exact time the server needs under live traffic is a decision for your team, so set that window in your runbook before the upgrade starts instead of deciding it under pressure.

Do not skip a minor, and do not advance past a migration that has stalled or errored. Self-hosted Medplum must be upgraded through each minor version in sequence, and skipping one causes startup failures, so the next minor is always the next step on your path. A stalled migration is a signal to stop and investigate, not a delay to wait out. Check whether the job is still progressing, whether it is blocked on a lock, whether the database has run out of resources, and what the error message says. Fix the cause, then let the job resume or retry under the guidance in the upgrading guide. Moving forward with an unfinished migration means the next minor starts on data in an unknown state, which makes any later failure much harder to attribute.

If the new minor misbehaves, the question is whether rolling back is still safe. That depends on whether the migrations have changed data in ways the previous version cannot read, and the rollback topic sets out the conditions under which a rollback is safe. Read it before the upgrade starts, so you know which checkpoints keep the rollback window open. Confirm the rollback decision with your own staging results rather than assuming the previous version will still run against migrated data.

What common failure symptoms look like and what to do first

A server that fails to start after a deploy usually points to a version or configuration problem, not to the data migration itself. The most common cause is a skipped minor version, which the upgrade guidance says causes startup failures. Other causes include a mismatched image tag or chart version, a changed environment variable, or a database schema that the new server cannot read. Start by reading the container or process logs from the first failed start, not the latest restart, because the first error is usually the root cause.

  • Confirm the version path: Check the running version against the minor you are upgrading from, and confirm that every intermediate minor was applied in order.
  • Read the first error: Capture the earliest startup error in the logs and note whether it refers to the database, Redis, configuration or a schema check.
  • Check configuration keys: Compare the environment or stack settings with the last working release, including any settings you changed for the upgrade.
  • Confirm connectivity: Verify that the server can reach PostgreSQL and Redis with the same credentials and network rules as before.
  • Escalate or roll back: If the server cannot start on the new version, roll back to the previous image while the database is still compatible, and escalate with the first error and the version path.

Before changing anything, confirm that the rollback path is still valid for the schema you have applied.

What buyers ask about monitoring Medplum migrations

How much effort does monitoring post-deploy migrations add to a Medplum upgrade?

Monitoring adds a bounded but unpredictable amount of work to each minor upgrade, and most of it depends on how large your dataset is and how many migrations the target version runs. The work includes watching migration progress, checking logs for errors, deciding when the next minor is safe, and keeping a record of each step. Effort rises when the database is large, when several minors must be stepped through in sequence, or when no one on the team has watched a long job before. The Medplum upgrading guide notes that self-hosted servers must move through each minor in order and that post-deploy migrations can run for hours or days on large datasets, so plan staff time around that window rather than a single deployment session. Ask any partner to show the monitoring steps as part of the written scope.

How long do Medplum post-deploy migrations take?

There is no single answer, because duration depends mainly on data volume, database sizing and the specific migrations in each minor version. The Medplum upgrading guide states that migrations on large datasets can run for hours or days, so a small test environment will tell you little about production timing. Before committing to a window, review the release notes for the target minor, measure row counts in the affected resources, and rehearse the migration in a staging copy sized like production. Track progress through the async job admin page and AsyncJob queries, and record how throughput changes as the job runs. Confirm with Medplum or your partner how the job reports progress for the version you are targeting.

Can our team monitor Medplum migrations in-house?

Yes, many teams can, provided they have someone who understands the Medplum server, PostgreSQL and the Medplum admin tools. The job involves reading the async job admin page, running AsyncJob queries against the database, interpreting server logs and deciding when to proceed. A team that has already completed an upgrade on a non-production copy will usually find the process manageable. Teams without that experience should first rehearse on staging, document a go or no-go checklist, and agree in advance who has authority to pause or roll back. Your internal team owns the decisions either way, so the question is whether you have the capacity to watch a job that may run for a long time.

What does monitoring need from our database and platform staff?

Monitoring needs database administrators who can run read-only queries safely, assess query load on production, and read PostgreSQL performance signals, plus platform engineers who can view server logs, container or instance health and resource metrics. Database staff should confirm that long-running migration queries will not starve other workloads, and that backups and point-in-time recovery are current before the migration begins. Platform staff should confirm that the server can restart cleanly and that monitoring access is limited to the people who need it. Both groups should agree on escalation paths, because a slow job can look like a fault. Document these responsibilities before the upgrade window opens.

What would a consultant take over during migration monitoring?

A consultant can take on the monitoring workload, the rehearsal, the written runbook and the decision support, but the scope should be set in writing before work starts. Typical responsibilities include planning the upgrade stops, preparing the staging rehearsal, watching migration progress through the admin page and AsyncJob queries, reporting status to your team, and advising on whether the next minor is safe. Your team usually keeps final approval for production changes and access to your environment. DeployOpen plans, implements, upgrades, documents and supports self-hosted open-source platforms inside your own infrastructure, so monitoring would run in your accounts and data centers. Ask which outputs you receive, such as a runbook, progress log and sign-off record.

What should we ask for in a written quote for migration monitoring?

Ask for a quote that ties every line to a written scope, so you can compare proposals on equal terms. Request the list of upgrade stops covered, the environments included (staging rehearsal and production), the number of monitoring windows, the hours of coverage expected during long jobs, and who on your side must be available. Ask how escalation works if a migration stalls, what the partner needs from your database and platform staff, and what documentation you receive at the end. Confirm whether rollback support is included, how retesting is handled, and what is recurring versus one-time. DeployOpen does not publish a price list, and a quote follows from the written scope.

When is it safe to move to the next Medplum minor version?

It is safe to move to the next minor only after the current post-deploy migrations have finished, the server is healthy and the environment passes your validation tests. The Medplum upgrading guide requires stepping through each minor in sequence, so skipping a minor is not an option. Confirm in the admin page and AsyncJob queries that no migration jobs remain in progress or in error, check logs for repeated failures, and run your application tests against the new version. Also confirm that your rollback window still holds, since some changes make reverting harder. Record the decision and the evidence behind it.

How DeployOpen works on this

DeployOpen scopes Monitoring long-running Medplum post-deploy migrations as a written, fixed-scope piece of work inside your own infrastructure. We set up the monitoring, agree the thresholds and escalation steps with your team, and hand over a runbook your operators can use without us.

How we scope

  • Confirm your current and target Medplum versions and which minor stops sit between them.
  • Inventory the post-deploy migrations each release triggers and your largest tables they touch.
  • Agree how your team will read AsyncJob status, job timing and server logs during migrations.
  • Define who decides when a migration is finished and who approves moving to the next minor.

How we build

  • Set up the admin job view and AsyncJob queries against your staging copy of the database.
  • Write alerting rules for stalled, failed or unusually slow jobs, tuned to your data volumes.
  • Rehearse a full migration in staging and record timings so production expectations are grounded.
  • Test failure paths, including server restarts mid-migration and retries, before production work starts.

How we hand over

  • Deliver a runbook covering each check, the expected job states and the escalation path.
  • Document the go and no-go conditions for moving to the next minor, with the evidence to capture.
  • Walk your operators through a live migration check and record questions for follow-up.
  • Provide configuration and query files under version control, so your team can reuse them.

How we support

  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
  • Ongoing upgrade support and continuous testing are available as a retainer for later Medplum releases.
  • Retesting of monitoring rules is included in the agreed scope when a new minor version changes job behavior.
  • Ask any partner, including DeployOpen, to confirm how Medplum's own release notes affect your scope.

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.