Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cspell-allow-list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ refreshable
registryurl
reindexdb
reindexing
releaseregistry
relid
relkind
relname
Expand Down Expand Up @@ -588,6 +589,7 @@ unmigrated
unminimize
untar
updatecheck
upgradestore
upperand
urlencode
urlsafe
Expand Down
27 changes: 0 additions & 27 deletions docs/how-to/aws-instance-sizing.mdx

This file was deleted.

2 changes: 0 additions & 2 deletions docs/self-hosted/deploy/docker-compose/configuration.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Configuration

> ⚠️ We recommend using our [machine image](/self-hosted/deploy/machine-images/), which is much easier and offers more flexibility when configuring Sourcegraph. Existing customers can reach out to our Customer Support Engineering team support@sourcegraph.com for assistance with migrating.

You can find the default base [docker-compose.yaml](https://github.com/sourcegraph/deploy-sourcegraph-docker/blob/master/docker-compose/docker-compose.yaml) file inside the [deploy-sourcegraph-docker](https://github.com/sourcegraph/deploy-sourcegraph-docker/blob/master/docker-compose) repository. We strongly recommend using an override file, instead of modifying the base docker-compose.yaml file.

To configure your Sourcegraph instance, see Sourcegraph's [configuration](/admin/) docs.
Expand Down
2 changes: 0 additions & 2 deletions docs/self-hosted/deploy/docker-compose/migrate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

<Callout type="warning">The single-container (`sourcegraph/server`) deployment mode has been **removed in [Sourcegraph 7.0.0](https://sourcegraph.com/changelog/releases/7.0)**. The `sourcegraph/server` Docker image is no longer published starting with 7.0.0. You **must** migrate to Docker Compose or Kubernetes before upgrading to 7.0.0.</Callout>

> ⚠️ We recommend new users use our [Kubernetes Helm](/self-hosted/deploy/kubernetes) or [Docker Compose](/self-hosted/deploy/docker-compose) deployment methods. Note: [machine image](/self-hosted/deploy/machine-images/) and [script-install](/self-hosted/deploy/single-node/script) deployments are being sunset in [Sourcegraph 7.0.0](https://sourcegraph.com/changelog/releases/7.0). Existing customers can reach out to our Customer Engineering team support@sourcegraph.com for migration assistance.

Deploying via Docker Compose is the recommended method for production deployments as it provides resource isolation between Sourcegraph services which makes it more scalable and stable. This page describes how to migrate from a single Docker image deployment to the Docker Compose deployment method.

Sourcegraph's core data (including user accounts, configuration, repository-metadata, etc.), can be migrated from the single Docker image (`sourcegraph/server`) to the Docker Compose deployment by dumping and restoring the Postgres database.
Expand Down
2 changes: 0 additions & 2 deletions docs/self-hosted/deploy/docker-compose/operations.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Management Operations

> ⚠️ We recommend using our [machine image](/self-hosted/deploy/machine-images/), which is much easier and offers more flexibility when configuring Sourcegraph. Existing customers can reach out to our Customer Support Engineering team support@sourcegraph.com for assistance with migrating.

---

The Sourcegraph Docker Compose yaml file uses [Docker volumes](https://docs.docker.com/storage/volumes/) to store its data. These volumes are stored at `/var/lib/docker/volumes` by [default on Linux](https://docs.docker.com/storage/#choose-the-right-type-of-mount).
Expand Down
16 changes: 6 additions & 10 deletions docs/self-hosted/deploy/docker-compose/upgrade.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ $ docker-compose up -d --remove-orphans
> advisement.{' '}
> </Callout>

<Callout type="warning">
If you are upgrading to [Sourcegraph 7.0.0](https://sourcegraph.com/changelog/releases/7.0) or later and your databases are still on PostgreSQL 12, you must first upgrade to a 6.x release (such as 6.11.x) to allow the automatic PostgreSQL 12 to 16 upgrade to complete. The entrypoint script that performs this upgrade has been removed in 7.0.0.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@enriquegh this information is needed somewhere, not all customers are on v6+ yet, hopefully this isn't the last place we're deleting this info from?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This notice should still be in pre 8.0 versions of the docs. Those (example) would still show this. The alternative would be to leave it or put in some consolidated place and hope we remember once all customers are in 7.0+

</Callout>

To perform a multi-version upgrade via migrators [upgrade](/self-hosted/updates/migrator/migrator-operations#upgrade) command on a Sourcegraph instance running on Docker compose follow the procedure below:

1. **Check Upgrade Readiness**:
Expand All @@ -98,15 +94,15 @@ To perform a multi-version upgrade via migrators [upgrade](/self-hosted/updates/
```yaml
migrator:
container_name: migrator
image: 'index.docker.io/sourcegraph/migrator:6.0.0'
image: 'index.docker.io/sourcegraph/migrator:{CURRENT_VERSION_NO_V}'
```
2. Set the migrator `command:` to `upgrade` you'll need to supply a `--to=` argument to the version you're upgrading to.
**Example:**
```yaml
command: ['upgrade', '--from=v5.9.0', '--to=v6.0.0']
command: ['upgrade', '--from=v7.5.0', '--to=v8.1.0']
```
> _Note: you may add the `--dry-run` flag to the `command:` to test things out before altering the dbs_ 3. Run migrator with `docker-compose up migrator`
- Migrator `depends_on:` will ensure the databases are ready before attempting to run the migrator. Ensuring that database entry point scripts are run before the migrator attempts to connect to the databases. For users upgrading from a version earlier than `5.10.0`, a PostgreSQL version is required and will be performed automatically here. For more details, see [Upgrading PostgreSQL](/self-hosted/postgres#upgrading-postgresql).
- Migrator `depends_on:` will ensure the databases are ready before attempting to run the migrator. Ensuring that database entry point scripts are run before the migrator attempts to connect to the databases.
**Example:**
```sh
$ ~/deploy-sourcegraph-docker/docker-compose/ docker-compose up migrator
Expand All @@ -120,7 +116,7 @@ To perform a multi-version upgrade via migrators [upgrade](/self-hosted/updates/
✔ Container migrator Created 0.0s
! migrator The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested 0.0s
Attaching to migrator
migrator | ✱ Sourcegraph migrator 6.0.0
migrator | ✱ Sourcegraph migrator 8.1.1335
migrator | ⚠️ Failed to check for migrator update: unexpected status code 404. Continuing...
migrator | Attempting connection to frontend...
migrator | ✅ Connection to frontend succeeded
Expand All @@ -130,7 +126,7 @@ To perform a multi-version upgrade via migrators [upgrade](/self-hosted/updates/
migrator | ✅ Connection to codeintel succeeded
migrator | Attempting connection to codeinsights...
migrator | ✅ Connection to codeinsights succeeded
migrator | 👉 Migrating to v6.0 (step 1 of 1)
migrator | 👉 Migrating to v8.1 (step 1 of 1)
migrator | 👉 Running schema migrations
migrator | ✅ Schema migrations complete
migrator exited with code 0
Expand All @@ -144,7 +140,7 @@ To perform a multi-version upgrade via migrators [upgrade](/self-hosted/updates/
```yaml
migrator:
container_name: migrator
image: 'index.docker.io/sourcegraph/migrator:6.0.0@sha256:ec295eb0b743da6bf56777ca6524972267a5c442b0288095e2fe12fce38ebacc'
image: 'index.docker.io/sourcegraph/migrator:{CURRENT_VERSION_NO_V}'
cpus: 0.5
mem_limit: '500m'
command: ['up']
Expand Down
20 changes: 2 additions & 18 deletions docs/self-hosted/deploy/kubernetes/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1004,21 +1004,6 @@ When all pods have restarted and show as Running, you can browse to your Sourceg

**Step 2:**

<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. Additionally,
starting in [Sourcegraph 7.0.0](https://sourcegraph.com/changelog/releases/7.0), the automatic PostgreSQL 12 to 16 upgrade
entrypoint script has been removed entirely. For more info see
our [PostgreSQL upgrade docs](/self-hosted/postgres#requirements).

</Callout>

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

Expand Down Expand Up @@ -1068,16 +1053,15 @@ $ helm upgrade --install -n <your namespace> --set "migrator.args={upgrade,--fro
**Example:**

```sh
$ helm upgrade --install -n sourcegraph --set "migrator.args={upgrade,--from=3.41.0,--to=4.5.1}" sourcegraph-migrator sourcegraph/sourcegraph-migrator --version {CURRENT_VERSION_NO_V}
$ helm upgrade --install -n sourcegraph --set "migrator.args={upgrade,--from=7.5.0,--to=8.1.0}" sourcegraph-migrator sourcegraph/sourcegraph-migrator --version {CURRENT_VERSION_NO_V}
Release "sourcegraph-migrator" has been upgraded. Happy Helming!
NAME: sourcegraph-migrator
LAST DEPLOYED: Tue Mar 7 18:23:56 2023

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: worth changing the year :p

NAMESPACE: sourcegraph
STATUS: deployed
REVISION: 2
TEST SUITE: None
✅ Out of band migrations complete
👉 Migrating to v4.5 (step 3 of 3)
👉 Migrating to v8.1 (step 1 of 1)
👉 Running schema migrations
✅ Schema migrations complete
```
Expand Down
30 changes: 6 additions & 24 deletions docs/self-hosted/deploy/kubernetes/upgrade.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ A [standard upgrade](/self-hosted/updates/#upgrade-types) occurs between a Sourc

### Upgrade with Kubernetes Kustomize

The following procedure is for performing a **standard upgrade** with Sourcegraph instances version **`v4.5.0` and above**, which have [**migrated**](/self-hosted/deploy/kubernetes/kustomize/migrate) to the [deploy-sourcegraph-k8s repo](https://github.com/sourcegraph/deploy-sourcegraph-k8s).
The following procedure is for performing a **standard upgrade** with Sourcegraph instances deployed with the [deploy-sourcegraph-k8s repo](https://github.com/sourcegraph/deploy-sourcegraph-k8s).

**Step 1**: Create a backup copy of the deployment configuration file

Expand Down Expand Up @@ -111,7 +111,7 @@ To perform a multi-version upgrade via migrators [upgrade](/self-hosted/updates/
kubectl apply --prune -l deploy=sourcegraph -f cluster.yaml
```

> Note: This step will ensure that any PostgreSQL upgrade performed as an entrypoint script will have a chance to execute before the migrator is run. For more information see [Upgrading PostgreSQL](/self-hosted/postgres#upgrading-postgresql). **Starting in [Sourcegraph 7.0.0](https://sourcegraph.com/changelog/releases/7.0), the entrypoint upgrade script has been removed. Users on PostgreSQL 12 must upgrade to a 6.x release first.**
> Note: This step will ensure that any PostgreSQL upgrade performed as an entrypoint script will have a chance to execute before the migrator is run. For more information see [Upgrading PostgreSQL](/self-hosted/postgres#upgrading-postgresql).

4. **Run Migrator with the `upgrade` command**:

Expand All @@ -123,8 +123,8 @@ To perform a multi-version upgrade via migrators [upgrade](/self-hosted/updates/

```yaml
- name: migrator
image: "index.docker.io/sourcegraph/migrator:6.0.0" // here we use a later version of migrator than the version we're upgrading too.
args: ["upgrade", "--from=v5.9.0", "--to=5.11.0"]
image: "index.docker.io/sourcegraph/migrator:{CURRENT_VERSION_NO_V}" // here we use a later version of migrator than the version we're upgrading too.
args: ["upgrade", "--from=v7.5.0", "--to=v8.1.0"]
env:
```

Expand Down Expand Up @@ -161,18 +161,8 @@ To perform a multi-version upgrade via migrators [upgrade](/self-hosted/updates/
system, terminal, and any other details, to:
https://sourcegraph.com/contact

✱ Sourcegraph migrator 4.5.1
👉 Migrating to v3.43 (step 1 of 3)
👉 Running schema migrations
✅ Schema migrations complete
👉 Running out of band migrations [1 2 4 5 7 13 14 15 16]
✅ Out of band migrations complete
👉 Migrating to v4.3 (step 2 of 3)
👉 Running schema migrations
✅ Schema migrations complete
👉 Running out of band migrations [17 18]
✅ Out of band migrations complete
👉 Migrating to v4.5 (step 3 of 3)
✱ Sourcegraph migrator 8.1.1335
👉 Migrating to v8.1 (step 1 of 1)
👉 Running schema migrations
✅ Schema migrations complete
$ kubectl -n sourcegraph get jobs
Expand All @@ -194,14 +184,6 @@ To perform a multi-version upgrade via migrators [upgrade](/self-hosted/updates/
```
Your instance should now be up and running in the new version!

---

### Using MVU to Migrate to Kustomize

Due to limitations with the Kustomize deployment method introduced in Sourcegraph `v4.5.0`, multi-version upgrades (e.g. `v4.2.0` -> `v5.0.3`), migrations to `deploy-sourcegraph-k8s` should be conducted separately from a full upgrade.

Admins upgrading a Sourcegraph instance older than `v4.5.0` and migrating from our [legacy kubernetes](https://github.com/sourcegraph/deploy-sourcegraph) offering to our new [kustomize manifests](https://github.com/sourcegraph/deploy-sourcegraph-k8s) should upgrade to `v4.5.0` perform the `migrate` [procedure](/self-hosted/deploy/kubernetes/kustomize/migrate) and then perform the remaining upgrade to bring Sourcegraph up to the desired version.

## Rollback

## Rollback
Expand Down
Loading
Loading