Help Needed: Upgrading postgres version from postgres:14-alpine to postgres:16-alpine #608

Open
opened 2026-02-04 20:33:05 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @jaimedmp on GitHub (Nov 19, 2024).

Is this a feature for the backend or frontend?

Backend

What would you like?

Hi, I need some help or suggestions.

Current Planka version: 1.24.1

In the Planka GitHub repository, the docker-compose.yml file specifies the image for PostgreSQL as:

image: postgres:16-alpine

However, on my premises, it's currently set to:

image: postgres:14-alpine

I would like to update my docker-compose.yml file to use postgres:16-alpine.

  • Should I proceed with this update?
  • Will Docker Compose handle the upgrade without any issues, or do I need to prepare or adjust anything beforehand?

Thank you for your guidance!

Why is this needed?

N/A

Other information

N/A

Originally created by @jaimedmp on GitHub (Nov 19, 2024). ### Is this a feature for the backend or frontend? Backend ### What would you like? Hi, I need some help or suggestions. **Current Planka version:** 1.24.1 In the [Planka GitHub repository](https://github.com/plankanban/planka), the `docker-compose.yml` file specifies the `image` for PostgreSQL as: ```yaml image: postgres:16-alpine ``` However, on my premises, it's currently set to: ```yaml image: postgres:14-alpine ``` I would like to update my `docker-compose.yml` file to use `postgres:16-alpine`. - Should I proceed with this update? - Will Docker Compose handle the upgrade without any issues, or do I need to prepare or adjust anything beforehand? Thank you for your guidance! ### Why is this needed? N/A ### Other information N/A
Author
Owner

@meltyshev commented on GitHub (Nov 19, 2024):

Hi! We'll add this to the docs soon.

@meltyshev commented on GitHub (Nov 19, 2024): Hi! We'll add this to the docs soon.
Author
Owner

@jaimedmp commented on GitHub (Nov 20, 2024):

Thank you for your response.

@jaimedmp commented on GitHub (Nov 20, 2024): Thank you for your response.
Author
Owner

@nbx3 commented on GitHub (Feb 14, 2025):

So these are the steps i followed that worked successfully -

  1. Backup your database (x2 to be safe)
docker compose exec postgres pg_dump -U postgres -d planka -cC > upgrade_backup_pg14.sql
  1. Shutdown database, create a backup volume and do a volume backup (you may have to adjust names)
docker compose down
docker volume create planka_database_backup
docker run --rm -v docker-planka_db-data:/from -v planka_database_backup:/to alpine sh -c 'cd /from && cp -a . /to'
  1. Make sure step 2 is done and you have the sql and data volumes, then remove the old volume (why docker dont add a docker rename volume option..?)
docker volume rm docker-planka_db-data
  1. Edit the docker-compose.yml and network_mode: none to the postgres config and change image: postgres:14-alpine to image: postgres:16-alpine

  2. Pull the updated image, force recreate postgres database and apply your backup

docker compose pull
docker compose up --force-recreate -d postgres
cat upgrade_backup_pg14.sql | docker compose exec -T postgres psql -U postgres
  1. Edit docker-compose.yml and remove the network_mode: none, then rerun the recreate
docker compose up --force-recreate -d

Test!

PS thanks for an awesome open source project

@nbx3 commented on GitHub (Feb 14, 2025): So these are the steps i followed that worked successfully - 1. Backup your database (x2 to be safe) ``` docker compose exec postgres pg_dump -U postgres -d planka -cC > upgrade_backup_pg14.sql ``` 2. Shutdown database, create a backup volume and do a volume backup (you may have to adjust names) ``` docker compose down docker volume create planka_database_backup docker run --rm -v docker-planka_db-data:/from -v planka_database_backup:/to alpine sh -c 'cd /from && cp -a . /to' ``` 3. Make sure step 2 is done and you have the sql and data volumes, then remove the old volume (why docker dont add a docker rename volume option..?) ``` docker volume rm docker-planka_db-data ``` 4. Edit the `docker-compose.yml` and `network_mode: none` to the postgres config and change `image: postgres:14-alpine` to `image: postgres:16-alpine` 5. Pull the updated image, force recreate postgres database and apply your backup ``` docker compose pull docker compose up --force-recreate -d postgres cat upgrade_backup_pg14.sql | docker compose exec -T postgres psql -U postgres ``` 6. Edit `docker-compose.yml` and remove the `network_mode: none`, then rerun the recreate ``` docker compose up --force-recreate -d ``` Test! PS thanks for an awesome open source project
Author
Owner

@jaimedmp commented on GitHub (Mar 3, 2025):

Hi,

I am having an error when I try to run docker compose up --force-recreate -d postgres. I made sure that I follow the previous steps.

postgres-1 |
postgres-1 | PostgreSQL Database directory appears to contain a database; Skipping initialization
postgres-1 |
postgres-1 | 2025-03-02 23:57:08.965 UTC [1] FATAL: database files are incompatible with server
postgres-1 | 2025-03-02 23:57:08.965 UTC [1] DETAIL: The data directory was initialized by PostgreSQL version 14, which is not compatible with this version 16.8.
postgres-1 exited with code 1

@jaimedmp commented on GitHub (Mar 3, 2025): Hi, I am having an error when I try to run `docker compose up --force-recreate -d postgres`. I made sure that I follow the previous steps. postgres-1 | postgres-1 | PostgreSQL Database directory appears to contain a database; Skipping initialization postgres-1 | postgres-1 | 2025-03-02 23:57:08.965 UTC [1] FATAL: database files are incompatible with server postgres-1 | 2025-03-02 23:57:08.965 UTC [1] DETAIL: The data directory was initialized by PostgreSQL version 14, which is not compatible with this version 16.8. postgres-1 exited with code 1
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#608