# Upgrade Postgres > Upgrade an Orchard managed database to a newer Postgres major version, and review known vulnerabilities in the running version. Source: https://docs.orchard.hackclub.com/data/upgrades/ The Postgres project supports each major version for a fixed period, so a long-lived database eventually needs a major upgrade. Orchard runs the upgrade for you: it can rehearse on a copy first, takes a checkpoint, and puts the database back on the previous version if the upgrade fails. The database is offline during the upgrade step. Minor releases contain bug and security fixes only. To apply one, select **Update to ``** on the database's **Security** tab, or run `orchard db update `. Instances restart one at a time, standbys first. To have Orchard apply minor releases for you, an organization admin turns on **Apply minor updates automatically** under **Organization settings** > **Database defaults**. Orchard then updates a few databases each morning (UTC). An operator can turn automatic updates off for the whole instance. ## Prerequisites - Edit access to the project: the Admin or Member [project role](/teams/organizations/#project-roles). - A dedicated database that is running and healthy. - No other restore or upgrade running on the database. ## Check the running version **Dashboard** 1. Open the database. 2. Go to **Security**. The **Version and security** card shows the running version and its support date. It also lists known vulnerabilities from postgresql.org. **CLI** To read the running version and known vulnerabilities, run the following command: ```sh orchard db security ``` To list the versions that this instance offers, run the following command: ```sh orchard db versions ``` ## Upgrade to a new major version **Dashboard** 1. Open the database. 2. Go to **Security**. 3. Select **Upgrade to Postgres ``**. The button shows the newest version. 4. In **To**, select the target version. 5. Keep **Rehearse on a copy first** turned on. This adds a few minutes before the upgrade. 6. Select **Upgrade to Postgres ``**. To follow the upgrade, go to the **Backups** tab. **CLI** ```sh orchard db upgrade --to 18 --wait ``` To skip the rehearsal, add `--no-rehearse`. To change how long `--wait` blocks, use `--timeout`. The default is 10 minutes. ## How an upgrade runs 1. If rehearsal is on, Orchard upgrades a copy of the database to check that the upgrade works. 2. Orchard takes a [checkpoint](/data/backups/). 3. Orchard upgrades the database. The database is offline during this step. 4. Orchard runs `ANALYZE`. 5. If backup storage is set, Orchard starts a new backup. If the upgrade fails, Orchard returns the database to the previous version. If a previous rehearsal measured the upgrade time, the upgrade dialog shows that time as the expected offline period. ## Respond to a support warning **Version and security** shows a warning when support for the running major version ends soon, and an error after support ends. After that date, the major version receives no more security fixes. To resolve the warning or the error, upgrade to a newer major version. ## Related resources - [Back up and restore a database](/data/backups/) - Restore to a checkpoint if you need to undo an upgrade later. - [`orchard db upgrade` reference](/reference/cli/#db) - Review the upgrade flags, including `--no-rehearse` and `--timeout`.