Follow this guide when upgrading Ory Hydra to a newer version.
Back up your data! Applying upgrades can lead to data loss if handled incorrectly.
- 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.
- Review breaking changes. Visit the CHANGELOG.md to see if breaking changes have been introduced in the version you are upgrading to.
- Backup your data.
- Update the Ory Hydra SDK if used in your application.
- Install the new version of Ory Hydra.
hydra migrate sqlto run the SQL migrations to the new database schema.
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.
COUNT(*) AS count,
DATE_TRUNC('month', requested_at) AS month
WHERE login_challenge IS NULL
GROUP BY month;