Migrating PostgreSQL 16 to 18
On March 2, 2026, Ideon officially updated its supported PostgreSQL version from 16 to 18. While existing deployments running on version 16 will continue to function, we recommend upgrading to benefit from the latest performance improvements and features.
This guide outlines how to perform this major version upgrade using Docker.
Prerequisites
- Backup: Always backup your data before performing a database upgrade.
- Downtime: The application will need to be stopped during the migration.
Step 1: Backup Your Data
Before doing anything, create a full dump of your current database.
# 1. Stop the application container to ensure data consistency
docker stop ideon-app
# 2. Dump the database from the running postgres container
docker exec -t ideon-db pg_dumpall -c -U ideon > dump_v16.sql
Verify that dump_v16.sql has been created and contains data.
Step 2: Stop and Remove Containers
Stop the database container and remove the old volumes.
⚠️ WARNING: The following command deletes your database volume. Ensure your backup (Step 1) is valid.
# Stop the database
docker stop ideon-db
# Remove the containers
docker rm ideon-app ideon-db
# Remove the old volume (Postgres 16 data files are incompatible with 18)
docker volume rm ideon_ideon-db-data
Note: If your volume name is different (e.g., defined in docker-compose.yml), adjust the command accordingly.
Step 3: Update Docker Compose
Update your docker-compose.yml file to use the PostgreSQL 18 image.
services:
ideon-db:
image: postgres:18-alpine
# ... rest of configuration
Step 4: Start the New Database
Start only the database container first to initialize a fresh, empty PostgreSQL 18 instance.
docker compose up -d ideon-db
Wait a few seconds for the database to initialize. You can check the logs:
docker compose logs -f ideon-db
Step 5: Restore Data
Import your backup into the new database.
# Restore the dump
cat dump_v16.sql | docker exec -i ideon-db psql -U ideon
Step 6: Restart Application
Now that the database is upgraded and populated, start the application.
docker compose up -d ideon-app
Ideon will now connect to the PostgreSQL 18 database. All your data, users, and projects should be preserved.