Migrating PostgreSQL 11 to 16 (Linux w/ Docker)
PostgreSQL 16 is supported starting with Informer 5.8.6 and required as of Informer 5.9. When upgrading from a version before 5.8.6 that is not yet on PostgreSQL 16, the upgrade installer handles the bulk of this migration. For help, contact Support at i5support@entrinsik.com or schedule time via the Informer install Calendly.
Informer requires a specific Postgres 16 image with the vector extension, and Postgres 16 needs a new environment variable for its auth method. Both appear in the docker-compose.yml example below.
What happens during the migration
- Back up the PostgreSQL 11 databases.
- Delete the PostgreSQL 11 container.
- Deploy the PostgreSQL 16 container.
- Restore the databases into the PostgreSQL 16 container.
- Start Informer and apply the final migrations.
Back up the PostgreSQL 11 databases
-
Create a backup of the PostgreSQL 11 database using the commands in Backups and restores (Linux w/ Docker), and make sure the backup file is copied to the host machine.
-
Rename the existing pgdata folder and create a new, empty one for PostgreSQL 16:
mv ./pgdata ./pgdata11mkdir ./pgdata
Delete the PostgreSQL 11 container
With the database backed up, remove the PostgreSQL 11 container:
docker-compose rm postgres
Deploy the PostgreSQL 16 container
Edit docker-compose.yml and change the postgres service to use the PostgreSQL 16 image. The result should look like:
postgres:
image: pgvector/pgvector:pg16
environment:
- POSTGRES_USER=i5
- TZ=US/Pacific
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- ./pgdata:/var/lib/postgresql/data
Restore the databases into PostgreSQL 16
-
Pull the updated PostgreSQL 16 image:
docker-compose pull -
Start the new PostgreSQL container:
docker-compose up -d postgres -
Copy the backup into the container and restore it:
docker cp ./backup_all.sql <postgresql_container_name>:./backup_all.sqldocker-compose exec postgres psql -U i5 -f backup_all.sql
Start Informer and apply final migrations
With PostgreSQL 16 running and holding the data, continue the rest of the 5.8.6 upgrade. When it finishes, Informer restarts and applies a few automatic migration steps, which can take a few minutes. Monitoring the Docker logs shows you when the migrations finish.