Why teams move Open WebUI from SQLite to PostgreSQL and what the move involves
Teams move Open WebUI from SQLite to PostgreSQL when a single instance grows into several replicas or a shared company deployment. The move is a planned database migration with a verified cutover and a tested rollback, and its effort depends on the volume of data, the integrations that read or write it and how much downtime the users can tolerate. The Open WebUI scaling guide requires PostgreSQL for multi-instance deployments, because SQLite does not handle concurrent writes from multiple processes well. SQLite stays acceptable for a single replica, evaluation or a small team, but only when the database file sits on locally attached SSD or NVMe storage rather than network storage.
The database is rarely the only change. The scaling guide also requires Redis as a shared state store for sessions, websocket connections and application state once several replicas run, plus shared file storage so uploads and knowledge stay reachable from every replica. The default ChromaDB crashes in multi-process setups, so an external vector database is needed as well. Confirm these with your own architecture before you schedule the database cutover, because a PostgreSQL move that leaves sessions, files or vectors on the old assumptions will fail under load in ways the database migration itself will not reveal. The scaling guide lists the components and their order.
Start by confirming which Open WebUI version you run and which migration path that version documents, then inventory every consumer of the database, including backup jobs, reporting queries and any tools that read webui.db directly. Ask the team that owns the platform to state the acceptable write freeze window, the rollback trigger and who approves the switch. A migration that cannot be rolled back to the SQLite file within an agreed time is not ready to run, so keep the original database and its file storage untouched until the new stack has passed verification.
Which SQLite data and settings map cleanly to PostgreSQL and which need separate work
This table compares each category of Open WebUI data on a SQLite installation with where it lands after migration and what needs separate work. Items marked as database records move with the database load, while items on disk, in Redis or in a vector store need their own steps. Confirm every table and schema detail against the Open WebUI version you run, because the database layout can change between releases.
| Data | Where it lives after migration | Migration notes |
|---|---|---|
| Users and roles | Database records in PostgreSQL | Moves with the database load. Confirm user, group and role records against your version's schema after the load. |
| Chats and messages | Database records in PostgreSQL | Moves with the database load. Compare chat and message row counts between source and target before cutover. |
| Settings and admin configuration | Database records, plus environment variables on the new server | Environment variables are not in the database, so set them on the new server to match the old values, including the secret key. |
| Sessions and sign-in tokens | Redis, required for multiple replicas | Without Redis, tokens stay valid until they expire, by default after 4 weeks. Plan a forced sign-out at cutover. |
| Uploaded files | On disk in shared file storage, outside the database | Copying webui.db alone loses these files. Move the data directory or object store and verify file references after cutover. |
| Knowledge bases and vector data | External vector database, chosen for the target deployment | Plan to re-index knowledge bases from source files after cutover. Confirm which vector backend the new deployment will use. |
| Default embedded ChromaDB | Replaced by an external vector database before scaling out | The scaling guide warns that the default ChromaDB crashes in multi-process setups, so resolve this before running several workers or replicas. |
Documented paths for moving Open WebUI data to PostgreSQL
Open WebUI documents its requirement for PostgreSQL, but the supplied sources do not document a tool that moves an existing SQLite database into PostgreSQL. The paths below separate what Open WebUI documents, what is general PostgreSQL tooling, and what you must confirm with the project before production use.
Open WebUI database setting
Open WebUI documents PostgreSQL as its target database, and the connection is set in the deployment configuration. Point a test instance at an empty PostgreSQL database, restart it, and confirm the tables exist in PostgreSQL before any data is loaded. Confirm the exact variable name for your release, because configuration keys change between versions. Keep the SQLite file untouched until verification passes so you can point the instance back if needed.
Scaling guide PostgreSQL requirement
The scaling guide requires PostgreSQL instead of SQLite for multi-instance deployments, because SQLite does not handle concurrent writes from multiple processes well. This requirement is the documented reason to migrate and sets the target engine. The scaling guide does not describe how to copy existing rows. Plan the move together with Redis for shared state and shared file storage, since replicas need both.
Scaling guideNo documented SQLite migrator
The supplied Open WebUI sources do not describe an automated tool that moves an existing SQLite database into PostgreSQL. Treat any migrator as unconfirmed until the project or its release notes name it for your version. Ask the project whether the schema for your release is the same on both engines and whether any SQLite data types or JSON-like columns need special handling. Record the answer in your change plan before scheduling downtime.
Third-party SQLite converters
Community converters, including pgloader-style tools, can read SQLite and write to PostgreSQL. Their support for Open WebUI's schema is not confirmed. Run any converter against a copy of the SQLite file, then compare table names, row counts and column types with the tables Open WebUI created. Check how the tool handles booleans, timestamps and text with special characters before using it on production data.
pg_dump and restore for PostgreSQL copies
pg_dump and pg_restore are general PostgreSQL tools for copying a PostgreSQL database, so they apply after rows are already in PostgreSQL. Use them to back up the target before cutover and to rehearse restores on a staging server. They do not read SQLite files. Time a dump and restore on a copy of your real data, because that timing sets the downtime window for the cutover.
Logical replication between PostgreSQL versions
Logical replication works between different PostgreSQL major versions, and the upgrade documentation describes it for major upgrades with only several seconds of downtime. It replicates from one PostgreSQL server to another, so it does not read SQLite. Use it later, when you change PostgreSQL major versions on the new database. Choose a target version that is still supported at your cutover date and check the published end-of-life dates.
Upgrading docsHow the migration runs: inventory, pilot, parallel run, cutover and decommission
The sequence moves a SQLite-backed Open WebUI database onto PostgreSQL in an order that keeps a verified rollback point until the new database has proven itself in production.
Inventory the instance and its version
Record the running Open WebUI version, the install method (Docker, Compose, Helm or pip), the location of the data directory and webui.db, the WEBUI_SECRET_KEY in use, the environment variables that set the database URL, and any Redis, vector database or object storage already attached. Check the file's size and the storage it sits on, since SQLite on network storage is the weakest point to be aware of before you start. The output is a written inventory that the team signs off, so every later step has a known starting state.
Confirm the target PostgreSQL version
Choose a PostgreSQL major version from the list of currently supported releases in the versioning policy, and check the end-of-support date against the expected life of the deployment. Confirm with the Open WebUI release you run that it supports the chosen PostgreSQL version and that the migration path you plan to use is documented for that release. The output is a recorded version decision, with the support end date noted for the operations calendar.
Rehearse the migration on a staging copy
Restore a copy of the data directory to a staging host, start the same Open WebUI version against a new PostgreSQL instance, and run the chosen migration tooling from start to finish. Time the run, note every error and workaround, and record the exact commands and configuration used. Repeat the rehearsal until it runs cleanly and produces the same result twice. The output is a tested runbook that the production window will follow without improvisation.
Verify counts, samples and login
Compare row counts for users, chats, messages, models, prompts, knowledge and group tables between the SQLite source and the PostgreSQL target. Pull a sample of records from each table and check content, timestamps and ownership. Sign in as a range of test accounts, including an administrator, and confirm that chat history, settings and uploads open as expected. The output is a signed verification record listing every check and its result, which becomes the acceptance gate for cutover.
Run the parallel check on a non-production path
Keep the staging stack running against PostgreSQL alongside the live SQLite instance for a set period of ordinary use, with test users performing realistic workflows. Compare behavior, error logs and database load, and record any difference in outputs or performance. Confirm that the team can reach the new instance through the same reverse proxy and certificate path that production will use. The output is a list of resolved differences and a go or no-go decision for the cutover window.
Back up and freeze before the final copy
Schedule the cutover window with the users who will be affected, and announce the freeze so that no new chats, uploads or settings are written during the copy. Stop the live Open WebUI process so the SQLite file is no longer changing, then take a full backup of the data directory, including webui.db, uploads and vector data, and store it outside the host. Verify that the backup can be read before continuing. The output is a verified backup and a confirmed freeze, without which the final data copy must not begin.
Switch the connection and run final checks
Run the final data copy using the rehearsed runbook, point the database URL setting at PostgreSQL, and start Open WebUI. Repeat the count and sample checks from the verification step against the production target, then confirm sign-in, chat, file access and admin functions before opening the window to users. The output is a production instance on PostgreSQL with a documented result for each check and a record of the cutover time.
Keep the SQLite file and decommission later
Retain the SQLite database file and the pre-cutover backup as a rollback point for a period agreed in advance by the owners of the service, with the rollback steps written down and tested in staging. Monitor logs, database health and backups on PostgreSQL during that period. Decommission the SQLite file only after the owners sign off, then remove the old storage path and update the inventory, backup jobs and runbooks. The output is a closed change record showing the rollback window ended and the old database was removed on an approved date.
The cutover moves forward only after the verification gate passes
The path starts with a backup and a frozen SQLite file, then exports and loads the data into PostgreSQL. A verification gate sits between the load and the connection string switch, so a failed check never reaches users. If any check fails, the rollback branch restores the SQLite file and the original configuration before the service restarts. Smoke tests after the restart confirm sign-in, chats and uploads work against the new database.
Cutover path with the verification gate and rollback branch.
What drives the effort and cost of the database move
This table compares the factors that change how much work the SQLite to PostgreSQL move takes and who pays for each part. Read each row as a question to answer about your own installation before requesting a quote, since most of the cost depends on data volume, the shape of your replica plan and how much downtime the business will accept.
| Driver | Why it changes effort or cost | Who is paid for what, and one-time or recurring |
|---|---|---|
| Database size, chats and uploaded files | Larger databases take longer to export, load and verify. Uploaded files stay on disk and are not moved by the database migration, so file volume affects the storage plan more than the copy time. | One-time: the engineer's time for the export, load and checks. Ask the partner to confirm which data sits in the database and which sits in the data directory. |
| Number of replicas planned | Several replicas require Redis and shared file storage, which adds design and testing work beyond the database move. | One-time: design and testing of the shared services. Recurring: the hosting of Redis and shared storage. Confirm whether the quote covers these or only the database. |
| Redis and shared storage already in place | If both exist and are tested, the move stays focused on the database. If either is missing, scope grows and the cutover plan changes. | One-time: installation and configuration when missing. Ask whether the client's platform team or the partner builds and owns them. |
| Vector store choice and re-indexing | Vectors are not copied as a database export in the same way as rows. Changing the vector store can require re-indexing knowledge bases, which takes compute time and affects downtime. | One-time: re-indexing work and compute. Recurring: vector database hosting. See the sibling topic on switching vector databases for the detailed steps. |
| Downtime tolerance | A short freeze for a final sync needs a tight cutover runbook and rehearsal. A longer window allows a simpler export and import but affects users. | One-time: rehearsal and runbook work. Ask the partner what cutover window they plan for and how many rehearsals are included. |
| SSO and API key dependencies | Identity settings, OIDC clients, API keys and tokens reference the existing setup. Changes to URLs, secrets or the database can break sign-in or integrations. | One-time: testing and reconfiguration of identity and integrations. Ask who holds identity provider access and who signs off on test results. |
| PostgreSQL hosting and backup model | A managed or existing PostgreSQL service with tested backups and point-in-time recovery reduces setup work. A new server needs high availability, backups and pooling designed from scratch. | Recurring: database hosting, licensing where applicable, backup storage and monitoring. One-time: setup of backups and recovery tests. Ask whether backup restore has been tested. |
| Number of custom integrations | Each custom tool, function, pipeline or external client that reads the database directly needs review and retesting after the move. | One-time: review and retesting of each integration, usually by the team that owns it. Ask for an inventory before the quote is finalized. |
What usually goes wrong in a SQLite to PostgreSQL move and how to prevent it
Most failed moves come from treating the database as the only thing that changes. Stored files, vectors, secrets, sessions, and the rollback path all depend on the same cutover, so each risk below needs a named check before the old database is retired.
Copied database file loses files and vectors
Copying webui.db alone moves the account and chat records but not the uploads, knowledge files, or vector index on disk. Users then see chats that point to missing documents, and retrieval returns nothing. Before cutover, confirm that the complete data directory and the external vector store are migrated together, and spot-check a knowledge base and an uploaded file after the first start on the new database.
Secret key changes after the move
Open WebUI uses a secret key to protect stored secrets and tokens. If the new environment starts with a different key, values written under the old key can no longer be read, and integrations that depend on them fail after sign-in. Record the key in your secrets manager, configure the same value on the new deployment before first start, and test one integration that uses a stored credential.
Sessions stay valid after sign-out
Without Redis, signing out does not revoke tokens. They stay valid until they expire, by default after 4 weeks. During a move, a user who signed out on the old system can keep a working session on the new one. Plan Redis as part of the target design, or document the exposure and shorten the token lifetime for the migration window.
Writes continue during the copy
If users keep chatting while the export runs, the new database misses every message, feedback entry, and account change written after the snapshot. Stop the Open WebUI service or block writes at the reverse proxy for the full copy window, then take a final export after the stop. Verify row counts on both sides before reopening access.
Mismatched PostgreSQL versions
Tooling and client libraries behave differently across PostgreSQL major versions, and the version in your target environment may not be one that receives security fixes for long. Choose a supported major version, record the exact version in the runbook, and run the import against that same version in a staging instance before production.
Authentication not set up on the new database
A new PostgreSQL instance may accept connections with weak or default authentication, or Open WebUI may fail to connect because the role lacks rights on the schema. Use SCRAM password authentication, a dedicated application role with least privilege, and network rules that allow only the Open WebUI hosts. Confirm the connection from the application host, not from an administrator workstation.
No tested rollback
A rollback path that has never been run usually fails when it matters. Keep the original SQLite file and data directory untouched until the new system passes verification, and rehearse switching the configuration back in staging. Agree on the criteria that trigger rollback before the window opens, and assign one person to make that call.
Questions teams ask before moving Open WebUI to PostgreSQL
How much effort and cost should we expect for a SQLite to PostgreSQL move?
Cost depends on the size and shape of your installation, not on the database move alone. The main drivers are the number of users and chats to verify, whether the move happens on a single server or a multi-replica setup, how much of the surrounding stack (Redis, shared file storage, vector database) is already in place, and how many environments need the same procedure, such as staging and production. A written scope should separate one-time work (planning, rehearsal, cutover, verification, rollback test) from recurring work (database backups, patching, monitoring). Ask any provider to itemize these phases and to state which environments and which Open WebUI version are covered.
How long is the downtime during the move, and what sets it?
Downtime is set by how long Open WebUI must stop writing to the database while data is copied, checked and cut over. The size of the database, the time needed for a full export and import, and the number of verification passes you require all add to it. A dry run on a copy of production is the only reliable way to measure it for your installation. The PostgreSQL upgrading documentation describes logical replication as a way to reduce the window for major version changes, but that method applies between PostgreSQL versions, not between SQLite and PostgreSQL, so plan a freeze window and confirm the figure from your own rehearsal.
What must our team provide before the move starts?
You need to provide access and decisions that only your organization can give. The list usually includes:
- A current backup of the SQLite database and the data directory, including the secret key used by the installation
- A PostgreSQL server or managed instance that you control, with network access from the Open WebUI host and credentials kept in your secrets store
- A maintenance window, an approver for the cutover and a named owner for user communication
- Staging access that mirrors production, and a copy of the Open WebUI version and configuration in use
- A decision on how Redis, shared file storage and the vector database will be handled if you run more than one replica
Ask the provider which of these they need from you in writing before work starts.
Can our in-house team migrate Open WebUI to PostgreSQL without a partner?
Yes, a team with database administration and container operations experience can do the work, provided it treats the move as a rehearsed change with a rollback plan. The skills that matter most are PostgreSQL administration, backup and restore, container and environment configuration, and checking application data after the move. The Open WebUI scaling guide requires PostgreSQL for multi-instance deployments, so teams that plan to scale should also plan Redis and shared storage at the same time. A partner adds value mainly when the team lacks rehearsal time, needs independent verification, or must meet audit evidence requirements. Confirm your own skills against the steps before deciding.
Which PostgreSQL version should we choose for this move?
Choose a version that is still in its support window for the whole period you expect to run it. According to the PostgreSQL versioning policy, version 18 was first released September 25, 2025 and is supported until November 14, 2030. Version 17 is supported until November 8, 2029, version 16 until November 9, 2028, and version 15 until November 11, 2027. Version 14 is supported only until November 12, 2026, so it is a poor choice for a new deployment. Confirm the version your Open WebUI release and your managed database service support before you commit, and check the PostgreSQL 18 release announcement for changes that may affect your operations.
Does the Open WebUI Enterprise License or the Open WebUI License change the migration work?
The database move itself is the same under either license, because the work concerns data, not branding. The license matters for the surrounding deployment. Under the Open WebUI License, deployments above 50 users in any rolling 30-day period must keep Open WebUI branding unless the operator holds an enterprise license or written contributor permission. Enterprise licenses add white-labeling and dedicated support options, and pricing is quoted by Open WebUI sales after you give an expected seat count. Before scheduling the cutover, confirm which license covers your user count and whether any branding changes are planned alongside the move, so that the change is not mixed into the same window.
What should we check after cutover to confirm the data is intact?
Verification should compare the source and target, then test the application as users will use it. Check row counts for the main tables, confirm that users can sign in and that existing sessions behave as expected, open sample chats and uploaded files, and confirm that API keys and configured connections still work. If you run several replicas, confirm that Redis is in place, because the scaling guide notes that without Redis, signing out does not revoke tokens, which stay valid until they expire, by default after 4 weeks. Keep the SQLite file untouched until the verification and rollback steps are signed off.
Official sources for the Open WebUI and PostgreSQL migration
Start with the Scaling Open WebUI guide, because it sets the reason for this move. Confirm which PostgreSQL requirement applies to your deployment, whether you are moving to several replicas or staying on one, and read the notes on Redis, shared file storage and the external vector database alongside it. The guide also states that SQLite is acceptable for a single replica only on locally attached SSD or NVMe storage. Check that statement against your current host before you decide whether the move is urgent. Confirm the exact Open WebUI version you run, since the migration steps depend on it, and check the release notes for that version on the project's GitHub releases page.
For the database side, read the upgrading documentation in the PostgreSQL manual first, then the versioning policy. The upgrading guide explains the difference between a minor update and a major move, and it covers the options for copying data between clusters. The versioning policy tells you which major release to target and how long it will receive fixes, so confirm the support end date for the version you plan to install before you build the target server. Your team should also confirm the Open WebUI schema version it expects, because the tooling you choose must produce a database that Open WebUI can open without a schema change it does not support.
Before cutover, read the documentation on continuous archiving and point-in-time recovery and the high availability chapter. The archiving guide explains how to take a base backup and retain write-ahead logs so you can restore to a chosen moment, which is the rollback path you need if verification fails after cutover. The high availability material describes replication options that can reduce downtime, and it states that PostgreSQL does not detect a failed primary by itself. If you plan a standby, confirm who owns failover detection and test restores on a separate host before the migration window.
How DeployOpen scopes, delivers and supports the Open WebUI database migration
DeployOpen plans the move from SQLite to PostgreSQL as a fixed-scope engagement inside your own infrastructure, with the cutover window, rollback point and verification checks agreed in writing before any work starts. The work covers the database, the Redis and file storage dependencies a multi-replica Open WebUI needs, and the documentation your operators use afterward.
How we scope
- Inventory the current Open WebUI version, database size, file storage location and secret key handling before quoting.
- Confirm whether the target runs one replica or several, since multi-instance setups need Redis and an external vector store.
- Agree in writing the downtime window, acceptance checks, rollback point and which team owns each step.
How we build
- Set up a PostgreSQL target in your infrastructure with the major version you select after checking the support dates.
- Run the data move in a rehearsal copy first, then record row counts and login tests for each table group.
- Document the exact commands, configuration keys and environment variables used so the cutover can be repeated.
How we hand over
- Deliver a runbook covering the freeze, export, import, cutover, verification and rollback steps in order.
- Walk your platform and security teams through the verification results, including any items that could not be confirmed.
- Leave backup and restore notes for the new PostgreSQL database and a checklist for the first week after go-live.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after the migration is complete.
- Post-cutover fixes and questions about the migration are handled under the agreed written scope.
- Retesting after later Open WebUI or PostgreSQL upgrades can be added to a retainer if your team wants it.

