Ops: upgrade PostgreSQL 16 → 18

Open
#300 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
Over a week
Newbie friendliness
22/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Quiet
Tech stack
django, docker, postgresql
Domain
databases, devops

Research direction

Start with the image tags in docker-compose.yaml and docker-compose.test.yaml, which pin postgres:17-alpine, and the Portainer stack in deployment/portainer/docker-compose.portainer.yaml. Confirm the production version and extensions on the host, then rehearse the 16-to-18 upgrade on a staging copy and run manage.py migrate plus the test suite. Done means production reports PostgreSQL 18.x and the API, Celery and Channels paths work; this needs production access, so it is not a good first task.

Written by the indexing model from the issue text.

Description

enhancement

Goal

Upgrade production (and align dev) PostgreSQL from 16 to 18 with minimal downtime and a verified rollback path.

Context

Suggested approach

  1. Prerequisite: automated backups in place (see separate backup ticket) + fresh manual dump before upgrade.
  2. Staging: upgrade staging clone 16→18; run full test suite + smoke (migrate, ingest, admin).
  3. Production: pg_upgrade or dump/restore — pick based on data size and downtime budget.
  4. Update image tags / Portainer env / any CI test DB image to postgres:18-alpine (or pinned minor).
  5. Post-upgrade: VACUUM / analyze, verify extensions, connection pooling (if any).

Scope

  • Inventory PG version, extensions, and data directory layout on prod host
  • Document upgrade runbook (steps, estimated downtime, rollback = restore from backup)
  • Execute on staging; record issues
  • Production maintenance window + upgrade
  • Bump dev/test compose images to 18 for parity
  • Update deployment docs

Risks

  • Major version jump (16→18): use PostgreSQL upgrade docs; test pg_upgrade on copy first.
  • Meshflow migration history: run manage.py migrate after upgrade on staging.

Acceptance

  • Production SELECT version(); reports PostgreSQL 18.x
  • Meshflow API, Celery workers, and Channels/WebSocket paths operate normally post-upgrade
  • Dev compose references Postgres 18 (or documents intentional lag)
Dominant language
Python
Stars
1
Forks
0
Avg merge
1d 20h
Merged PRs (30d)
5

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pskillen/meshflow-api

All issues in pskillen/meshflow-api

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.