IoT Platform allows you to migrate products, devices, and rules engine data from a legacy public instance to an Enterprise Edition instance. This example uses a shared-service enterprise to illustrate the required business system modifications and the migration solution.
Background information
Enterprise A runs a shared-service platform on IoT Platform, providing shared washing machines, dryers, and massage chairs across smart parks and smart campuses.
Compared with legacy public instances, Enterprise Edition instances offer more features, better scalability, higher stability, and more flexible business models. For more information, see Differences between public instances and Enterprise Edition instances.
To meet customer-specific project requirements, select a suitable Enterprise Edition instance type. This enables resource isolation, platform stability, and lower evaluation costs. For more information, see Types of Enterprise Edition instances.
Because existing devices run on legacy public instances, you can migrate device data to an Enterprise Edition instance for resource isolation, improved stability, and lower costs.
Scenarios

|
Sequence number |
Description |
|
1~1.2 |
Connect shared devices to IoT Platform and submit device data. |
|
Your application uses AMQP server-side subscriptions or data forwarding to receive device data, such as device status. |
|
|
Your databases store the forwarded device data or subscribed device data in real time. |
|
|
2~2.2 |
A customer scans a QR code on the shared-service platform app to complete authentication and authorization, views the device status, and sends commands to the shared device to use shared services. Note
After successful authentication, the app connects to the shared-service platform and starts billing. |
|
Your application receives commands from the customer and invokes IoT Platform device management services to start shared services on the device. |
|
|
While the device is running or after shared services complete, the device submits its status to IoT Platform. IoT Platform forwards the status data to your application through data forwarding, and your application stores it in the database. When shared services complete, the platform sends a push notification to the app with completion and billing details. |
Migration solution
For the instance migration process, see Usage notes. Evaluate the business system related to shared devices and create a migration solution based on that process.
Modify the business system
After evaluating the business system, modify the following items based on your business scenario to ensure devices communicate with IoT Platform correctly after migration.
|
Item |
Solution |
References |
|
AMQP server-side subscription |
If you use an SDK to connect an AMQP client to IoT Platform, specify the ID and endpoint of the destination Enterprise Edition instance and configure a new AMQP client. During phased migration, specify the latest consumer group ID and start the new AMQP client. Start both AMQP clients at the same time so they concurrently receive data from the source public instance and the destination Enterprise Edition instance, preventing data loss. |
|
|
Data forwarding |
Configure a data forwarding rule for the public instance.
|
|
|
IoT Platform API calls |
Develop an application based on your business requirements. Before calling an IoT Platform API operation, query the database to obtain the Enterprise Edition instance ID. Then, set the IotInstanceId parameter to this ID and call the API operation. |
Instance migration
After modifying the business system and releasing the application, use the instance migration feature to migrate shared devices from the public instance. The following figure shows the migration process.
|
Sequence number |
Step |
Description |
|
1~1.2 |
Debug the shared devices to be migrated from the public instance. |
When a customer uses the shared-service platform app to access shared services, the business application queries device information in the public instance. You can call IoT Platform API operations through an Alibaba Cloud gateway to manage devices to be migrated without specifying an instance ID. |
|
2~2.5 |
To start instance migration, perform the following steps: |
In the IoT Platform console, create and start an instance migration task to perform phased migration.
|
|
3 |
In the IoT Platform console, start a full migration task to migrate all remaining devices of a specified product to the Enterprise Edition instance. The process is the same as phased migration. Note
The full migration task applies to all devices except those already migrated during phased migration. |
|
|
4~4.2 |
Verify the shared devices that are migrated to the Enterprise Edition instance. |
A customer can use the shared-service platform app to access shared services without needing the instance ID. The business application queries device information in the Enterprise Edition instance. To call IoT Platform API operations to manage migrated devices through an Alibaba Cloud gateway, you must specify an instance ID. Note
If shared services work as expected after all devices are migrated, the instance migration is complete. If an error occurs when accessing shared services, use the rollback feature to migrate the devices back to the public instance while keeping other data unchanged. For more information, see Migrate the resources of an instance. |