<@ULVA73B9P> I'm on version 3.6.2 self hosted dock...
# ask-marvin
n
@Marvin I'm on version 3.6.2 self hosted docker is there a docker upgrade path I need to take
m
thought for 118.6 seconds
Yes — for Prefect 3.6.2 → newer 3.x, there is not a special multi-step Docker upgrade path you need to take. A direct upgrade is supported. What you do need is the normal self-hosted upgrade process: 1. Back up your database If you're using Postgres for Prefect server state, take a backup first. 2. Update your Docker image tag For example, move from
prefecthq/prefect:3.6.2
to either: -
prefecthq/prefect:3-latest
- or a pinned version like
prefecthq/prefect:3.7.0
3. Run database migrations This is the important part:
Copy code
bash
prefect server database upgrade -y
If you run Prefect in Docker, run that against the same database your server uses. 4. Restart the server/services with the new image Recommended precaution: pause schedules before upgrading, then resume them after, just to avoid any odd scheduler edge cases during the transition. If you have a large database, especially lots of events, consider increasing the DB timeout during migration:
Copy code
bash
PREFECT_API_DATABASE_TIMEOUT=600
A common Docker pattern is:
Copy code
yaml
services:
  prefect:
    image: prefecthq/prefect:3-latest
    environment:
      PREFECT_API_DATABASE_CONNECTION_URL: <postgresql+asyncpg://user:pass@postgres:5432/prefect>
Then run:
Copy code
bash
docker compose run --rm prefect prefect server database upgrade -y
docker compose up -d
If you run multiple Prefect API/server replicas, do not let all of them migrate on startup at once. Run the migration once first, then bring up the updated containers. Useful docs: - Upgrade to Prefect 3 - Self-hosted Prefect - Database maintenance If you want, paste your
docker-compose.yml
and I can point out the safest exact upgrade steps for your setup.