-
|
I am having a look at the https://langfuse.com/self-hosting/configuration/backups docs since we are interested on doing backups of a (selfhosted also) Clickhouse Langfuse DB however we are having issues restoring the data. In the docs backup is explained (via several methods, we are using the clickhouse-backup tool), however we have no info on the restore process. Once the Clickhouse DB is restored, the langfuse web container at restart shows the following error: I already tried the first time with e.g. Are there any guidelines/docs on how to recover langfuse after a restore of the clickhouse db? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
The issue you're experiencing is covered in the Langfuse documentation for handling failed ClickHouse migrations(1). When you restore a ClickHouse database backup, the migration tool marks the database as 'dirty' and prevents additional migrations from running(1). The error "Dirty database version X. Fix and force version" indicates your database has been marked as 'dirty'(1). You need to investigate whether the migration was partially applied or not applied at all, then force your database to the version that accurately reflects its current state(1). Here's the process to fix this:
Replace the database credentials with your own(1). The version number (15 in this example) should be the last successfully applied migration(1).
The key point is that once you've forced the correct version and fixed the migration, your database will be 'clean' again, allowing you to proceed with subsequent migrations(1). For your specific case where you're seeing incrementing version numbers (version 1, then version 2), you'll need to determine which was the actual last successful migration version before the restore and force to that version rather than trying to update the dirty flag directly. 📚 Sources: Have another question? Just tag @inkeep. |
Beta Was this translation helpful? Give feedback.
-
|
@andresC98 Can you share the state of the |
Beta Was this translation helpful? Give feedback.
I ended up switching to https://clickhouse.com/docs/operations/backup#configuring-backuprestore-to-use-an-s3-endpoint using clickhouse native
BACKUP/RESTORE TO/FROM S3operations and this time worked fine. Seemed like theclickhouse-backuptool did not properly back everything that langfuse needed.