Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ PGDATA="/var/lib/postgresql/data"
OPDATA="/var/openproject/assets"
COLLABORATIVE_SERVER_URL=ws://localhost:8080/hocuspocus
COLLABORATIVE_SERVER_SECRET=secret12345
POSTGRES_VERSION=17 # Note for existing setups: make sure this is the same version you are using right now, or upgrade your database
POSTGRES_VERSION=18 # Existing installations must follow the PostgreSQL 18 migration guide before upgrading
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Release notes

## PostgreSQL 18

New databases use `pgvector/pgvector:pg18-bookworm` and enable vector. The container storage mount changes to `/var/lib/postgresql`; the host-side `PGDATA` setting keeps its meaning.

Existing databases require an explicit upgrade. To stay on PostgreSQL 17, use the [image and mount override](README.md#postgresql-18-upgrade). Setting `POSTGRES_VERSION=17` alone is insufficient.

Follow the [migration guide](https://www.openproject.org/docs/installation-and-operations/misc/migration-to-postgresql18/) before upgrading.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,23 @@ worker:
dns:
- "Your DNS IP" # OR add a public DNS resolver like 8.8.8.8
```

## PostgreSQL 18 upgrade

The database now defaults to `pgvector/pgvector:pg18-bookworm`. Fresh databases enable `vector` automatically. Existing databases require an explicit major-version upgrade; changing the image tag does not upgrade their data.

Follow the [PostgreSQL 18 migration guide](https://www.openproject.org/docs/installation-and-operations/misc/migration-to-postgresql18/) before updating.

The host-side `PGDATA` setting still selects the persistent volume or directory. The container mount is now `/var/lib/postgresql`, with the cluster stored in `18/docker` below it.

To retain an existing PostgreSQL 17 database, set `POSTGRES_VERSION=17` and add this `docker-compose.override.yml` (Compose 2.24.4 or newer):

```yaml
services:
db:
image: postgres:17
volumes: !override
- "${PGDATA:-pgdata}:/var/lib/postgresql/data"
```

This retains the previous image and storage layout. The version variable alone does not restore the old layout. See the migration guide for adding pgvector to an existing database.
11 changes: 3 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,12 @@ x-op-app: &app

services:
db:
# The default here should really be 17 but is still 13 as to not break existing setups.
# New installations using the provided .env.example will use 17 to begin with.
# The default here will change to 17 as well with the next major update (18).
#
# Refer to the docs on how to upgrade to postgres 17 before then:
# https://www.openproject.org/docs/installation-and-operations/misc/migration-to-postgresql17/
image: postgres:${POSTGRES_VERSION:-13}
image: pgvector/pgvector:pg${POSTGRES_VERSION:-18}-bookworm
<<: *restart_policy
stop_grace_period: "3s"
volumes:
- "${PGDATA:-pgdata}:/var/lib/postgresql/data"
- "${PGDATA:-pgdata}:/var/lib/postgresql"
- "./postgres/init-vector.sql:/docker-entrypoint-initdb.d/vector.sql:ro"
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-p4ssw0rd}
POSTGRES_DB: openproject
Expand Down
28 changes: 28 additions & 0 deletions postgres/init-vector.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---- copyright
-- OpenProject is an open source project management software.
-- Copyright (C) the OpenProject GmbH
--
-- This program is free software; you can redistribute it and/or
-- modify it under the terms of the GNU General Public License version 3.
--
-- OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-- Copyright (C) 2006-2013 Jean-Philippe Lang
-- Copyright (C) 2010-2013 the ChiliProject Team
--
-- This program is free software; you can redistribute it and/or
-- modify it under the terms of the GNU General Public License
-- as published by the Free Software Foundation; either version 2
-- of the License, or (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
--
-- See COPYRIGHT and LICENSE files for more details.
--++

CREATE EXTENSION IF NOT EXISTS vector;