docker-zulip: database files are incompatible with server

Hey together,

i tried the docker-compose script today, sadly the database container is not starting because of this error message:

2018-06-07 10:27:39.630 UTC [1] FATAL:  database files are incompatible with server
2018-06-07 10:27:39.630 UTC [1] DETAIL:  The data directory was initialized by PostgreSQL version 9.5, which is not compatible with this version 10.4 (Debian 10.4-1.pgdg90+1).

Since i cannot find a repo for the zulip-postgres image, i am posting it here.

BR H3n

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (4 by maintainers)

Commits related to this issue

Most upvoted comments

@H3npi @zingmars @parity3 You need to upgrade the files by doing some manual steps.

This assumes that your postgres data is saved at /opt/docker/zulip/postgresql/data.

  1. Make backup of zulip postgres data dir.
  2. Stop all Zulip containers, except the postgres one (e.g. use docker stop and not docker-compose stop).
  3. Run:
docker run -d \
      --name postgresnew \
      -e POSTGRES_DB=zulip \
      -e POSTGRES_USER=zulip \
      -e POSTGRES_PASSWORD=zulip \
      -v /opt/docker/zulip/postgresql/new:/var/lib/postgresql/data:rw \
      zulip/zulip-postgresql:latest
  1. Run:
docker exec \
    ZULIP_DATABASE_CONTAINER_NAME pg_dumpall -U postgres | \
    docker exec -i postgresnew psql -U postgres

That should run through successfully. 5. Run:

docker stop ZULIP_DATABASE_CONTAINER_NAME postgresnew
docker rm postgresnew
  1. Edit your docker-compose.yaml to use the zulip/zulip-postgresql:latest image.
  2. Run:
mv /opt/docker/zulip/postgresql/data /opt/docker/zulip/postgresql/old
mv /opt/docker/zulip/postgresql/new /opt/docker/zulip/postgresql/data
  1. Delete the existing pods: docker-compose rm
  2. Start it up again docker-compose up.

To note: the Postgres upgrade is https://github.com/docker-library/postgres/issues/37 not too good in general right, that is why pg_dump is used.

I just ran into this. You were right - basically, you were running the old version (changed with this commit) of the zulip containers, which used the database image from quay.io/galexrt/postgres-zulip-tsearchextras:latest to set up the database.

As I understand, the old galexrt’s images are now replaced by ones maintained by Zulip. A way to upgrade from these images to the new ones would be appreciated.