Upgrading from sentry 9.1.2 to latest sentry installation

I’ve got a server running sentry 9.1.2 using docker and traefik I’m wondering if there is a good guide on how to upgrade to the new on premise installation. I’ve attached my current docker-compose.yml file below.

version: '3'
services:
  reverse-proxy:
    image: traefik:2.3
    restart: unless-stopped
    #command: --api --docker
    ports:
      - "80:80"
      - "8080:8080"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /opt/traefik/traefik.yml:/traefik.yml
      - /opt/traefik/acme.json:/acme.json

  memcached:
    restart: unless-stopped
    image: memcached:1.4

  redis:
    restart: unless-stopped
    image: redis:3.2-alpine
    volumes:
      - ./data/redis:/data

  postgres:
    restart: unless-stopped
    image: postgres:9.5
    environment:
      POSTGRES_PASSWORD: REDACTED
      POSTGRES_USER: sentry
    volumes:
      - ./data/postgres:/var/lib/postgresql/data

  web:
    restart: unless-stopped
    # build: .
    image: sentry:latest
    #stdin_open: true
    #tty: true
    environment:
      SENTRY_SECRET_KEY: 'REDACTED'
      SENTRY_MEMCACHED_HOST: memcached
      SENTRY_REDIS_HOST: redis
      SENTRY_POSTGRES_HOST: postgres
      SENTRY_DB_USER: sentry
      SENTRY_DB_PASSWORD: REDACTED
      SENTRY_EMAIL_HOST: 'smtp.mailgun.org'
      SENTRY_EMAIL_PORT: 587
      SENTRY_EMAIL_USER: REDACTED
      SENTRY_EMAIL_PASSWORD: 'REDACTED'
      SENTRY_EMAIL_USE_TLS: 'true'
      SENTRY_SLACK_CLIENT_ID: 'REDACTED'
      SENTRY_SLACK_CLIENT_SECRET: 'REDACTED'
      SENTRY_SLACK_VERIFICATION_TOKEN: 'REDACTED'
    volumes:
      - ./data/sentry:/var/lib/sentry/files
    labels:
      - "traefik.enable=true"
      - "traefik.http.middlewares.redirect.redirectscheme.scheme=https"
      - "traefik.http.routers.sentry-secure.rule=Host(`REDACTED`)"
      - "traefik.http.routers.sentry-secure.entrypoints=websecure"
      - "traefik.http.routers.sentry-secure.tls=true"
      - "traefik.http.routers.sentry-secure.tls.certResolver=letsencrypt"
      - "traefik.http.routers.sentry-secure.tls.domains[0].main=REDACTED"
      - "traefik.http.routers.sentry.rule=Host(`REDACTED`)"
      - "traefik.http.routers.sentry.entrypoints=web"
      - "traefik.http.routers.sentry.middlewares=redirect"
      - "slack.client-id=REDACTED"
      - "slack.client-secret=REDACTED"
      - "slack.verification-token=REDACTED"
    links:
      - "redis"
      - "postgres"
      - "memcached"
    ports:
      - '9000:9000'

  cron:
    restart: unless-stopped
    # build: .
    image: sentry:latest
    environment:
      SENTRY_SECRET_KEY: REDACTED
      SENTRY_MEMCACHED_HOST: memcached
      SENTRY_REDIS_HOST: redis
      SENTRY_POSTGRES_HOST: postgres
      SENTRY_DB_USER: sentry
      SENTRY_DB_PASSWORD: REDACTED
      SENTRY_EMAIL_HOST: 'smtp.mailgun.org'
      SENTRY_EMAIL_PORT: 587
      SENTRY_EMAIL_USER: REDACTED
      SENTRY_EMAIL_PASSWORD: REDACTED
      SENTRY_EMAIL_USE_TLS: 'true'
      SENTRY_SLACK_CLIENT_ID: REDACTED
      SENTRY_SLACK_CLIENT_SECRET: REDACTED
      SENTRY_SLACK_VERIFICATION_TOKEN: REDACTED
    volumes:
      - ./data/sentry:/var/lib/sentry/files
    command: run cron
    links:
      - "redis"
      - "postgres"
      - "memcached"

  worker:
    restart: unless-stopped
    # build: .
    image: sentry:latest
    environment:
      SENTRY_SECRET_KEY: REDACTED
      SENTRY_MEMCACHED_HOST: memcached
      SENTRY_REDIS_HOST: redis
      SENTRY_POSTGRES_HOST: postgres
      SENTRY_DB_USER: sentry
      SENTRY_DB_PASSWORD: REDACTED
      SENTRY_EMAIL_HOST: 'smtp.mailgun.org'
      SENTRY_EMAIL_PORT: 587
      SENTRY_EMAIL_USER: REDACTED
      SENTRY_EMAIL_PASSWORD: REDACTED
      SENTRY_EMAIL_USE_TLS: 'true'
      SENTRY_SLACK_CLIENT_ID: REDACTED
      SENTRY_SLACK_CLIENT_SECRET: REDACTED
      SENTRY_SLACK_VERIFICATION_TOKEN: REDACTED
    volumes:
      - ./data/sentry:/var/lib/sentry/files
    command: run worker
    links:
      - "redis"
      - "postgres"
      - "memcached"

  sentry:
    build: .
    stdin_open: true
    tty: true
    environment:
      SENTRY_SECRET_KEY: REDACTED
      SENTRY_MEMCACHED_HOST: memcached
      SENTRY_REDIS_HOST: redis
      SENTRY_POSTGRES_HOST: postgres
      SENTRY_DB_USER: sentry
      SENTRY_DB_PASSWORD: REDACTED
      SENTRY_EMAIL_HOST: 'smtp.mailgun.org'
      SENTRY_EMAIL_PORT: 587
      SENTRY_EMAIL_USER: REDACTED
      SENTRY_EMAIL_PASSWORD: REDACTED
      SENTRY_EMAIL_USE_TLS: 'true'
      SENTRY_SLACK_CLIENT_ID: REDACTED
      SENTRY_SLACK_CLIENT_SECRET: REDACTED
      SENTRY_SLACK_VERIFICATION_TOKEN: REDACTED
    volumes:
      - ./data/sentry:/var/lib/sentry/files
    links:
      - "redis"
      - "postgres"
      - "memcached"

You’ll need to port almost all those env var settings to your sentry.conf.py file or config.yml file. Then modify the docker-compose.yml in the GitHub - getsentry/onpremise: Sentry On-Premise setup repo.

Strongly recommend replacing those bind mounts with docker volumes as our system expects to use them that way for some automated fixes or migrations (such as postgres 9.5 → 9.6 migration).