You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-central/core/howto-migrate-to-iot-hub.md
+54-20Lines changed: 54 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Migrate devices from Azure IoT Central to Azure IoT Hub | Microsoft Docs
3
3
description: Describes how to use the migration tool to migrate devices that currently connect to an Azure IoT Central application to an Azure IoT hub.
4
4
author: dominicbetts
5
5
ms.author: dobett
6
-
ms.date: 07/26/2022
6
+
ms.date: 09/12/2022
7
7
ms.topic: how-to
8
8
ms.service: iot-central
9
9
---
@@ -22,6 +22,9 @@ The tool requires your connected devices to implement a **DeviceMove** command t
22
22
- Provision itself with DPS by using the new ID scope in the command payload.
23
23
- Use the provisioning result to connect to the destination IoT hub and start sending telemetry again.
24
24
25
+
> [!TIP]
26
+
> You can also use the migrator tool to migrate devices between IoT Cental applications, or from an IoT hub to an IoT Central application.
27
+
25
28
## Prerequisites
26
29
27
30
You need the following prerequisites to complete the device migration steps:
@@ -32,7 +35,7 @@ You need the following prerequisites to complete the device migration steps:
32
35
33
36
## Device requirements
34
37
35
-
The devices that you want to migrate must implement the **DeviceMove** command. The command payload contains the *ID scope* of the destination DPS instance. The migrator tool repository includes an example [DTDL component model](https://raw.githubusercontent.com/Azure/iotc-migrator/main/assets/deviceMigrationComponent.json) that that defines the **DeviceMove** command. You can add this component to your existing device templates.
38
+
The devices that you want to migrate must implement the **DeviceMove** command in a component called **migration**. The command payload contains the *ID scope* of the destination DPS instance. The migrator tool repository includes an example [DTDL component model](https://raw.githubusercontent.com/Azure/iotc-migrator/main/assets/deviceMigrationComponent.json) that that defines the **DeviceMove** command. You can add this component to your existing device templates.
36
39
37
40
The tool repository also includes [sample code](https://github.com/Azure/iotc-migrator/tree/main/device_samples) that shows you how a device should implement the **DeviceMove** command.
38
41
@@ -50,18 +53,54 @@ The migrator tool requires an Azure Active Directory application registration to
50
53
51
54
1. Enter a name such as "IoTC Migrator app".
52
55
53
-
1. Select **Accounts in this organizational directory only ({your directory} only - Single tenant)**.
56
+
1. Select **Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)**.
54
57
55
58
1. Select **Single page application (SPA)**.
56
59
57
-
1. Enter `http://localhost:3000` as the redirect URI.
60
+
1. Enter `http://localhost:3000` as the redirect URI. You add this value to the migrator app configuration later.
58
61
59
62
1. Select **Register**.
60
63
61
64
1. Make a note of the **Application (client) ID** and **Directory (tenant) ID** values. You use these values later to configure the migrator app:
62
65
63
66
:::image type="content" source="media/howto-migrate-to-iot-hub/azure-active-directory-app.png" alt-text="Screenshot that shows the Azure Active Directory application in the Azure portal." lightbox="media/howto-migrate-to-iot-hub/azure-active-directory-app.png":::
64
67
68
+
1. Navigate to the **Manifest** page in the registration and replace the contents of the `requiredResourceAccess` with the following configuration:
Open the *config.ts* file in a text editor. Update the `AADClientID`and `AADDIrectoryID`with the values from the Azure Active Directory application registration you created previously. Update the `applicationHost` to match the URL of your IoT Central application. Then save the changes:
135
+
In the root of the downloaded repository, create a *.env* file. Update the `REACT_APP_AAD_APP_CLIENT_ID`, `REACT_APP_AAD_APP_TENANT_ID`, and `REACT_APP_AAD_APP_REDIRECT_URI` values with the values from the Azure Active Directory application registration you created previously. Then save the changes:
> Make sure the `AADRedirectURI` matches the redirect URI you used in your Azure Active Directory application registration.
145
+
> Make sure the `REACT_APP_AAD_APP_REDIRECT_URI` matches the redirect URI you used in your Azure Active Directory application registration.
110
146
111
147
In your command-line environment, navigate to the root of the `iotc-migrator` repository. Then run the following commands to install the required node.js packages and then run the tool:
112
148
@@ -115,7 +151,7 @@ npm install
115
151
npm start
116
152
```
117
153
118
-
After the migrator app starts, navigate to `http://localhost:3000` to view the tool.
154
+
After the migrator app starts, navigate to `http://localhost:3000` to view the tool. Sign in when you're prompted.
119
155
120
156
## Migrate devices
121
157
@@ -126,19 +162,17 @@ Use the tool to migrate your devices in batches. Enter the migration details on
126
162
1. Select a device template that includes the **DeviceMove** command definition.
127
163
1. Select **Move to your own Azure IoT Hub**.
128
164
1. Select the DPS instance linked to your target IoT hub.
129
-
1. Select **Migrate**.
165
+
1. Select **Migrate**. The tool prompts you to copy the keys from your IoT Central application to the DPS enrollment group. You previously completed this step in the [Add the device keys to DPS](#add-the-device-keys-to-dps) step.
130
166
131
167
:::image type="content" source="media/howto-migrate-to-iot-hub/migrator-tool.png" alt-text="Screenshot of migration tool." lightbox="media/howto-migrate-to-iot-hub/migrator-tool.png":::
132
168
133
169
The tool now registers all the connected devices that matched the target device filter in the destination IoT hub. The tool then creates a job in your IoT Central application to call the **DeviceMove** method on all those devices. The command payload contains the ID scope of the destination DPS instance.
134
170
135
171
## Verify migration
136
172
137
-
The **Migration status** page in the tool shows you when the migration is complete:
138
-
139
-
:::image type="content" source="media/howto-migrate-to-iot-hub/migration-complete.png" alt-text="Screenshot showing completed migration status in tool." lightbox="media/howto-migrate-to-iot-hub/migration-complete.png":::
173
+
Use the **Migration status** page in the migrator tool to monitor the progress.
140
174
141
-
Select a job on this page to view the [job status](howto-manage-devices-in-bulk.md#view-job-status) in your IoT Central application. Use this page to view the status of the individual devices in the job:
175
+
Select a job on the **Migration status** page to view the [job status](howto-manage-devices-in-bulk.md#view-job-status) in your IoT Central application. Use this page to view the status of the individual devices in the job:
142
176
143
177
:::image type="content" source="media/howto-migrate-to-iot-hub/job-status.png" alt-text="Screenshot showing completed migration status for IoT Central job." lightbox="media/howto-migrate-to-iot-hub/job-status.png":::
0 commit comments