How we upgraded PostgreSQL at GitLab.com
Sep 11, 2020Jose Finotto

Summary
This post details the successful major version upgrade of GitLab.com's main PostgreSQL cluster from version 9.6 to 11 using pg_upgrade. It outlines the planning, testing, and automation involved, including the use of blueprints and design documents. Key aspects covered are the reasons for the upgrade (EOL of 9.6, new features in 11), the existing architecture (Patroni, Consul, GCS), upgrade requirements (no regressions, automated process, short maintenance window), the phased project execution (isolated environment, staging tests, production upgrade), and the rollback plan. It also explains how pg_upgrade works and the considerations for external modules.
More from the Database Migration Debugging and Cross-Database Compatibility trail
- Seamlessly migrate from Jira to GitLab with Jira2Lab at scale
- We are upgrading the operating system on our Postgres database clusters
- Decomposing the GitLab backend database, Part 1: Designing and planning
- GitLab database decomposition: Final migration and results
- Decomposing the GitLab backend database, Part 3: Challenges and surprises