Why Temporal database schema upgrades come before server binaries
When release notes call for a schema change, the schema upgrade must run before the server binaries are upgraded. A self-hosted cluster that has to cross several Temporal Server minor versions also moves one minor version at a time, and each hop goes to the latest patch of the current minor first. Current patch releases include v1.32.1, v1.31.4 and v1.30.8, so the target for each line is the newest patch on that line, not the first release in it. Backward compatibility is guaranteed only between two successive minor versions, which is why the path cannot skip lines.
In Temporal, the schema is the set of tables or indexes in the persistence store and, where advanced visibility is in use, in the visibility store. It records the structures the server expects to read and write, including the version of the schema itself. The server does not repair a mismatch on its own. If the binaries start against a schema they do not expect, or the schema moves ahead of a server that still expects the old layout, shard ownership and history writes can disagree about what the data means. The result can be inconsistent shards that are hard to diagnose after the fact, so the reader should treat a schema change as a gate that must pass before any binary moves.
Before planning the sequence, confirm in the release notes for each target version whether a schema step is required, and which store it applies to. Record the schema version currently in each database, then compare it with the version the next server release expects. Keep the order of schema and binary steps in the runbook so that on-call engineers do not have to work it out during an incident. The version-specific steps follow in the sections below.
What changes in Temporal Server releases and what each change asks of the database team
This table lists the release rules and backend changes that affect Temporal schema work, with the impact on the database team and the action each one needs. Read each row before planning a hop, because the persistence and visibility backend rows decide which stores you can keep. The main takeaway is that schema steps follow the server version you are moving to, so confirm backend support in the release notes before you commit to a target.
| Change | Impact on the database team | Action needed |
|---|---|---|
| One minor version at a time | Each hop is a supported step, and skipping minors removes the backward compatibility guarantee between versions. | Plan the path minor by minor, moving to the latest patch of each minor first. |
| Schema before server binaries | Schema changes for the target release must be applied before the server services run that release. | Check the release notes for schema steps, and run the schema tool before rolling binaries. |
| Helm chart minimum of 0.73.1 | Chart versions below 0.73.1 do not work with server images 1.30 and later, which affects schema job wiring. | Confirm the chart version before any Kubernetes-based schema or server rollout. |
| Persistence on Cassandra 3.11, 4.0 and 5.0.4 or later | These are the tested Cassandra versions for persistence, and schema changes run through temporal-cassandra-tool. | Verify your Cassandra version is in the tested range before scheduling the upgrade. |
| Persistence on PostgreSQL 13 to 16 | These are the tested PostgreSQL versions, and schema changes run through temporal-sql-tool. | Confirm PostgreSQL 17 and 18 support in the release notes before choosing either version as a backend, since they are not in the supplied tested range. |
| Persistence on MySQL 5.7 and 8.0.19 or later | These are the tested MySQL versions, and schema changes also run through temporal-sql-tool. | Check your MySQL minor version against the tested range and plan any engine upgrade first. |
| Visibility on Elasticsearch 7 and 8, OpenSearch 2 or later from 1.30.1 | Visibility schema changes run through temporal-elasticsearch-tool, and OpenSearch support depends on the server line. | Confirm the server version supports your OpenSearch release, and rehearse index setup in staging. |
| SQL visibility from 1.20 | Visibility can run on MySQL, PostgreSQL or SQLite, which adds a SQL schema step alongside persistence. | Confirm the visibility schema version for the target release, and do not use SQLite outside development and testing. |
| Cassandra visibility removed in 1.24 | Clusters still using Cassandra visibility cannot take the 1.24 release without moving visibility first. | Plan the visibility move before the 1.24 hop, using a dedicated migration path. |
Which tool runs Temporal database schema upgrades on your backend
temporal-sql-tool applies schema changes to the SQL database that holds workflow state, and to the visibility database if SQL is also your visibility store. The engine and its version decide the path you follow. Temporal's persistence documentation tests PostgreSQL 13 to 16 and MySQL 5.7 and MySQL 8.0.19 or later. PostgreSQL 14 support ends November 12, 2026, and PostgreSQL 18 is supported until November 14, 2030, so a backend decision made now affects how many major upgrades you run later. Confirm whether your target Temporal release lists a newer PostgreSQL version as tested before you plan around it.
- Connection settings: Use the same host, port, database user, password and TLS settings the Temporal services use, so the tool reaches the same schema with the same certificates.
- Engine version: Confirm your engine version is in the tested range for the target release before the first run.
- Schema version in the release: The tool applies the schema version named in each release. Run the steps in the order listed and do not skip a version.
- Visibility database: If SQL also backs visibility, check whether the release changes visibility schema, since that is a separate step.
Check the release notes for the exact schema version, the tested engine versions and whether the step must finish before server binaries roll.
temporal-cassandra-tool manages the Cassandra keyspace that holds Temporal persistence data. Persistence is tested on Cassandra 3.11, 4.0 and 5.0.4 or later. Cassandra is no longer an option for visibility, because Cassandra visibility was removed in Temporal Server 1.24. This tab covers persistence only. If an older cluster still uses Cassandra for visibility, move visibility to a supported store before you start the persistence steps, and follow the sibling topic on that move. Read the Temporal persistence documentation for the current tested list before you commit to a version.
- Keyspace and replication: The tool changes keyspace schema. Confirm the keyspace name and replication settings in your configuration match what the release expects before the first run.
- Connection and TLS: Supply the same contact points, credentials and TLS files the server uses. Test connectivity from the host that runs the tool and from the server hosts.
- Version coverage: Check your Cassandra version against the tested list. A version outside that list needs written confirmation from Temporal or a rehearsal in your own staging environment.
- Ordering with binaries: Confirm whether the release requires the tool to finish before server pods restart, and whether older servers still in the rolling window can read the new schema.
Check the release notes for the schema version, the exact keyspace change and any statement on running the tool before the server restarts.
temporal-elasticsearch-tool manages the index templates and schema that advanced visibility uses. Temporal supports Elasticsearch 7 and 8 and OpenSearch 2 or later for advanced visibility, with OpenSearch support starting from Temporal Server 1.30.1. Temporal recommends Elasticsearch or OpenSearch for anything beyond a few workflow executions, so this tab matters most for clusters with large visibility volumes. Visibility is a separate store from persistence, so its schema steps are tracked apart from the SQL or Cassandra steps.
- Engine and version match: Confirm the engine is Elasticsearch 7, Elasticsearch 8 or OpenSearch 2 or later, and that the target server version supports it. The visibility documentation lists the supported combinations.
- Connection and TLS: Use the same endpoint, credentials and certificate settings as the visibility configuration in the server, so the tool writes to the indexes the server reads.
- Index changes: Read which index templates or mappings the release changes. Changes to large indexes can take time, so rehearse the window in staging first.
- Ordering and availability: Confirm whether visibility steps run before or after the persistence steps, and whether visibility queries can be unavailable while the step runs.
Check the release notes for the schema version, the supported engine versions and any statement on visibility availability during the step.
How the version-by-version path and the waits between steps keep shards consistent
Each hop in a Temporal upgrade is two steps: a schema step that changes the persistence or visibility store, then a server step that replaces the binaries. The order matters because the schema must be ready for the server version that reads it. Temporal guarantees backward compatibility only between two successive minor versions, so the team cannot skip a minor line and expect the history service and the shard owners to agree on the data format. Move to the latest patch of the current minor first, because patch releases carry fixes for the line you are leaving, then move to the next minor only after that patch is running cleanly. The upgrade documentation at Upgrade the Temporal Server sets this sequence, and the release notes for each target version state whether a schema step is required.
The wait between hops is where shard consistency is protected. After a schema step and a server step complete, watch shard health, history service errors and visibility lag before you run the next schema command. Shard ownership moves as service instances restart, so a sustained rise in shard errors or ownership churn means the cluster is not ready for another change. Visibility lag matters too, because a visibility store that falls behind hides recent workflow executions from operators and from any tooling that queries them. Confirm which metrics your Temporal deployment exports and which alerts already exist before the first hop, and record a baseline so each hop can be compared against it.
The length of the wait depends on cluster load, shard count, the size of the persistence store and how many workflow executions are running during the change. No fixed duration is safe for every cluster, so set the wait from your own monitoring: define the signals that must return to baseline, agree who signs off, and rehearse the same sequence in staging with production-like load before you touch production. Ask your team to document the hop order, the exit criteria for each wait and the rollback point, since these decisions are the core of the upgrade plan.
Schema and server phases alternate on every hop, with a decision and a rollback point at each step
The diagram starts with a backup taken before any change and then asks whether the release notes for the target minor call for a schema step. If they do, the schema tool runs and its result is verified before any binary moves, because schema upgrades run before server upgrades. The server roll is followed by checks on shard health and visibility, then a deliberate wait before the next hop. Each hop ends in a rollback decision, so the team can stop with a known state.
An illustrative per-hop sequence, not a list of versions.
What to prepare before the first Temporal database schema upgrade
Schema upgrades change the persistence and visibility stores that hold every workflow history, so the preparation has to be finished before anyone runs a tool against production. The six items below are the things to produce or confirm, and each one feeds the staging rehearsal and the change window that follow.
Verified backups with a tested restore
Take a backup of the persistence store and the visibility store, then restore it into a separate environment and confirm the Temporal Server starts against it. A backup that has never been restored is not evidence. Record which backup is the rollback point for each store, since the schema tool changes both and they must be rolled back together. Ask the database owner to confirm the restore time they can deliver.
Persistence docsCurrent schema and server versions
Write down the server version, the schema version recorded in each store, and the Helm chart version if you deploy with one. Compare the recorded schema version with what the target release notes require, because the upgrade path depends on the starting point. Helm chart versions below 0.73.1 do not work with server images 1.30 and later, so confirm the chart version before planning any hop.
Staging copy of production volume
Build a staging environment with a copy of production data at a comparable size, plus the same shard count, service layout and configuration files. Schema changes on a small dataset can finish quickly and hide problems that appear on a busy history. Confirm that staging uses the same database backend version as production, since a rehearsal on a different version proves little.
Security settings that must survive
List every custom codec, the Authorizer, the ClaimMapper and the mTLS settings for internode and frontend traffic. Check that each one is still present in the configuration the new server version will read after the upgrade. A missing Authorizer falls back to the default noopAuthorizer, which allows every API request, so confirm this setting in the rehearsal and not only in production.
Security docsDatabase backend version and support window
Record the exact PostgreSQL, MySQL, Cassandra or Elasticsearch version behind each store and check it against the versions Temporal tests for persistence and visibility. Then check the vendor's support end date for that version, because an upgrade can force a database upgrade too. For PostgreSQL, versions 14 and earlier have end-of-support dates in 2026 or before, so confirm the planned end date with the database team.
PostgreSQL versioning policyChange plan with named owners
Write a plan that names one owner for each schema step, each binary rollout, the rollback decision and the go or no-go call between hops. Include who watches shard health and who can stop the change. The plan should also set the wait between steps, which the rehearsal measures on a copy of the busy cluster. Unclear ownership is the most common reason a rehearsed upgrade stalls in production.
The upgrade sequence with checks and rollback points at each hop
This sequence moves a self-hosted Temporal cluster through one minor version at a time, with a named check at every step so that schema, server and visibility changes are confirmed before the next hop starts. It produces a recorded rollback point for each hop, so the team knows what can be reversed and what cannot.
Confirm the target version and schema notes
Before anything changes, the upgrade owner reads the release notes for the target minor and its latest patch, and records whether a persistence or visibility schema update is required, and whether it must run before the server binaries are replaced. Temporal recommends moving one minor version at a time and landing on the latest patch of that minor first, so the target for this hop is fixed here. The check is a written hop record listing the target version, the schema tool and version required, and the rollback statement the release notes allow. If the notes do not state whether a schema change is reversible, the hop is marked as not reversible until a named owner confirms otherwise.
Take and verify a backup
The database owner takes a full backup of the persistence database and, where advanced visibility is in use, of the visibility store, and records the backup identifier. The backup is then restored into an isolated location to confirm it is readable and that the Temporal tables or indices are present. Because the schema change is applied to live data, this backup is the only fallback if the release notes do not permit reversal. The output is a restore test result and the backup identifier attached to the hop record. Confirm the backup method with the vendor documentation for your database engine, since the supported tooling differs between PostgreSQL, MySQL and Cassandra.
Rehearse the schema upgrade in staging
The platform team runs the matching schema tool against a staging copy of production data, using the same schema version and configuration as production. The tool for the backend in use is temporal-sql-tool for SQL persistence, temporal-cassandra-tool for Cassandra, and temporal-elasticsearch-tool for Elasticsearch visibility. The check is that the tool completes without error, the run time is recorded, and no application workers are needed to finish the change. Any failed or partial run is investigated and the hop is repeated from a restored copy before production is touched. The staging result is attached to the hop record.
Apply the schema change and check its version
The operator applies the same schema change to production, following the order required by the release notes, and then queries the schema version table or the tool's version output to confirm the database reports the target schema version. The check is that the recorded version matches the hop record exactly and that no migration is left in a pending or partial state. If the version does not match, the operator stops, does not start server binaries, and restores from the backup if the notes require it. This step is complete when the version check output is saved to the hop record.
Roll the server to the latest patch of the minor
The platform team rolls the Temporal Server services to the latest patch of the target minor version, using their deployment method, whether Docker Compose, binaries or Helm. Each service is restarted in turn so that the cluster keeps serving requests during the change, and the rollout is paused if any service fails to reach a ready state. The check is that every service reports the target version and that no service is restarting. Helm chart versions must match the server image, and chart versions below 0.73.1 do not work with server 1.30 and later, so the chart version is confirmed before this step.
Verify frontend, history and visibility health
The on-call engineer checks that the frontend and history services report healthy, that shard ownership has settled and that no shard is stuck in a rebalancing loop. They then run test workflows through a dedicated test namespace, confirm they start, complete and appear in visibility queries, and compare error rates and latency with the values recorded before the hop. The check is a signed health record covering service status, a successful test workflow and a visibility query returning the expected executions. If any check fails, the hop is held and the team decides between rollback and fix forward based on the release notes.
Wait for the agreed observation period
The team holds the cluster at the new version for an observation period agreed before the upgrade started, and watches error logs, persistence latency, shard health and workflow failure rates during that time. The observation period length is set by the operator in the upgrade plan, and it should reflect the cluster's traffic pattern. The Temporal upgrade guidance recommends waiting between hops so that shards settle, and the check is that the metrics stay within the agreed thresholds for the whole period. Any unexplained change extends the wait rather than starting the next hop early.
Record the rollback point before the next hop
Once the observation period closes cleanly, the upgrade owner records the rollback point for this hop, stating the version, the backup identifier, the schema version and whether the release notes permit reversing the schema change. The record is signed off by the service owner and the database owner. The next hop starts only after this record exists, and the next hop's confirmation step begins again from the release notes for its own target. Rollback after a schema change depends on what those notes permit, so this record is the only authority the team uses if a later hop must be reversed.
How to rehearse Temporal database schema upgrades in staging and plan rollback
Staging only proves something if it matches production where the upgrade touches data. Match the persistence backend type and major version, the visibility store (Elasticsearch, OpenSearch or SQL), and a data volume close to production, because schema tool runtime and the state of existing shards depend on that data. Rehearse the full path in order: each temporal-sql-tool, temporal-cassandra-tool or temporal-elasticsearch-tool step, the server upgrade that follows it, and the waits between hops exactly as they will run on the production cluster. A rehearsal that skips the waits or runs against an empty database tests a different upgrade from the one you will perform.
Test the cluster's behavior after each schema step, not only at the end. Read existing workflow histories and confirm they load, run visibility queries that your operators and services depend on, and confirm that workers on each task queue connect and complete new executions. If the team keeps sample executions from production, replay them against the workers built for the target SDK version so that determinism problems surface in staging. Record what passed and what failed at each step so the production runbook reflects observed results, and confirm with the Temporal server upgrade documentation which schema changes can and cannot be reversed before you decide how to roll back.
Treat rollback as a restore decision, tested in staging before it is needed in production. Schema changes are generally not undone by running the binaries of an older version, so the practical rollback path is usually restoring the persistence and visibility stores from a backup taken immediately before the upgrade, then confirming the restored cluster serves the same workflows. Rehearse that restore end to end, time it on your own data, and agree in advance who makes the call to restore and what evidence triggers it. Ask Temporal and your database operator to confirm the restore procedure for your backend and version, since the reversibility of each step depends on the release notes for that step.
What makes Temporal database schema upgrades take longer
This table lists the factors that stretch a Temporal schema upgrade and the effect each one has on effort. Read each row as a question to answer about your own cluster before estimating the work. Duration depends on your environment, so measure it by rehearsing the full sequence in staging rather than planning from general expectations.
| Driver | Effect on effort | What to check |
|---|---|---|
| Number of minor versions crossed | Each minor hop needs its own schema step, server step and wait before the next hop | Map the release notes for every minor version between your current and target release, and list which ones call for schema changes |
| Persistence backend (Cassandra, SQL or other) | Schema tooling, locking behavior and rollback options differ by backend, so runbooks are not interchangeable | Confirm your backend and tool version with temporal-sql-tool, temporal-cassandra-tool or the matching tool for your persistence store |
| Visibility store (Elasticsearch, OpenSearch or SQL) | Index or mapping changes add a separate track that can lag behind the persistence schema | Identify the visibility store, its version and whether the target server supports it, then run temporal-elasticsearch-tool steps where required |
| Data size and visibility volume | Larger tables and indexes take longer to migrate and to verify, and make rollback more costly | Record database and index sizes and visibility document counts in staging, then compare them to production before scheduling |
| Helm chart or Docker Compose deployment | Helm adds schema job ordering and chart-to-image version matching, while Compose is usually a simpler sequence of commands | Check whether the chart version supports the target server image, and confirm the order of schema jobs and service rollouts |
| Namespaces and workflow executions | More namespaces and open executions raise the amount of state to verify and the risk of surprises after a hop | Count namespaces and open workflow executions, and confirm that workers and clients for each namespace can be tested after the upgrade |
| Custom codecs and security plugins | Custom payload codecs, Authorizers or ClaimMappers need testing against the new server version, which adds steps outside the schema work | List every custom component in the server path, then confirm its compatibility with each target version |
| Environments needing rehearsal | Each environment, from development through production, repeats the schema and server sequence, which multiplies the calendar time | Agree the rehearsal sequence with your change process and decide which environments must match production in size and configuration |
| Cross-team coordination for databases and search clusters | Database administrators and search platform owners must schedule changes, backups and maintenance windows that the Temporal team cannot control alone | Confirm owners, change windows, backup status and rollback approvals for the persistence database and any visibility cluster before starting |
What buyers ask about Temporal database schema upgrades before hiring help
What does a Temporal database schema upgrade cost and what drives the price?
The cost is mostly the people time and the staging capacity needed to rehearse each hop, plus any outside services you buy under a written scope. Internal staff time is a recurring cost for each step, because every minor version needs its own schema run, verification and wait. Staging capacity is a one-time setup cost that you may reuse for later upgrades. Outside services are priced from the written scope, so ask for the number of hops, the databases in scope (persistence and visibility), the staging environment and the rollback plan to be listed separately. DeployOpen does not publish a price list, and a quote follows from that scope. Check the release notes for each target version, since they determine which schema steps apply.
How long does a Temporal schema upgrade take on a busy cluster?
The timeline is set by the number of minor versions you must cross, the size of your persistence and visibility stores, and how long your staging rehearsals take to finish and be checked. Each hop needs its schema change, a server upgrade and a wait so shards settle before the next step, and that wait grows with cluster load. Your own staging measurements are the only reliable source for durations, so run the first hop on a copy of production data and record how long the schema step and the settle period take. Use the Temporal upgrade documentation to confirm the order of steps for each target release before you set a date.
What do we need from our team before the upgrade starts?
You need named owners and access, not just a plan. Typically this means administrative access to the persistence database (PostgreSQL, MySQL or Cassandra) and to the Elasticsearch or OpenSearch visibility store, a staging copy of both, a change window for each hop, and one person who can approve a rollback. Ask the vendor or partner to confirm which accounts run the schema tool and whether it needs DDL rights. Your database team should also confirm backup and restore procedures before the first step. These requirements apply in your own environment, so verify them against your actual setup.
Can our internal team run a Temporal schema upgrade alone?
Yes, a team that already operates the Temporal persistence store and has tested backups can usually run the schema tools itself, provided it follows the release notes for each version. The harder parts are the staging rehearsal, the wait between hops and the decision to proceed or roll back when a check looks wrong. Teams without a recent Temporal upgrade, or without a database administrator on call during the change window, often choose to buy help for the planning and rehearsal stages. Ask whether your team has done a schema upgrade before on a cluster of similar size, and list the gaps you would need to fill.
How does the one-minor-version rule change the number of upgrade hops?
The rule means you cannot jump several minor versions at once, so the number of hops equals the number of minor releases between your current version and the target. Temporal guarantees backward compatibility only between two successive minor versions, so each hop must move to the latest patch of the current minor before the next one begins. Each hop also means running that version's schema steps before its server binaries, as the release notes require. Count the hops from the release list early, because every extra hop adds staging, change windows and settle time to the plan.
What happens if a schema step or upgrade hop fails?
A failed hop should stop the sequence at that version, and the cluster should stay on the last version you verified until the cause is understood. Recovery depends on your backups and on whether the schema change can be reversed, so confirm the restore procedure for both the persistence and visibility stores before the first step. Record each hop's result in staging so you know which failure modes you have already seen. Avoid moving to the next minor version until the failed step is resolved and the cluster has been observed in a stable state. Ask any partner to describe its escalation path and who approves a rollback.
How DeployOpen scopes, rehearses and supports Temporal upgrades
DeployOpen plans, implements, tests, documents and supports self-hosted open-source platforms inside the client's own infrastructure, including the database schema steps of Temporal Server upgrades. Engagements are fixed-scope, with the schema versions, persistence and visibility stores, and rehearsal plan agreed in writing before work starts.
How we scope
- We confirm the current Temporal Server version and the target version, with the schema steps each hop requires from the release notes.
- We record which persistence store (Cassandra, PostgreSQL or MySQL) and which visibility store (Elasticsearch, OpenSearch or SQL) your cluster uses.
- We agree in writing the staging rehearsal, the wait between schema steps, rollback points and the written deliverables before any change is made.
How we build
- We run each schema step with the matching temporal-sql-tool, temporal-cassandra-tool or temporal-elasticsearch-tool version in a staging copy of your environment.
- We check schema versions and shard health after every hop, and hold the next hop until the cluster is stable and the agreed wait has passed.
- We rehearse the server binary and Helm chart upgrades that follow the schema steps, with the order of operations written as a runbook you can rerun.
How we hand over
- You receive a version-by-version runbook with commands, expected outputs, checkpoints and the rollback procedure for each step.
- You receive a record of the staging rehearsal, including the schema versions tested, issues found and the fixes applied.
- Your operators walk through the production procedure with us so your team can run the next upgrade without us in the room.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers, covering the next Temporal minor version and its schema steps.
- We can retest the upgrade path when a new Temporal Server patch or minor release changes the schema requirements.
- Support scope, response expectations and review cadence are written into the retainer before work begins, with the quote following from that scope.

