Does anyone have good advice and experience making...
# ory-selfhosting
l
Does anyone have good advice and experience making the leap from Hydra 1.x -> 2.x? Those db migrations (throwing everything in to
hydra_oauth2_flow
tables and the addition of
nid
make that migration take forever on larger loads and databases (for example, our
hydra_oauth2_consent_request_handled
table approaches 30MM rows. Smaller databases in test environments go just fine, but testing on a copy of our production database has been running for over 30 hours. Obviously 30 hours of downtime is something we can't handle (and I have some ideas for that), but I'm curious what has worked for others. We can't be the only ones in this position? We don't want to delete too much from
hydra_oauth2_consent_request_handled
since we don't want to reset consent state for our users if we can help it. Our
hydra_oauth2_authentication_request
is over 100MM rows, so we have a process right now to get rid of "dangling" requests (i.e. those that are more than a week old and don't have a
hydra_oauth2_login_request_handled
associated with it), but that's slow going
f
what backend db do you use ? You could spin hydra 2 in paraller and migrate the data.
l
We use postgres as our db. We could migrate, but even just running the migration as-is has been going for a few days now. So I'm guessing the plan would be something like 1. clone db 2. migrate clone 3. build system to migrate data made after the clone to the clone 4. swap over