Metadata-Version: 2.3
Name: open-webui-sqlite-migration
Version: 0.1.0
Summary: Migrate Open WebUI from SQLite to PostgreSQL
License: MIT
Author: Mikke Schirén
Author-email: mikke.schiren@digitalist.com
Requires-Python: >=3.11
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: psycopg2-binary (>=2.9.11)
Requires-Dist: rich (>=13.9.4)
Description-Content-Type: text/markdown

# Migrate tool for OpenWebUI SQLite

Migrate from using SQLite database in Open WebUI to use Postgres.

Inspiration from: <https://github.com/taylorwilsdon/open-webui-postgres-migration>,
one of the big differences is that the migration require no input, with environment
variables set, you just run the script, no input.

This so you can automate the process, instead of manual input.

## Configuration

Before anything else, backup you SQLite database and keep it in a safe place.

Needed environment variables:

- `SQLITE_DB_PATH` - exact path to your open webui db, like: `/app/backend/data/webui.db`.
- `MIGRATE_DATABASE_URL` - normally the same you should use for `DATABASE_URL`, like `postgresql://user:pass@postgres:5432/openwebui`

Also you need to start Open WebUI with `DATABASE_URL`, so needed tables are created. After that,
you remove that variable so you go back to use SQLite. When using SQLite, you run the migration script,
then you stop Open WebUI, and then again set `DATABASE_URL`. If everything now runs smoothly, you can remove the
SQLite database. Keep a backup of the database until you are really sure that all things are working as they
should.

## License

MIT
Copyright (c) Digitalist Open Cloud.

