Skip to content

Upgrade PostgreSQL to v18 with updated volume mount path#105

Open
snickerjp wants to merge 4 commits into
getredash:masterfrom
snickerjp:issue-86-pg18-upgrade
Open

Upgrade PostgreSQL to v18 with updated volume mount path#105
snickerjp wants to merge 4 commits into
getredash:masterfrom
snickerjp:issue-86-pg18-upgrade

Conversation

@snickerjp

@snickerjp snickerjp commented Jul 1, 2026

Copy link
Copy Markdown
Member

Summary

Upgrades the PostgreSQL image from v17 to v18, addressing the data directory path change introduced by the official Docker PostgreSQL image (docker-library/postgres#1259).

Changes

compose.yaml

  • Image: pgautoupgrade/pgautoupgrade:17-alpinepgautoupgrade/pgautoupgrade:18-alpine
  • Volume: /opt/redash/postgres-data:/var/lib/postgresql/data/opt/redash/postgres-data:/var/lib/postgresql
  • Added migration hints in comments for existing users

README.md

  • Added FAQ: "How do I backup my PostgreSQL database?"
  • Added FAQ: "How do I upgrade PostgreSQL to a newer major version?"

Why pgautoupgrade instead of the official postgres image?

The Redash development repo (getredash/redash) uses postgres:18-alpine for development, where data is disposable. This setup repo targets production environments where data must be preserved across version upgrades, so we kept pgautoupgrade.

Background

Testing

  • Tested full new installation with setup.sh
  • Redash v26.3.0 + PostgreSQL 18.4 started successfully
  • Web UI accessible, initial setup and login confirmed

For existing users

Existing users upgrading from PG17 need to:

  1. Backup their data
  2. Stop containers
  3. Update the volume mount path in their compose.yaml
  4. Restart (pgautoupgrade handles the data migration)

Details: https://github.com/pgautoupgrade/docker-pgautoupgrade#error-message-when-mounting-data-to-varlibpostgresqldata-on-postgres-v18

Fixes #86

Review in cubic

snickerjp added 2 commits July 1, 2026 22:02
- Change image from pgautoupgrade/pgautoupgrade:17-alpine to 18-alpine
- Update volume mount from /var/lib/postgresql/data to /var/lib/postgresql
  (required by PostgreSQL 18's new data directory structure)
- Add comment with migration hints for existing users

Fixes getredash#86
- Add 'How do I backup my PostgreSQL database?' with pg_dumpall command
- Add 'How do I upgrade PostgreSQL to a newer major version?' with link
  to pgautoupgrade documentation
Copilot AI review requested due to automatic review settings July 1, 2026 13:03

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the production Docker Compose setup to PostgreSQL 18 via pgautoupgrade, adjusting the persistent volume mount to accommodate the upstream PostgreSQL 18 image data-directory layout changes, and adds operator guidance for backup/upgrade workflows.

Changes:

  • Bump PostgreSQL container image from pgautoupgrade:17-alpine to pgautoupgrade:18-alpine.
  • Update the PostgreSQL volume mount from /var/lib/postgresql/data to /var/lib/postgresql and add migration guidance comments.
  • Add README FAQ entries for backing up PostgreSQL and upgrading from PG17→PG18.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
README.md Adds FAQ guidance for database backups and major-version upgrade steps.
data/compose.yaml Switches to PG18 pgautoupgrade image and updates the data volume mount path with migration notes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread data/compose.yaml Outdated
Comment thread README.md Outdated
snickerjp and others added 2 commits July 1, 2026 22:20
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

postgresql 18 is asking for a different directory

2 participants