Sentry-cli export fails

While trying to export data via the sentry cli sentry export sentrydump.json I get a partial dump and the process hangs until the system runs out of memory and kills it.
The Sentry version is 7.7.1 so I don’t have the option to exclude models.
Any advice on how to export this data so I can use it on a new server would be appreciated.

Solved by updating sentry before the migration.