DISCLAIMER
Please note that all content presented on this page is provided by Tuya (HK) Limited. Alibaba Cloud makes no representations and warranties, explicit or implied, as to the authenticity or accuracy of any such content, nor makes any guarantee to the condition, quality, durability, performance, reliability, merchantability or fitness for a particular purpose, or non-infringement of any products and/or services made available by Tuya (HK) Limited.
1. Description of the overall scheme
In order to meet the needs of customers migrating from other IoT platforms or self-developed platforms to Alibaba Cloud, Tuya provides a low-cost migration solution for customers to migrate from the original IoT platform at the lowest cost.

Figure 1.1 Overview of Customer Migration Scenario
Customer Migration Steps:
1. According to the classification of customer scenarios, determine the appropriate equipment (firmware update) and cloud (data migration) transformation solutions for customers. 2. The transformation work of the equipment side and the cloud side can be carried out simultaneously. Usually, the process lasts for about one week to one month according to the number of equipment products and interfaces to be connected. 3. After the development is completed, enter the POC verification and testing process, including functional testing and performance testing, for about a week. 4. The cloud stock data is migrated from the original platform to the Tuya IoT platform for about one week. 5. The firmware on the device side starts to gray-scale OTA, which lasts for about a week according to the business situation. 6. Upgrade all equipment to OTA until all equipment is upgraded, the existing IoT platform business can be offline.
2.Segmentation by Customer Scenario

Figure 2.1 IoT platform customer solution decision tree
2.1 Pure new equipment scheme
2.1.1 Equipment End
New devices need to develop new firmware. You can use Alibaba Cloud IoT Platform. Link SDK for Cdevelop new firmware, domain names and certificates using private service addresses provided by the Tuya IoT platform.
2.1.2 Cloud
Refer to the Alibaba Cloud version of Tuya IoT Platform application Development Guide, connect to the cloud API to realize functions related to device management and device control, and connect the upstream data of the device with its own business system through Server subscription.
2.2 Dual Platform Fusion Solution
If some customers cannot be OTA equipment due to the long-term failure to update and maintain the firmware of historical equipment, or cannot find factories or suppliers to provide firmware development support, or are worried about the stability risk of equipment firmware upgrade, it is recommended that customers continue to use the original IoT platform for existing equipment until it is naturally eliminated, and only connect new equipment to Tuya IoT Platform Aliyun Edition (hereinafter referred to as Tuya). The following scheme can be adopted:

Figure 2.2 Dual-platform fusion scheme
2.2.1 Equipment End
New devices need to develop new firmware. You can use Alibaba Cloud IoT Platform. Link SDK for Cdevelop new firmware, domain names and certificates using private service addresses provided by the Tuya IoT platform.
If the old device is developed based on Alibaba Cloud IoT Platform, most of the basic code can continue to be reused, and only the differentiated business function code needs to be modified.
2.2.2 Cloud
Refer to the Alibaba Cloud version of Tuya IoT Platform application Development Guide, connect to the cloud API to realize functions related to device management and device control, and connect the upstream data of the device with its own business system through Server subscription.
Due to the parallel requirements with the original IoT platform equipment business, it is usually recommended that customers implement dual-platform docking in the cloud and complete the business-side data fusion work on their own.
If the original platform is developed based on the Alibaba Cloud IoT platform, API calls can be quickly implemented only by adding a set of domain names and certificate configurations, and do not need to be reconnected.
2.3 Inventory Device Migration Solution
2.3.1[Alibaba Cloud IoT Platform] Customers
2.3.1.1 Equipment End
Device Connections
It is necessary to develop new firmware, change the mqtt_host in the original Alibaba Cloud IoT Platform Link SDK to the MQTT access address of the Tuya IoT Platform Alibaba Cloud version, and upload the device CA certificate (not required if the Basic Auth authentication method is used).
After that, use the OTA upgrade feature of Alibaba Cloud IoT platform to upgrade the firmware of the existing devices. After the upgrade, the devices will be reconnected to the Alibaba Cloud version of Tuya IoT platform.
Before upgrading, make sure that the product model and device triplet information have been imported into Tuya IoT platform Alibaba Cloud Edition.
Sample Code:
/* Tuya IoT platform Alibaba Cloud version MQTT access point address */ const char *mqtt_host = "${instance ID}.aliyun.tuyacloud.com"; /* Tuya IoT platform Alibaba Cloud version MQTT access point port number, MQTT 1883, MQTTS 8883 */ const uint16_t port = 8883;
Messaging: because the Alibaba Cloud version of Tuya IoT platform is compatible with the Alink protocol specification, this part does not need to be modified.
2.3.1.2 Cloud
Metadata migration: After querying the product information, device triplet information and other data that need to be migrated under the IoT platform instance through the Alibaba Cloud IoT platform cloud API, the information is written through the Alibaba Cloud version of the Tuya IoT platform cloud API. Or the data is exported and provided to the Tuya R&D team, who will assist in the initialization of the platform data import work.
Message sending and receiving: The preferred solution is to develop new firmware based on the Alibaba Cloud IoT platform Link SDK and complete the upgrade. If the device-side firmware is not suitable for large-scale transformation, you can use custom topics and data parsing functions in the cloud to make the historical firmware logic compatible.
2.3.2.1 Device side
Device connection: The domain name and certificate for device connection are owned by the customer, so no modification is required on the device side. You only need to upload the device CA certificate in the Tuya IoT Platform Alibaba Cloud Edition (not required if Basic Auth authentication is used) and modify the original MQTT domain name through DNS resolution to the MQTT access address provided by the Tuya IoT Platform Alibaba Cloud Edition to complete the access migration.
Message sending and receiving: The preferred solution is to develop new firmware based on the Alibaba Cloud IoT platform Link SDK and complete the upgrade. If the device-side firmware is not suitable for large-scale transformation, you can use custom topics and data parsing functions in the cloud to make the historical firmware logic compatible.
2.3.2.2 Cloud
Metadata Migration:
Product information: For devices on the self-built IoT platform, refer to the product function definition of the Tuya IoT platform to complete the creation and import of the product object model.
Authentication adaptation: The device triplet information of the self-built IoT platform can be imported and registered in batches through the device management function of the Tuya IoT platform Alibaba Cloud version. Or, through a custom authentication solution, the customer implements the third-party authentication logic, which can reuse the original device authentication logic, but the stability of this solution will be somewhat reduced compared to the one-party authority integration.
Application transformation: Refer to the application development guide of Tuya IoT platform Alibaba Cloud version, connect to the cloud API to implement device management and device control related functions, and connect the device uplink data with its own business system through server subscription.
2.3.3 [Other cloud vendor platforms] Customers
2.3.3.1 Device Side
The device needs to develop new firmware. Use the Alibaba Cloud IoT platform Link SDK to develop the new firmware, and then use the OTA capability of the original platform to upgrade the firmware. After the device is upgraded, it is connected to the Tuya IoT platform Alibaba Cloud version.
2.3.3.2 Cloud
Refer to 2.3.2 Self-built IoT platform solution.
2.4 What R&D roles need to pay attention to
[Client] The IoT platforms of various manufacturers do not involve client functions and App SDK. Usually, the customer App or Web directly calls its own cloud service implementation. For example, if the App or Web needs to implement the MQTT direct connection function, you can refer to the device-side logic implementation. The Android Link SDK, iOS Link SDK and Node.js Link SDK can be referenced.
[Device side] For devices that cannot implement firmware OTA, it can only be achieved by modifying the domain name resolution, which requires the cooperation of the original manufacturer's platform.
[Cloud] Device triplet, which refers to product_key, device_name, and device_secret, is usually the authentication information required for the device to connect to the cloud platform. If it is incorrect, the device will be unable to connect to the platform.
[Cloud] The server subscription function requires the VPC peering connection function to be configured in advance to achieve data communication capabilities across VPCs.
Appendix:
1. Alibaba Cloud IoT Platform Instance Terminal Node Information
Public Examples:
MQTT: ${Product Key}.iot-as-mqtt.${Region ID}.aliyuncs.com
Cloud API: iot.${region ID}.aliyuncs.com
Enterprise Examples
MQTT: ${instance ID}.mqtt.iothub.aliyuncs.com
Cloud API: iot.${region ID}.aliyuncs.com
2. Tuya Internet of Things platform instance terminal node information
premium Edition:
MQTT:${instance ID}.aliyun.tuyacloud.com, Port 1883/8883
API:${instance ID}.aliyun.tuyacloud.com, Port 8686
3. Service Guarantee
Product Service Guarantee
Product SLA guarantee: the alibaba cloud version of the crow iot platform is deployed and delivered in the alibaba cloud computing nest full hosting mode, which can support alibaba cloud's global data center nodes with a high SLA reliability guarantee of 99.95.
Alibaba Cloud Joint Products: The Alibaba Cloud version of the Crow Internet of Things platform is sold through the Alibaba Cloud market. Alibaba Cloud and Tuya work together to provide customers with product use, technology iteration, and overall service guarantee before and after daily sales.
Technical support: The Tuya team will provide technical guidance and assistance throughout the customer migration process, deal with various technical problems arising from the migration in a timely manner, and ensure that the migration work is completed on time and with high quality. In the follow-up use, it will also respond to customer problems in a timely manner and provide 7 × 12 hours of technical support services to ensure the normal use of customers and provide reliable service guarantee for customers' use.
Service Migration Assurance Plan
Tuya provides a one-month free product trial for domestic customers. Based on business needs, Tuya offers 7x12 technical support, with technical experts assisting in the design and implementation of migration plans to jointly ensure long-term and stable after-sales service.
According to the customer's business needs, Tuya provides technical experts to assist customers in designing and implementing migration solutions and jointly guarantee long-term and stable after-sales support services.