Skip to main content

Apply upgrades

Follow this guide when upgrading Ory Hydra to a newer version.

danger

Back up your data! Applying upgrades can lead to data loss if handled incorrectly.

  1. Read the release notes. We try to make our release notes as comprehensive as possible, so make sure to give them a good read. They might contain information that is specific to your deployment.
  2. Review breaking changes. Visit the CHANGELOG.md to see if breaking changes have been introduced in the version you are upgrading to.
  3. Backup your data.
  4. Update the Ory Hydra SDK if used in your application.
  5. Install the new version of Ory Hydra.
  6. Run hydra migrate sql to run the SQL migrations to the new database schema.

Should you run into problems with the upgrade, consider a stepped upgrade and please visit the community chat or start a discussion.

Migrate from Hydra v1 to v2

Some consents may be erased when migrating to Hydra 2.0. We assume that only a very small number of sessions, issued by pre-1.0 Hydra, will be affected. Please contact us if this assumption doesn't apply or if the deletion adversely affects your deployment.

The below query displays the numbers of consents that will be deleted by the v2 migration. Make sure that you are happy with these consents being deleted before you proceed.

-- postgresql
SELECT
COUNT(*) AS count,
DATE_TRUNC('month', requested_at) AS month
FROM hydra_oauth2_consent_request
WHERE login_challenge IS NULL
GROUP BY month;