DATABASE_URL environment variable.
start.sh and the Docker entrypoint run the Alembic migrations on every start, so tables are created automatically — no manual migration step is required.
SQLite vs PostgreSQL
Known Limitation: SQLite Concurrent Streaming
Connection Pool Configuration
FIM One configures SQLAlchemy connection pool settings internally for each backend. These are tuned defaults that do not require environment variables (the SQLite pool can be resized withSQLITE_POOL_SIZE / SQLITE_MAX_OVERFLOW) — they are applied automatically based on the DATABASE_URL scheme. Understanding them helps explain runtime behavior.
SQLite Pool Settings
WAL mode and the 30-second busy timeout are set via SQLite PRAGMAs on every new connection. This combination ensures that short-lived reads (loading a conversation list, fetching settings) are not blocked by long-running write transactions, and that concurrent writes queue gracefully instead of failing.
PostgreSQL 풀 설정
PostgreSQL은 MVCC를 통해 동시성을 기본적으로 처리하므로 풀 설정은 주로 리소스 사용을 제어하며 경합을 제어하지는 않습니다. 30분 재활용 간격은 방화벽, 로드 밸런서 또는 유휴 TCP 연결을 자동으로 종료하는 관리형 데이터베이스 서비스의 문제를 방지합니다.
PostgreSQL로 전환하기
1단계: PostgreSQL 인스턴스 시작
가장 빠른 방법은 Docker를 사용하는 것입니다:단계 2: DATABASE_URL 설정
.env 파일에서 다음 줄을 추가하거나 업데이트하세요:
단계 3: FIM One 재시작
기존 SQLite 데이터는 자동으로 마이그레이션되지 않습니다.
DATABASE_URL을 SQLite에서 PostgreSQL로 전환하면 새로운 데이터베이스로 시작됩니다. SQLite에 기존 대화, 에이전트 또는 커넥터가 있고 이를 보존해야 하는 경우 아래의 데이터 마이그레이션 섹션을 참조하세요.Docker Compose (Recommended for Production)
If you deploy with Docker Compose, PostgreSQL and Redis are already included and auto-configured — there is nothing extra to set up. Thedocker-compose.yml sets DATABASE_URL internally — your .env value is overridden:
데이터 마이그레이션
SQLite에서 PostgreSQL로의 기본 제공 마이그레이션 도구는 없습니다. 대부분의 배포에서 권장되는 접근 방식은 상황에 따라 다릅니다: 새로운 배포 (기존 데이터 없음):DATABASE_URL을 PostgreSQL 연결 문자열로 설정하고 FIM One을 시작하기만 하면 됩니다. 모든 테이블이 자동으로 생성됩니다.
보존해야 할 기존 데이터: 수동 내보내기/가져오기가 필요합니다. 일반적인 접근 방식:
sqlite3CLI 또는 Python 스크립트와 같은 도구를 사용하여 SQLite에서 데이터 내보내기- 필요에 따라 데이터 변환 (SQLite와 PostgreSQL은 약간의 타입 차이가 있음)
psql,pg_restore또는 애플리케이션 수준의 삽입 스크립트를 사용하여 PostgreSQL로 가져오기