Skip to content

Commit cb19b6a

Browse files
committed
clarify helm instructions for MVU and postgres version upgrade
1 parent b68098f commit cb19b6a

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

docs/admin/deploy/kubernetes/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ When all pods have restarted and show as Running, you can browse to your Sourceg
938938
- Check the `Site Admin > Updates` page to determine [upgrade readiness](/admin/updates/#upgrade-readiness).
939939

940940
**Step 2:**
941-
> <Callout type="warning">The Kubernetes Helm deployment type does not support MVU from Sourcegraph `v5.9.45` versions and earlier to Sourcegraph `v6.0.0`. Admins seeking to upgrade to Sourcegraph `v6.0.0` should upgrade to `v5.10.3940` or `v5.11.6271` and then use the standard upgrade procedure to get to `v6.0.0`. This is because migrator v6.0.0 will no longer connect to Postgres 12 databases. For more info see our [PostgreSQL upgrade docs](/admin/postgres#requirements).</Callout>
941+
> <Callout type="warning">The Kubernetes Helm deployment type does not support MVU from Sourcegraph `v5.9.45` versions and earlier to ANY version `v6.0.x` or later. Admins seeking to upgrade to any Sourcegraph version `v6.0.x` or later (including `v6.1.x`, `v6.2.x`, etc.) must first upgrade to `v5.10.3940` or `v5.11.6271` and then use the standard upgrade procedure to get to their target version. This is because migrator in all versions from `v6.0.0` onwards will no longer connect to Postgres 12 databases. For more info see our [PostgreSQL upgrade docs](/admin/postgres#requirements).</Callout>
942942

943943
Scale down `deployments` and `statefulSets` that access the database, _this step prevents services from accessing the database while schema migrations are in process._
944944
The following services must have their replicas scaled to 0:

docs/admin/how-to/upgrade-postgres-12-16-builtin-dbs.mdx

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,26 @@ $ kubectl apply -f deploy-sourcegraph-k8s/base/sourcegraph/pgsql/pgsql.StatefulS
8282

8383
## Helm
8484

85-
To upgrade builtin containers in Helm admins must update their instance to v5.11.6271 via the [helm multi-version upgrade procedure](/admin/deploy/kubernetes#multi-version-upgrade-procedure) or standard upgrade procedure. This is because `helm upgrade` doesn't support just the DBs in a chart.
85+
Unlike other deployment methods, Helm charts function as a complete unit and don't allow upgrading only the database components independently. Therefore, the PostgreSQL upgrade must be performed as part of a full Sourcegraph version upgrade.
8686

87-
<Callout type="warning"> In Sourcegraph version 6.0.0 Sourcegraph services will no longer be able to connect to a Postgres 12 database. This means at and after Sourcegraph 6.0.0, migrator will not be connect to older versions to execute the `upgrade` command. </Callout>
87+
### Required Upgrade Path
88+
89+
<Callout type="warning">Sourcegraph versions `v6.0.x` and later require PostgreSQL 16 and will not connect to PostgreSQL 12 databases. This means any direct upgrade from versions earlier than `v5.10.3940` to any version `v6.0.x` or later will fail because the migrator in `v6.0.x` and later cannot connect to PostgreSQL 12 to perform the upgrade.</Callout>
90+
91+
To safely upgrade PostgreSQL in Helm deployments:
92+
93+
1. **First upgrade to an intermediate version**:
94+
- Upgrade to either Sourcegraph `v5.10.3940` or `v5.11.6271` using the [helm multi-version upgrade procedure](/admin/deploy/kubernetes#multi-version-upgrade-procedure) or [standard upgrade procedure](/admin/deploy/kubernetes#standard-upgrades)
95+
- These specific versions include the necessary PostgreSQL upgrade scripts to safely migrate from PG12 to PG16
96+
97+
2. **Verify the PostgreSQL upgrade** (optional):
98+
- You can verify the PostgreSQL version has been successfully upgraded by connecting to the database:
99+
```bash
100+
kubectl exec -it pgsql -- psql -U sg -c "SELECT version();"
101+
```
102+
- The output should show PostgreSQL 16.x
103+
104+
3. **Proceed to target version**:
105+
- Once PostgreSQL has been upgraded to version 16, you can safely upgrade to your target version (`v6.0.x` or later) using the standard upgrade procedure
106+
107+
For any issues during the PostgreSQL upgrade process, please contact [email protected].

0 commit comments

Comments
 (0)