Hello @ena dedic ,
Due to the fact, an IoT Hub has a public endpoint and specific credentials and specific routes to services, it seems complicated to move an IoT Hub to another tenant.
Especially for cases like this, the Device Provisioning service is a great way for migration.
The typical migration path is (from the top of my hat):
- Have all your devices use a DPS to connect to an IoT Hub.
- Create a second IoT hub somewhere in the world (it can be part of a second subscription).
- Link the new IoT hub to the same DPS (the REST API support adding a connection string of an IoT HUb living in another subscription)
- Connect that IoT Hub to services, routes, etc. but do not provide it device registrations.
- Each device enrollment related to the 'old' iot hub, add the new iot hub and give it a 'static configuration' to that new iot hub
- give the device registration in the old IoT hub new credentials.
Because the device cannot connect to the old IoT hub, it will try to reprovision. Then it will be redirected to the new iot hub.
It's possible to migrate data. Please check the DPS documentation.
Due to the amount of work, You could try to automate this using the REST API of both the IoT Hub and DPS.