Skip to content

docker-compose: Add codeinsights-db to db-only-migrate - #1485

Merged
marcleblanc2 merged 1 commit into
mainfrom
marc/db-only-migrate-three-databases
Nov 13, 2026
Merged

marcleblanc2 merged 1 commit into
mainfrom
marc/db-only-migrate-three-databases

Conversation

@marcleblanc2

@marcleblanc2 marcleblanc2 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Context

db-only-migrate.docker-compose.yaml starts only the databases, for backups, restores, and upgrades

Problems

  • It was never updated to include codeinsights-db since it was newly added

  • It had duplicate content, and wasn't kept up to date withdocker-compose.yaml

Solutions

  • All three databases now use extends, which copies each service's definition from docker-compose.yaml

  • sourcegraph/docs#2156 fixes the restore commands on that docs page, and needs this PR

Checklist

  • All images have a valid tag and SHA256 sum (no image changes)

Test plan

On a test machine (Docker 29.9.3, Compose 5.7.1): a full 8.2.0 deployment, down, then this file alone on the same volumes.

main This PR
Containers started pgsql, codeintel-db pgsql, codeintel-db, codeinsights-db, nothing else
The three pg_dump commands from the docs The third fails: No such container: codeinsights-db All three exit 0
docker compose -f docker-compose.yaml run --rm --no-deps migrator Fails: lookup codeinsights-db ... no such host Schema(s) are up-to-date!
  • Followed the docs' backup and both restore procedures, with docs#2156 at e40ca3ee: every command exited 0, re-dumps were byte-identical to the backups, and the code insights data came back
  • docker-compose config --hash is identical from either file, so the final docker-compose up -d recreated none of the three databases. On main, it recreated pgsql and codeintel-db
  • config --services lists only the three databases on Compose 2.18.1 and 5.7.1
  • CI: build 16917 passed

Closes FE-580

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

@marcleblanc2
marcleblanc2 added this pull request to stack #1491 November 11, 2026 10:45
@marcleblanc2
marcleblanc2 force-pushed the marc/db-only-migrate-three-databases branch from e1b6797 to 7966f87 Compare November 11, 2026 23:45
marcleblanc2 added a commit to sourcegraph/docs that referenced this pull request Nov 12, 2026
sourcegraph/deploy-sourcegraph-docker#1485 adds codeinsights-db to
db-only-migrate.docker-compose.yaml, so the docs page does not need to
start it separately.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1d197-7a9c-71fc-9998-6e55df9c47d0
Co-authored-by: Amp <amp@ampcode.com>
@marcleblanc2
marcleblanc2 removed this pull request from stack #1491 November 12, 2026 22:27
@marcleblanc2
marcleblanc2 force-pushed the marc/db-only-migrate-three-databases branch from 7966f87 to 61ee565 Compare November 12, 2026 22:27
@marcleblanc2
marcleblanc2 changed the base branch from marc/skip-smoke-test-on-docs-only to main November 12, 2026 22:27
@marcleblanc2
marcleblanc2 marked this pull request as ready for review November 12, 2026 22:28
@marcleblanc2
marcleblanc2 requested a review from a team November 12, 2026 22:28
@marcleblanc2 marcleblanc2 changed the title docker-compose: Start all three databases from db-only-migrate docker-compose: Add codeinsights-db to db-only-migrate Nov 13, 2026
@marcleblanc2
marcleblanc2 enabled stacked auto-merge (squash) November 13, 2026 01:38
@marcleblanc2
marcleblanc2 force-pushed the marc/db-only-migrate-three-databases branch from 61ee565 to d94786e Compare November 13, 2026 01:41
@marcleblanc2
marcleblanc2 disabled stacked auto-merge November 13, 2026 01:41
@marcleblanc2
marcleblanc2 changed the base branch from main to marc/drop-compose-version November 13, 2026 01:41
@marcleblanc2
marcleblanc2 added this pull request to stack #1500 November 13, 2026 01:41
Base automatically changed from marc/drop-compose-version to main November 13, 2026 02:06
The file left out codeinsights-db, which the backup and restore docs dump, and its copies of pgsql and codeintel-db had drifted from docker-compose.yaml. It now extends all three services from that file.
@marcleblanc2
marcleblanc2 force-pushed the marc/db-only-migrate-three-databases branch from d94786e to dd8c812 Compare November 13, 2026 02:06
@marcleblanc2
marcleblanc2 enabled stacked auto-merge (squash) November 13, 2026 02:06
marcleblanc2 added a commit to sourcegraph/docs that referenced this pull request Nov 13, 2026
sourcegraph/deploy-sourcegraph-docker#1485 adds codeinsights-db to
db-only-migrate.docker-compose.yaml, so the docs page does not need to
start it separately.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1d197-7a9c-71fc-9998-6e55df9c47d0
Co-authored-by: Amp <amp@ampcode.com>
@marcleblanc2
marcleblanc2 merged commit 26baec3 into main Nov 13, 2026
3 checks passed
@marcleblanc2
marcleblanc2 deleted the marc/db-only-migrate-three-databases branch November 13, 2026 02:15
marcleblanc2 added a commit to sourcegraph/docs that referenced this pull request Nov 13, 2026
## Problems

- The database restore commands passed `-v ERROR_ON_STOP=1` to `psql`, a
typo for `ON_ERROR_STOP`, so restores hid their errors and exited 0

- Fixing the typo exposed more broken steps

## Solution

- This PR fixes the errors
- Merged the duplicate restore procedures on each page

## Test results

- Every step was run exactly as written, on both Docker Compose and a
Helm 8.2.0 deployment
  - No errors
  - The restored databases are identical to the backups
  - Sourcegraph's data is restored and verified

## Follow up

-
[deploy-sourcegraph-docker#1485](sourcegraph/deploy-sourcegraph-docker#1485)
adds codeinsights-db to the db-only docker-compose.override.yaml file

---------

Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants