Top Menu

Jump to content
    Global modules

    Global modules

    • Home
    • Projects
    • Activity
    • Work packages
    • Gantt charts
    • Calendars
    • Team planners
    • Boards
    • News
    Home
    Home
Help
    Getting started
    • Introduction video
  • 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

User menu

Sign in
Forgot your password?

or sign in with your existing account

OpenProject ID Google

Side Menu

Collapse project menu

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

Content

Expand project menu
Support Installation & Updates
  1. OpenProject Community
  2. OpenProject
  3. Forums
  4. Support Installation & Updates
  5. Migration OP 11 with PG 9.6 to OP 12 with PG 13 failed

Migration OP 11 with PG 9.6 to OP 12 with PG 13 failed

Added by Frank Hintsch almost 3 years ago

I have a working docker installation of OP11 using this compose file:

  openproject:
    image: openproject/community:11
    restart: always
    environment:
      SECRET_KEY_BASE: secret
      DATABASE_URL: postgres://openproject:****@dbpg/openproject
    ports:
      - "9040:80"
    volumes:
      - "./openproject/logs:/var/log/supervisor"
      - "./openproject/static:/var/openproject/assets"

  dbpg:
    image: postgres:9.6-alpine
    restart: always
    volumes:
      - "./dbpg/pgdata:/var/lib/postgresql/data"
    ports:
      - "9011:5432"

I try to migrate to OP 12, following https://www.openproject.org/docs/installation-and-operations/misc/migration-to-postgresql13/#all-in-one-docker-installation. It does not work.

Steps I have done:

docker run --rm -it \
 -v /home/frankhintsch/docker/v11/dbpg/pgdata:/var/openproject/pgdata \
 -v /home/frankhintsch/docker/v11/openproject/pgdata-next:/var/openproject/pgdata-next \
 openproject/community:12 root ./docker/prod/postgres-db-upgrade

This was successful.

But when I started the DB-content (without pointer to external database container)

  openproject:
    image: openproject/community:12
      #    restart: always
    environment:
      SECRET_KEY_BASE: secret
      OPENPROJECT_HTTPS: "false"
      OPENPROJECT_HSTS: "false"
    ports:
      - "9042:8080"
    volumes:
      - "./openproject/pgdata-next:/var/openproject/pgdata"

I faced several pitfalls.

  1. psql: error: connection to server at "127.0.0.1", port 5432 failed: FATAL:  role "openproject" does not exist:
    I created User + Role "openproject" with psql
  2. psql: error: connection to server at "127.0.0.1", port 5432 failed: FATAL:  database "openproject" does not exist
    I looked at the list of databases and it looks like nothing has been migrated
postgres=# \l
                             List of databases
   Name    |  Owner   | Encoding | Collate |  Ctype  |   Access privileges   
-----------+----------+----------+---------+---------+-----------------------
 postgres  | postgres | UTF8     | C.UTF-8 | C.UTF-8 | 
 template0 | postgres | UTF8     | C.UTF-8 | C.UTF-8 | =c/postgres          +
           |          |          |         |         | postgres=CTc/postgres
 template1 | postgres | UTF8     | C.UTF-8 | C.UTF-8 | =c/postgres          +
           |          |          |         |         | postgres=CTc/postgres

Can anyone help me?

Thanks in advance

Frank


Loading...