Instant Messaging (IM) has a wealth of experience in high-concurrency and high-reliability operations. For app developers who are using self-developed or third-party instant messaging services and hope to integrate IM, the issue of migration needs to be considered. IM provides targeted migration solutions for different scenarios.
In subsequent documents, we will use the following terminology:
The migration process is essential to switch the instant messaging service backend from the old system to the new system and upgrade App 1.0 to App 2.0.
IM provides the following two migration solutions for you to choose from. Different solutions have different migration effects and differ sharply in implementation difficulty. You need to take the overall existing instant messaging situation of your app into account when choosing a proper migration solution.
The mandatory upgrade policy forcibly upgrades App 1.0 to App 2.0 after IM data synchronization is completed. This solution is easy to implement, and compatibility between the new and old apps after the upgrade does not need to be addressed. The following figure shows the detailed solution:
The main process is as follows:
In this solution, the new and old apps can coexist, and messages are synchronized between both apps. Before App 1.0 is disabled, the app backend needs to maintain real-time two-way synchronization between the new and old systems. This solution is relatively complicated, but provides a better experience for end users. The following figure shows the detailed solution:
The main process is as follows:
Importing accounts is the prerequisite for subsequent imports of various data.
The app backend needs to call the RESTful API for batch account imports to import all existing accounts into IM. If you need to import user nicknames and profile photos while importing accounts, call the RESTful API for importing a single account.
Call the RESTful API for setting profiles to import existing user profiles into IM.
Call the RESTful API for adding friends to import existing relationship chains into IM.
Call the RESTful API for importing one-to-one messages to import existing one-to-one messages into IM.
Call the RESTful API for marking one-to-one messages as read to mark one-to-one messages as read.
Follow the directions below to import the group data and message history of group chats:
One-to-one messages, group data, and group messages all need to be hosted to the new system. When new data of these types is generated in the new system, use the callbacks provided by IM to synchronize the new data to the old system. Meanwhile, new data generated in the old system also needs to be synchronized to the new system.
When new messages are generated in the old system, synchronize them to IM by calling the RESTful API for sending a single one-to-one message. When new messages are generated in IM, synchronize them to the old system by calling the callback after delivering one-to-one messages.
Synchronizing group profiles
Synchronizing group member information
Synchronizing group messages
Note:
If the solutions provided here do not apply to the existing instant messaging service of your app, please contact a customer service agent or business manager to formulate an appropriate migration solution.
Was this page helpful?