PostgreSQL DB Upgrade #8028
-
|
Hi. I use Wiki.js in the current version in a Docker Compose project, but still with the Just replacing |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
It seems you should not just switch the docker image from postgresql 11 to 18 right away. Major version changes often need more work since the data might not line up. I think checking the wiki js docs first makes sense to see what versions are supported. From there a staged upgrade could work or dumping the data and restoring it elsewhere. |
Beta Was this translation helpful? Give feedback.
-
|
You can't change the postgres image version while pointing to the same data volume. Different postgres versions use different data formats. You need to create a database dump from your current postgres container, create a new container with the latest image using a NEW data volume, then import the dump back into that new container. This is out of scope of a Wiki.js documentation, but you can easily find tutorials on how to do that, or ask any AI to guide you, e.g.: # 1. Dump from the running PG15 container
docker exec -t pg15-container pg_dumpall -U postgres > dump.sql
# 2. Stop the old container
docker stop pg15-container
# 3. Start a new PG18 container with a NEW volume
docker run -d --name pg18-container \
-e POSTGRES_PASSWORD=yourpassword \
-v pg18data:/var/lib/postgresql/data \
-p 5432:5432 \
postgres:18
# 4. Restore
cat dump.sql | docker exec -i pg18-container psql -U postgres |
Beta Was this translation helpful? Give feedback.
You can't change the postgres image version while pointing to the same data volume. Different postgres versions use different data formats.
You need to create a database dump from your current postgres container, create a new container with the latest image using a NEW data volume, then import the dump back into that new container.
This is out of scope of a Wiki.js documentation, but you can easily find tutorials on how to do that, or ask any AI to guide you, e.g.: