You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: documentation for upgrading the single server container image to postgresql16 (#896)
Completes documentation for a
[PR](sourcegraph/sourcegraph#2711)
## Pull Request approval
You will need to get your PR approved by at least one member of the
Sourcegraph team. For reviews of docs formatting, styles, and component
usage, please tag the docs team via the #docs Slack channel.
Copy file name to clipboardExpand all lines: docs/admin/deploy/docker-single-container/index.mdx
+45-10Lines changed: 45 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -138,10 +138,34 @@ SELECT * FROM users;
138
138
139
139
## Upgrade
140
140
141
+
### Postgresql 16
141
142
> Warning: The 5.11 release updates the database container images from Postgres 12 to Postgres 16. Customers are advised to have a database backup before upgrading! See our [postgres 12 end of life](https://sourcegraph.com/docs/admin/postgres12_end_of_life_notice#postgres-12-end-of-life) notice!
143
+
144
+
From sourcegraph version 5.11 onwards, the Sourcegraph single container Docker image uses Postgresql 16. Upgrading from Postgresql 12 to Postgresql 16 is a manual process, that is similar to the one outlined below for multi-version upgrades, but migrator has been merged into the container, allowing for a simpler upgrade.
145
+
146
+
> NOTE: It is highly recommended to **take an up-to-date snapshot of your databases** prior to starting a multi-version upgrade. The upgrade process aggressively mutates the shape and contents of your database, and undiscovered errors in the migration process or unexpected environmental differences may cause an unusable instance or data loss.
142
147
>
143
-
> Single-container *does not* support auto migration to postgres 16. If you are planning to upgrade to 5.11.0 and beyond on single-container, you will need to dump the postgres databases and restore them after the upgrade.
144
-
> In this event, we highly recommend you migrate to a production supported deployment method, or switch to our cloud offering.
148
+
> We recommend performing the entire upgrade procedure on an idle clone of the production instance and switch traffic over on success, if possible. This may be low-effort for installations with a canary environment or a blue/green deployment strategy.
149
+
>
150
+
> **If you do not feel confident running this process solo**, contact customer support team to help guide you thorough the process.
151
+
152
+
**Before performing a multi-version upgrade**:
153
+
154
+
- Read our [update policy](/admin/updates/#update-policy) to learn about Sourcegraph updates.
155
+
- Find the entries that apply to the version range you're passing through in the [update notes for Sourcegraph with Docker Single Container](/admin/updates/server#multi-version-upgrade-procedure).
156
+
157
+
0. You must first shutdown the container instance via `docker stop [CONTAINER]`.
158
+
1. Start a temporary Postgres container on top of the Postgres data directory used by the old `sourcegraph/server` image. You must use the *new* postgresql-16-codeinsights image, which is based on the new Postgresql 16 image, and provides an automatic upgrade script to move from Postgresql 12 to Postgresql 16.
You now have a single server Sourcegraph container image running on Postgresql 16.
168
+
145
169
146
170
### Standard upgrades
147
171
@@ -156,6 +180,16 @@ To update, just use the newer `sourcegraph/server:N.N.N` Docker image (where `N.
156
180
157
181
### Multi-version upgrades
158
182
183
+
> NOTE: It is no longer necessary to run Migrator outside of the single instance container. Migrator is now built into the container, and will be run via the `sourcegraph/server` image.
184
+
>
185
+
> We **still** recommend performing the entire upgrade procedure on an idle clone of the production instance and switch traffic over on success, if possible. This may be low-effort for installations with a canary environment or a blue/green deployment strategy.
186
+
>
187
+
> The below docs are kept for posterity for users on older versions of Sourcegraph that are looking to upgrade or run the migrator tool.
188
+
189
+
To update, just use the newer `sourcegraph/server:N.N.N` Docker image in place of the older one, using the same Docker volumes. Your server's data will be migrated automatically if needed. You can always find the version number details of the latest release via the [technical changelog](/technical-changelog).
190
+
191
+
### (Legacy) Multi-version upgrades
192
+
159
193
A [multi-version upgrade](/admin/updates/#multi-version-upgrades) is a downtime-incurring upgrade from version 3.20 or later to any future version. Multi-version upgrades will run both schema and data migrations to ensure the data available from the instance remains available post-upgrade.
160
194
161
195
> NOTE: It is highly recommended to **take an up-to-date snapshot of your databases** prior to starting a multi-version upgrade. The upgrade process aggressively mutates the shape and contents of your database, and undiscovered errors in the migration process or unexpected environmental differences may cause an unusable instance or data loss.
@@ -218,21 +252,22 @@ For example, `${PATH}` is `~/.sourcegraph/data` in `-v ~/.sourcegraph/data:/var/
0 commit comments