Overview
The self-hosted Mem0 server has upgraded its PostgreSQL Docker image:| Before | After | |
|---|---|---|
| Docker image | ankane/pgvector:v0.5.1 | pgvector/pgvector:pg17 |
| PostgreSQL | 15 | 17 |
| pgvector | 0.5.1 | 0.8.0 |
| Credentials | Hardcoded postgres / postgres | Set via POSTGRES_USER / POSTGRES_PASSWORD env vars |
Should you migrate?
- You are running the Mem0 server via
docker-compose.yamlin theserver/directory. - You want to stay on a maintained, actively-patched PostgreSQL + pgvector image.
- You want pgvector 0.8.0 features (improved HNSW performance, parallel index builds).
Fresh Installs
No migration is needed. Copy the example env file, set your password, and start the stack:Migrating an Existing Install
PostgreSQL 17 cannot read data files created by PostgreSQL 15 directly. You need to export your data from the old container and import it into the new one.1. Back Up Your Data
With the old stack still running:2. Stop the Old Stack and Remove the Volume
3. Update Your .env
Postgres credentials are no longer hardcoded in docker-compose.yaml. Add them to your .env:
POSTGRES_PASSWORD is required — docker compose up will refuse to start without it. If you previously relied on the hardcoded default, set POSTGRES_PASSWORD=postgres.4. Start Only Postgres
Start only the Postgres container first — do not start the mem0 API yet. The API runsalembic upgrade head on startup, which creates empty tables that
would conflict with the restore.
5. Restore Your Data
role "postgres" already exists — these are safe to ignore.
6. Start the API
Now start the mem0 API container. Alembic will detect the existing tables and only apply any new migrations:7. Verify
Rollback
If something goes wrong, revert the image tag indocker-compose.yaml:
Need Help?
- Join our Discord community for real-time support
- Open an issue on GitHub