Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      OpenProject ID Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

Support Installation & Updates
  1. OpenProject
  2. Forums
  3. Support Installation & Updates
  4. OpenProject 16 Docker (All-in-One) PostgreSQL Upgrade

OpenProject 16 Docker (All-in-One) PostgreSQL Upgrade

Added by Hubertus Paar about 1 month ago

Hi,

I did follow the instructions in this article https://www.openproject.org/docs/installation-and-operations/misc/migration-to-postgresql17/ but it ends always with this message "Current and new postgres version are identical. Aborting."

This message comes from the "postgres-db-upgrade" script.

I would like to upgrade from version 13.

Any help here is appreciated.


Replies (8)

RE: OpenProject 16 Docker (All-in-One) PostgreSQL Upgrade - Added by Andreas Fragner 28 days ago

Same thing here - I inspected the file which should do the upgrade: 

https://github.com/opf/openproject/blob/dev/docker/prod/postgres-db-upgrade

The line NEW_PGVERSION="13" tells me, that there is actually no upgrade possible in OpenProject 16.

What are we missing? Or is it a bug and DB Upgrade for docker all in one installation is not supported at the moment?

RE: OpenProject 16 Docker (All-in-One) PostgreSQL Upgrade - Added by Marc Walter 22 days ago

Same thing here as well, ideas are welcome:

sudo docker run --rm -it -v /var/lib/containers/openproject/pgdata:/var/openproject/pgdata -v /var/lib/containers/openproject/pgdata-next:/var/openproject/pgdata-next openproject/openproject:16 root ./docker/prod/postgres-db-upgrade
-----> Existing PostgreSQL cluster found in /var/openproject/pgdata.
-----> Setting PGVERSION=13 PGBIN=/usr/lib/postgresql/13/bin PGCONF_FILE=/etc/postgresql/13/main/postgresql.conf
Current and new postgres version are identical. Aborting.

RE: OpenProject 16 Docker (All-in-One) PostgreSQL Upgrade - Added by Katja Krüger 5 days ago

I used the  image 16.0.1 and went one step forward:

docker run --rm -it -v xxxx:/var/openproject/pgdata -v openproject-pgdata-next:/var/openproject/pgdata-next openproject/openproject:16 root ./docker/prod/postgres-db-upgrade
-----> Existing PostgreSQL cluster found in /var/openproject/pgdata.
-----> Setting PGVERSION=13 PGBIN=/usr/lib/postgresql/13/bin PGCONF_FILE=/etc/postgresql/13/main/postgresql.conf
Empty cluster found in /var/openproject/pgdata-next. Generating cluster...
chown: warning: '.' should be ':': ‘postgres.postgres’
bash: line 1: /usr/lib/postgresql/17/bin/initdb: No such file or directory

ONE hour ago a new image was released 

docker pull openproject/openproject:16.1 perhaps you try it with that one?

RE: OpenProject 16 Docker (All-in-One) PostgreSQL Upgrade - Added by Marc Walter 5 days ago

I stopped the container. Then i did the following via command line:

docker pull openproject/openproject:16.1 
sudo docker run --rm -it -v /var/lib/XXXXXX/openproject/pgdata:/var/openproject/pgdata -v /var/lib/XXXXX/openproject/pgdata-next:/var/openproject/pgdata-next openproject/openproject:16.1 root ./docker/prod/postgres-db-upgrade

The database upgraded worked, it was all "OK".

I use it with portainer and stacks. So i restarted everything with this configuration. I don't specify any SQL version.

version: '3.9'
services:
  openproject:
    hostname: XXXXX-OPEN-01
    image: openproject/openproject:16.1.0

    ports:
      - 8181:80
      
    container_name: openproject

    environment:
      - PUID=1000
      - PGID=1000
      - SECRET_KEY_BASE=XXXXXXXXXXXXXXXX
    volumes:
      - /var/lib/XXXXXXX/openproject/pgdata:/var/openproject/pgdata
      - /var/lib/XXXXXXX/openproject/assets:/var/openproject/assets
    restart: unless-stopped

The installation ist updated and works again, so far good.

But the SQL version is still the old one.

Produktversion

refs/tags/v16.1.0

Core Version

OpenProject 16.1.0

PostgreSQL-Version

13.21

RE: OpenProject 16 Docker (All-in-One) PostgreSQL Upgrade - Added by Hubertus Paar 5 days ago

Well the upgrade was succesfully but now I am getting this:

     psql: error: connection to server at "127.0.0.1", port 5432 failed: FATAL:  password authentication failed for user "openproject"
      connection to server at "127.0.0.1", port 5432 failed: FATAL:  password authentication failed for user "openproject"
-----> Existing PostgreSQL cluster found in /var/openproject/pgdata.
-----> Setting PGVERSION=17 PGBIN=/usr/lib/postgresql/17/bin PGCONF_FILE=/etc/postgresql/17/main/postgresql.conf
-----> Starting the all-in-one OpenProject setup at /app/docker/prod/supervisord...
-----> Database cluster already exists, not modifying.
      waiting for server to start..... done
      server started
      Trying to contact PostgreSQL server instance or waiting for it to come online.
      Waiting for postgres server, 10 remaining attempts...
      Waiting for postgres server, 9 remaining attempts...
      Waiting for postgres server, 8 remaining attempts...
      Waiting for postgres server, 7 remaining attempts...
      Waiting for postgres server, 6 remaining attempts...
      Waiting for postgres server, 5 remaining attempts...
      Waiting for postgres server, 4 remaining attempts...
      Waiting for postgres server, 3 remaining attempts...
      Waiting for postgres server, 2 remaining attempts...
      Waiting for postgres server, 1 remaining attempts...
      Unable to contact postgres server:
      psql: error: connection to server at "127.0.0.1", port 5432 failed: FATAL:  password authentication failed for user "openproject"
      connection to server at "127.0.0.1", port 5432 failed: FATAL:  password authentication failed for user "openproject"

** Press ANY KEY to close this window **

My Proects became not accessable.

Can anyone help me here? Thank you.

refs/tags/v16.1.0

Core Version

OpenProject 16.1.0

PostgreSQL-Version

17



RE: OpenProject 16 Docker (All-in-One) PostgreSQL Upgrade - Added by Marc Walter 4 days ago

Hubertus

Interesting you have the new PostgreSQL version. Can you give us more details about your compose, does ist look like mine?

RE: OpenProject 16 Docker (All-in-One) PostgreSQL Upgrade - Added by Hubertus Paar 1 day ago

Hi,

i first upgraded the all-in-one container to 16.1, then I followed the original instructions https://www.openproject.org/docs/installation-and-operations/misc/migration-to-postgresql17/

"sudo docker run --rm -it -v /var/lib/containers/openproject/pgdata:/var/openproject/pgdata -v /var/lib/containers/openproject/pgdata-next:/var/openproject/pgdata-next openproject/openproject:16 root ./docker/prod/postgres-db-upgrade"

and changed to the pgdata-next directory


But now I have the above problem. I even tried to switch back to postgressql 13 by downgranding to openproject 16.0 and change pgdata directory to original location, but here it just stops working.

I hope I could explain it clearly.

Any help is appreciated.

Thank you.

PS: I filled in a bug report

RE: OpenProject 16 Docker (All-in-One) PostgreSQL Upgrade - Added by Frank Wintergreen about 9 hours ago

Experiencing the same issue - successfully upgraded postgres once I went to Openproject v16.1, then renamed my host postgres-next folder to postgres and relaunched, same 'password authentication failed for user "openproject"' error. It's not port 5433 vs 5432 by any chance?

-----> Existing PostgreSQL cluster found in /var/openproject/pgdata.
-----> Setting PGVERSION=17 PGBIN=/usr/lib/postgresql/17/bin PGCONF_FILE=/etc/postgresql/17/main/postgresql.conf
-----> Starting the all-in-one OpenProject setup at /app/docker/prod/supervisord...
No cluster configuration found for postgres 17. Creating configuration.
Creating new PostgreSQL cluster 17/main ...
/usr/lib/postgresql/17/bin/initdb -D /var/lib/postgresql/17/main --auth-local peer --auth-host scram-sha-256 --no-instructions
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

...

Ver Cluster Port Status Owner    Data directory              Log file
17  main    5433 down   postgres /var/lib/postgresql/17/main /var/log/postgresql/postgresql-17-main.log
-----> Database cluster already exists, not modifying.

...

       Unable to contact postgres server:
       psql: error: connection to server at "127.0.0.1", port 5432 failed: FATAL:  password authentication failed for user "openproject"
       connection to server at "127.0.0.1", port 5432 failed: FATAL:  password authentication failed for user "openproject"
  • (1 - 8/8)
Loading...