Migrate all devices from Stack V3


I’m trying to export all devices (for a specific application) using the CLI. I would like to migrate all devices to another private stack V3 instance.
The migration tool cannot be used because it’s only compatible with the V2 stack.
How can I extract all the devices with their keys and sessions?