Data Migration
Plan migration from existing cloud IM or self-built messaging systems.
Migrate from cloud services or upgrade versions
An OpenIMSDK deployment relies on several core data categories:
- User information
- Friend relationships
- Blocklists
- Groups
- Messages
- Conversations (can typically be rebuilt from message history)
If you are migrating from another IM cloud provider to OpenIMSDK, or upgrading from an older OpenIMSDK release to a newer version (such as upgrading from 3.3 to 3.8), follow the sequence below to import and synchronize your data.
1. Import users
- API reference: Create user / User registration
- Objective: Import user profiles and accounts from your legacy or external system into OpenIMSDK.
2. Import friend relationships
- API reference: Batch import friends
- Objective: Import existing friendship and contact connections into OpenIMSDK.
3. Import blocklists
- API reference: Add to blocklist
- Objective: Import blocked user lists from legacy records into OpenIMSDK.
4. Create groups
- API reference: Create group
- Objective: Recreate chat groups from external or legacy systems in OpenIMSDK.
5. Import group members
- API reference: Invite users to group
- Objective: Populate newly created groups with their existing members.
6. Import messages
- API reference: Send message
- Key field:
sendTime - Objective: Import historical chat messages into OpenIMSDK. If you are performing a version upgrade, parse existing message archives and inject them through this endpoint preserving original timestamps.
7. Set conversation states
- API reference: Set conversations
- Objective: Import conversation properties (such as pinned status, mute settings, and unread behavior) into OpenIMSDK.
Post-migration verification
Once these operations complete, OpenIMSDK retains full parity for user accounts, relationships, blocklists, groups, message histories, and conversation states. Upgrade the client SDKs to the target version to complete the migration.
To synchronize friend remarks or specific group configuration parameters, call the corresponding REST APIs as needed.