Przejdź do głównej zawartości

Postgres Migration Guide

notatka

This guide is for docker installation only and it explains how to migrate an existing 4ga Boards Docker Compose PostgreSQL installation.

Create database backup

Create a full PostgreSQL backup:

docker compose exec -T db bash -c 'PGPASSWORD=$POSTGRES_PASSWORD pg_dumpall -U postgres' > backup.sql

Verify that the backup file was created:

head -50 backup.sql

Stop 4ga Boards

Stop all containers:

docker compose down

Edit docker-compose.yml

Rename db volume (to keep additional backup) e.g. db-data to db-data-18 and change the mount path from /var/lib/postgresql/data to /var/lib/postgresql:

volumes:
- db-data-18:/var/lib/postgresql

and

volumes:
db-data-18:

Update postgres version from postgres:16-alpine to postgres:18-alpine:

db:
image: postgres:18-alpine

Start the new PostgreSQL container

Start only the database service:

docker compose up -d db

Restore database backup

Import the previous database:

docker compose exec -T db bash -c 'PGPASSWORD=$POSTGRES_PASSWORD psql -U postgres' < backup.sql

Start 4ga Boards

Restart all services:

docker compose down
docker compose up -d
wskazówka

Verify that all users, boards, cards, attachments, and other data are available before removing the old PostgreSQL volume backup.