Langfuse v2 to v3 upgrade

A self-hosted Langfuse v2 deployment needs new infrastructure, not just a new image, before it can run v3. This page explains the parallel path, the supported version window and the work that decides the timeline.

On this page

How the Langfuse v2 to v3 upgrade changes your deployment

A Postgres-only Langfuse v2 installation has one stateful store for everything. The v3 architecture adds a worker container, ClickHouse for traces, observations and scores, Redis or Valkey for queues and caching, and S3-compatible blob storage. That means your deployment gains new services to size, secure, back up and monitor, and existing trace data has to move out of Postgres. Because the data model and the runtime both change, Langfuse treats v2 to v3 as a major upgrade with its own guide, Migrate Langfuse v2 to v3, rather than a routine update that runs migrations at startup. Teams should start planning it well before they need the v3 features, because the new infrastructure needs provisioning, access reviews and a rollback path before any production traffic moves.

The supported path has four steps, and the order matters. First, take a backup of your Postgres database. Second, run a v2 release later than v2.92.0, since that is the baseline the guide describes. Third, stand up v3 in parallel on v3.29.0, the version the guide identifies as working well from v2.92.0 onward, and use it for parallel operation. Fourth, move to the latest v3 once the parallel setup is verified. Confirm the exact versions against the guide and your own change record before you schedule work, since later v3 releases may change migration behavior. Ask whoever runs the upgrade to show the backup restore test, the ClickHouse and Redis sizing for your ingestion volume, and the blob storage configuration. Those answers, more than the version numbers alone, determine how long the cutover window needs to be.

What the Langfuse v2 to v3 upgrade changes in the architecture

This table compares each architectural change in v3 with its impact on a Postgres-only v2 deployment and the action the operator must take. Read it as a checklist: every row is a component or behavior you must plan for before cutover.

ChangeImpactAction needed
Langfuse Worker containerAsynchronous event processing moves out of the web container into a second application container that must run alongside web.Provision a worker container next to web, size it on CPU load, and confirm both containers share the same configuration.
S3 or blob storageBlob storage is added as a required dependency for event and media data that v2 did not need.Provision an S3-compatible bucket, confirm credentials and network access from web and worker, and plan its backup.
ClickHouse for traces, observations and scoresAnalytical data is stored in ClickHouse instead of Postgres, so a new stateful datastore with its own sizing and backups is required.Deploy ClickHouse with the minimum resources in the scaling guide, plan disk headroom, and define a backup and retention approach.
Redis or Valkey for queues and cachingQueues and caching move to Redis or Valkey, adding another service to monitor and secure.Deploy Redis 7.0 or later or Valkey, restrict network access, and confirm its memory and persistence settings with your team.
Four background migrations from Postgres to ClickHouseCost backfill, then traces, observations and scores are copied in sequence, which can take multiple hours depending on table size.Schedule the migrations outside peak use, watch progress in the worker, and keep the old version available until they finish.
No support for SDK v1.x.xApplications still on Python or JavaScript SDK v1.x.x will not work with the v3 server.Inventory every service that sends traces, upgrade to SDK v2 or later, and test each one against a staging v3 instance before cutover.
Migration startup behaviorSetting LANGFUSE_ENABLE_BACKGROUND_MIGRATIONS=false lets new containers start without running migrations during parallel operation.Set this flag on new web and worker containers until traffic is shifted, then confirm the migrations run to completion.

How the v2 and v3 components connect

The v2 stack is a single Langfuse web application writing everything to PostgreSQL. The v3 stack adds a Langfuse Worker container, Redis or Valkey for queues and caching, ClickHouse for traces, observations and scores, and S3-compatible blob storage for event payloads. The diagram traces the background migration path that copies historic trace, observation and score rows from PostgreSQL into ClickHouse, which is the step to check before you cut over. Confirm that PostgreSQL still holds users, projects, prompts and configuration after the move.

Data ownership in the Postgres-only v2 stack compared with the split v3 stack.

Which starting version window works for the jump

The vendor's v2 to v3 guide recommends running a version later than v2.92.0 before you start the move to v3. A deployment older than that is outside the window the guide describes, so the first project is to get onto a supported v2 release, not to start the v3 build. Plan this as a separate, reversible step with its own backup and smoke test.

  • Upgrade within v2 first: Move to a v2 release later than v2.92.0 using the normal v2 path, and verify that traces, prompts and the UI work before going further.
  • Back up PostgreSQL before each step: Take a verified backup at every version change so you can roll back to the last known-good state.
  • Check SDK compatibility: Confirm which SDK versions your applications send traces with, since Langfuse v3 does not support SDK v1.x.x.
  • Record the exact starting version: Capture the running image tag or chart version so the migration plan matches what is actually deployed.

Before you schedule the v3 work, confirm with your deployment owner that the intermediate v2 upgrade has passed a full functional check in a non-production copy.

What to prepare before the Langfuse v2 to v3 upgrade starts

A v2 to v3 move changes the storage footprint, adds moving parts and introduces background work that can run for hours. The four items below are the groundwork that makes the parallel cutover safe, and each one has a named owner and a concrete output you can check before the upgrade window opens.

Postgres backup and restore test

The v2 to v3 guide recommends a Postgres backup before anything else changes. Treat the backup as unproven until someone restores it into a separate instance and runs the Langfuse web health check against it. The database administrator owns the backup job, and the platform engineer owns the restore test. The output is a dated restore log showing the time to restore and the row counts for the core tables, which becomes your rollback reference.

Minimum starting version
v2.92.0
v2 to v3 guide

Inventory of SDKs and custom integrations

Server v3 does not support SDK v1.x.x, so any service still on a 1.x Python or JavaScript SDK must move before cutover. List every application that sends traces, including scripts, notebooks, batch jobs and OpenTelemetry exporters, with its SDK version and the host or endpoint it posts to. The application leads own their entries, and the platform team reviews the list. The output is a register that shows which services need SDK changes and which can keep running unchanged during the parallel period.

Sizing ClickHouse, Redis or Valkey and workers

The v3 architecture adds ClickHouse, Redis or Valkey and a worker container to the Postgres-only setup you run today. Compare the planned hosts against the scaling guide minimums: 2 CPU and 8 GiB for ClickHouse, 1 CPU and 1.5 GiB for Redis or Valkey, and 2 CPU and 4 GiB for web, worker and PostgreSQL. The infrastructure owner signs off on capacity, and the platform engineer records the figures. The output is a sizing sheet with headroom for the historic backfill, which the background migrations will read and write heavily.

ClickHouse memory, larger deployments
16 GiB
Scaling guide

Staging environment with production data

Build a staging stack that holds a recent copy of production Postgres and blob storage, so the background migrations run against realistic table sizes instead of a demo dataset. Keep staging network-isolated and avoid sending live SDK traffic to it. The platform team owns the environment, and the application owner signs off on the test traces. The output is a timed staging migration run with notes on which steps were slow, which informs how long the production window must be and whether the parallel stack is ready to take traffic.

How the parallel approach keeps v2 traffic running

The zero-downtime method for a v2 to v3 move keeps your existing Postgres-only v2 stack serving users while a parallel set of v3 containers is built and checked. The team provisions new Langfuse Web and Langfuse Worker containers running v3 and sets LANGFUSE_ENABLE_BACKGROUND_MIGRATIONS to false on them, so they start without triggering the four background migrations that copy cost, traces, observations and scores into ClickHouse. The new containers point at the same PostgreSQL, ClickHouse, Redis or Valkey and blob storage that v3 needs, and the team confirms they start cleanly, pass health checks and answer UI and API requests before any production traffic reaches them. Traffic is then shifted at the load balancer or ingress in a controlled step that can be reversed.

Before shifting traffic, confirm that a current PostgreSQL backup exists and that the v2 source version is later than v2.92.0, as the Langfuse v2 to v3 upgrade guide recommends. Check that the v3 version you deploy is v3.29.0 for the parallel phase, since that is the release the guide names for this transition, and confirm the SDK versions your applications use are compatible with v3, because the v3 server does not support SDK v1.x.x. Verify that the new containers reach every shared store, that ClickHouse has the memory and disk the guide and your sizing review call for, and that ingestion from a test client lands where you expect. Agree the rollback steps in writing, including how traffic returns to v2 and which data written during the overlap would need reconciling.

Running two application versions against shared stores is the main risk of this phase. The v2 containers write only to PostgreSQL, while the v3 containers may write to ClickHouse and Redis or Valkey, so a v3 instance with background migrations enabled, or a misconfigured environment variable, could change data the v2 fleet still reads. Keep the v3 pool isolated until verification passes, limit who can reach it, and record which version handled each request so that a problem can be traced to one side of the split.

The background migrations are held back because they are long, sequential and touch data the live system depends on. Langfuse runs them in order, starting with the cost backfill and then moving traces, observations and scores from Postgres to ClickHouse, and the guide notes they may take multiple hours depending on table size. Starting them before the cutover plan is ready would load both databases during normal use and leave the copy half finished if traffic has to move back to v2. Plan the migration window, the monitoring you will watch while it runs, and the point at which you will enable background migrations on the v3 pool, and only then set LANGFUSE_ENABLE_BACKGROUND_MIGRATIONS to true as a deliberate step.

Langfuse v2 to v3 upgrade sequence with rollback points

This sequence moves a Postgres-only Langfuse v2 deployment to v3 in ordered phases, with a check that must pass and a rollback point at each step so the team knows when reverting is still simple and when it becomes costly.

  1. Back up the Postgres database

    Take a full, verified backup of the existing v2 PostgreSQL database before anything else changes. Confirm the v2 server is on a version later than v2.92.0, as the migration guide recommends, and record the exact version in the change record. The owner is the platform or database team, working with the Langfuse operator. The step is done when a restore of the backup has been tested on a separate instance and the restored database starts and shows expected project and trace counts. Rollback point: at this stage, rolling back costs nothing because v2 is untouched.

  2. Rehearse the upgrade in staging

    Run the full v2 to v3 path against a staging copy of the production database, with the same blob storage type, Redis or Valkey, and ClickHouse sizing you plan to use in production. Use Langfuse v3.29.0 as the intermediate version for parallel operation, as the migration guide describes, then time the background migrations and note how the table sizes affect them. The step is done when the staging v3 instance serves the UI and API, the SDK test traffic appears in ClickHouse, and the team has a written runbook. Rollback point: staging can be discarded and rebuilt at no cost to production.

  3. Provision v3 stores and containers with background migrations off

    Provision ClickHouse, Redis or Valkey, S3-compatible blob storage, and new langfuse-web and langfuse-worker containers alongside the existing v2 deployment. Set LANGFUSE_ENABLE_BACKGROUND_MIGRATIONS=false on the new web and worker containers so that they start without moving historic data. Confirm that the minimum resources in the scaling guide are met for each store. The step is done when the new containers pass health checks and can write test events to ClickHouse without touching the v2 database. Rollback point: the v2 deployment still serves all traffic, so the new stack can be removed without any data loss.

  4. Verify the parallel v3 environment

    Send synthetic and replayed SDK traffic to the new v3 endpoint and compare trace, observation and score counts, UI behavior and API responses with v2. Check that SSO, API keys and project settings match what users expect. The owner is the Langfuse operator with input from application teams that own SDK integrations. The step is done when the agreed test set passes and the team signs off on the differences found. Rollback point: rolling back here means pointing test clients back to v2, which is still simple because both systems hold their own data and v2 has not changed.

  5. Shift production traffic to v3

    Move production application traffic from v2 to the new v3 web endpoint, typically through the ingress or load balancer, and keep v2 running in a standby state. Watch error rates, ingestion latency and queue depth in the new stack during the shift. The step is done when all production SDK traffic reaches v3 and the operator has confirmed that no data is being lost in the window. Rollback point: switching the routing back to v2 is still simple, but any traces written only to v3 during the shift will not appear in v2 without a separate export, so note the time window of writes.

  6. Enable background migrations

    Once traffic is stable on v3, set LANGFUSE_ENABLE_BACKGROUND_MIGRATIONS to true on the v3 containers so that the four background migrations run in sequence: cost backfill, then traces, observations and scores from Postgres to ClickHouse. These can take multiple hours depending on table size, so monitor progress and worker load. The step is done when all four migrations report complete and spot checks of historic traces in the UI match the v2 database. Rollback point: rolling back is costly from here, because reverting means restoring the v2 backup or re-running migrations into a second environment, so keep the v2 database and backup until verification is complete.

  7. Decommission v2 after verification

    After historic data is verified in ClickHouse and the agreed retention period for the v2 database backup has been set, shut down the v2 web and worker containers and archive the v2 database snapshot under your retention policy. Update runbooks, monitoring and alerts to refer to v3 only. The step is done when the v2 containers are stopped, the archived backup has been checked for restorability, and the change record shows the final state. Rollback point: after decommissioning, returning to v2 requires restoring from the archived backup, which is the most costly point in the sequence, so keep the backup until the team accepts the result.

How the background migrations move data into ClickHouse

Langfuse v3 runs four background migrations in sequence. The first is a cost backfill, after which traces, observations and scores move from PostgreSQL into ClickHouse, in that order. Each step reads historic rows from the v2 tables and writes them to the analytical store that v3 queries for trace views, dashboards and scores. The migrations are the reason the upgrade is not a simple container swap: until they finish, the history you migrated is not yet fully visible in the new architecture. Langfuse notes that the full run may take multiple hours depending on table size, so the duration depends on your data volume and should be measured in a rehearsal on a copy of production rather than assumed.

Control when the migrations run through LANGFUSE_ENABLE_BACKGROUND_MIGRATIONS. In the zero-downtime approach, the new web and worker containers start with this set to false so they serve traffic without competing with the migration job, and you enable it on the worker once you are ready for the data to move. Watch the worker logs for each migration's start and completion, check that ClickHouse disk usage and memory stay within the headroom you planned, and confirm the row counts in ClickHouse against PostgreSQL for each table before you treat a step as finished. Confirm the exact progress reporting and log messages for your release in the upgrade guide, since they are not described in the supplied facts.

Expect the new v3 interface to show complete data only after the relevant migration has finished. Older traces, observations and scores may be missing or slow to appear in views during the run, while new ingestion lands in ClickHouse as normal. Plan a communication to users and dashboard owners about this window, and decide in advance whether you will keep the v2 instance read-only for reference until all four steps are verified. If a migration fails or stalls, keep the PostgreSQL backup and the v2 deployment available, and escalate using the logs and the Langfuse upgrade guide rather than restarting steps by guesswork.

What makes the Langfuse upgrade take longer

This table compares the drivers that stretch a Langfuse v2 to v3 upgrade, how each one changes the effort, and what to measure before you plan the window. Read it as a checklist: the drivers that scale with your existing data and clients usually set the schedule more than the software itself.

DriverEffect on effortWhat to measure
Postgres table sizeThe four background migrations copy traces, observations and scores from Postgres into ClickHouse, so larger tables extend the run, which Langfuse says may take multiple hours.Row counts and on-disk size for the trace, observation and score tables, plus a timed copy in a non-production environment.
Trace and score volumeHigh ingestion keeps the worker busy during migration and raises the need for parallel operation before cutover.Daily ingestion rates for traces, observations and scores, and peak hours when the old stack is under load.
SDK clients still on v1 or v2Server v3 does not support SDK v1.x.x, so any v1 client must be upgraded before or during cutover, adding coordination across teams.Inventory of every service and notebook sending traces, with the SDK name and version each one uses.
Custom integrations and dashboards reading PostgresQueries written against Postgres tables may return incomplete or no data once trace data moves to ClickHouse, so each one needs a rewrite or a test.List of direct database readers, scheduled reports and BI connections, with owners for each.
ClickHouse deployment sizeA small cluster leaves little room for the migrated history and the backfill work, which pushes you to resize before the run starts.Current disk, memory and CPU use against the minimums in Langfuse's scaling guide, and free disk after a test copy.
Number of environments to rehearseEach environment, such as staging, production and disaster recovery, repeats the backup, migration and rollback steps, so effort grows with every copy.Count of environments, their data volumes and whether each one has a tested Postgres backup and restore path.

How to test the upgrade and roll it back safely

Testing a v2 to v3 move is about proving that data, SDKs, and performance hold on the new stores before traffic depends on them. The four cards below run from data checks through to a rollback path that stays open until the cutover is formally accepted.

Verify data after background migrations

Compare record counts for traces, observations and scores in ClickHouse against the matching tables in Postgres once the background migrations finish. Then open a sample of traces in the v3 UI and confirm that inputs, outputs, metadata, timestamps and scores match what v2 showed. Counts alone do not prove the data is intact, so pick sample traces across several projects and date ranges. This test proves that the migration moved the history you expect, not just rows.

Langfuse v2 to v3 guide

Test SDKs and ingestion against v3

Send traces from each SDK version and application your teams run against the v3 staging stack, including the traffic path through your gateway or load balancer. Check that new traces appear in ClickHouse, that scores and prompt links attach correctly, and that errors from ingestion are visible in the worker logs. Confirm that your SDK generation is supported, since Langfuse v3 does not support SDK v1.x.x. This test proves that existing applications keep sending data after the switch.

Check performance on the new stores

Load test the v3 web and worker containers with realistic ingestion volume, then watch ClickHouse query latency, Redis or Valkey queue depth and Postgres connection use. Run the same dashboards and trace searches that your users depend on, and time them against v2. Note the minimum resources in the scaling guide as a baseline, but size against your own peak load. This test proves that the stack keeps up with ingestion and that users see acceptable query times after the move.

Langfuse scaling guide

Keep the v2 rollback path open

Keep the verified Postgres backup of the v2 database, the v2 release image and its configuration files available until the cutover is accepted in writing. Record the exact v2 version and the v3 version used for parallel operation so a rollback does not depend on memory. Decide in advance who can authorize a return to v2 and what symptoms trigger it, such as missing data or failed ingestion. Rehearse restoring the backup into a scratch environment. This plan proves that the team can return to a known-good state if the new stack fails.

How much effort the Langfuse v2 to v3 upgrade takes

What drives the cost and effort of a Langfuse v2 to v3 upgrade?

The biggest drivers are how much trace history sits in Postgres, how many services send data to Langfuse, and how much infrastructure you must add. The v3 architecture adds a worker container, blob storage, ClickHouse for traces, observations and scores, and Redis or Valkey for queues and caching, so each of those needs provisioning, sizing, networking and backups. Effort also grows with the number of SDK integrations to inventory and test, and with any custom networking, SSO or reverse proxy setup. Ask a partner to price each of these as a separate line in the written scope so you can see which items are one-time work and which recur as infrastructure you run.

How long does the upgrade take, and what sets that time?

The largest variable is the background data migration. Langfuse v3 runs four background migrations in sequence: a cost backfill, then traces, observations and scores moving from Postgres to ClickHouse. Langfuse notes these may take multiple hours depending on table size, so your row counts are the first thing to measure. Other time drivers are building and load testing the parallel environment, validating SDK traffic, and the change window you need for the final traffic shift. Ask for a timeline that separates the parallel build, the migration run and the cutover, and confirm the migration duration against your own table sizes in a test copy.

What must our team provide before the engagement starts?

Plan to provide several things before work begins:

  • Administrative access to the current v2 host or cluster, the Postgres instance and the cloud or data center accounts where the new components will run.
  • A verified Postgres backup and a restore test, since Langfuse recommends taking a Postgres backup before the upgrade.
  • An inventory of every SDK and integration that sends traces, with the SDK versions in use, because Langfuse v3 does not support SDK v1.x.x.
  • Named staff for sign-off on the test results, the cutover window and rollback decisions.

Confirm in the quote who holds each item and when it is due.

Can an internal platform team complete the v2 to v3 upgrade alone?

Often yes, if the team has Postgres, Kubernetes or Docker operations experience and time for a parallel environment and a background migration run. The work is mainly planning and operations rather than custom development, and the official upgrade guide documents the sequence. The risks are staffing and schedule: the migration needs monitoring for hours, the parallel environment must be proven before traffic moves, and someone must own the SDK inventory. Teams without ClickHouse experience should weigh that gap, since ClickHouse holds traces after the upgrade. Decide based on whether you have people available for the full run, not only the initial build.

What does a fixed-scope quote for this upgrade typically cover?

A fixed-scope quote should list each deliverable and the conditions it depends on. Expect items such as the target architecture, provisioning of Langfuse Web, Langfuse Worker, Postgres, Redis or Valkey, ClickHouse and blob storage, the parallel-operation plan starting from v3.29.0, the background migration run and validation, the traffic cutover, and the documentation handover. Confirm whether the quote includes SDK changes, SSO reconfiguration, backup and restore testing, and post-cutover support. Anything the written scope leaves out should be priced separately so the total is clear before work starts.

How is rollback priced into the upgrade?

Rollback is cheaper to plan than to improvise. Because the recommended approach runs new v3 containers alongside v2 until traffic is shifted, keeping the v2 environment available is the main rollback path, and that carries running cost for as long as you keep it. Ask the quote to state how long the v2 environment stays up, who decides when to roll back, which backups are restored in a failure, and whether rollback rehearsal is included. Also ask whether a rehearsal on a copied dataset is a separate line item, since it uses extra infrastructure and staff time.

What happens to our trace data if the upgrade fails partway?

Your v2 data stays recoverable when you follow the documented sequence. Langfuse recommends a Postgres backup before starting, and the v2 deployment is left running during parallel operation, so a failed migration does not have to delete source data. A failure during the background migration can leave ClickHouse with partial data, so you should plan to rerun the migration or restore from backup rather than edit tables by hand. Confirm in writing where backups are stored, how a restore is tested, and whether the Postgres data is retained until you accept the v3 result.

How DeployOpen scopes and delivers the Langfuse upgrade

DeployOpen treats the move from a Postgres-only Langfuse v2 deployment to v3 as a fixed-scope engagement inside your own infrastructure. The work starts with a written scope covering the ClickHouse, Redis or Valkey and blob storage targets, the parallel environment, the cutover plan and the background migration window.

How we scope

  • We inventory your current v2 version, Postgres size, trace volume and hosting model before agreeing the target v3 version.
  • The written scope names the parallel environment, cutover steps, rollback point and which teams sign off each stage.
  • We confirm with you the ClickHouse, Redis or Valkey and S3-compatible storage you will run, and who operates them.

How we build

  • We provision the new web and worker containers with background migrations disabled until traffic is ready to move.
  • We run the four v3 background migrations in sequence and record progress, row counts and any errors against the planned window.
  • We test SDK traffic, login paths and API calls against the parallel stack before shifting any production traffic.

How we hand over

  • You receive a runbook covering the backup, cutover, rollback and migration monitoring steps as they were actually run.
  • Configuration, environment variables and architecture decisions are documented so your team can operate the v3 stack.
  • We walk your platform and security teams through the handover and confirm the post-cutover checks are in place.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer after the handover is complete.
  • Retainer work can cover routine minor version upgrades and later major upgrades, scoped in writing before work starts.
  • Ask us to confirm which support terms apply to your deployment before you sign the 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.