Realm Java and Realm Kotlin SDK: Local File Interoperability
0 reputation · 11 Jun 2021, 03:22 UTC
Data Migration and SDK Coexistence
When transitioning an Android application from the Realm Java SDK (io.realm) to the Realm Kotlin Multiplatform SDK (io.realm.kotlin), there is a critical boundary regarding the underlying storage engine. While both SDKs target the same general data model concepts, they bundle different versions of the Realm Core engine.
Current documentation indicates that the on-disk file formats are not interchangeable. This creates a challenge for applications with existing local databases that must migrate to the Kotlin SDK without losing user data. Because the SDKs handle schema locking and file headers differently, attempting to open a Realm Java file using the Kotlin SDK typically results in a format incompatibility.
Furthermore, running both SDKs within a single process to facilitate a side-by-side migration is unsupported and may lead to database corruption.
- What is the recommended strategy for migrating existing local data from Realm Java to Realm Kotlin without a supported automated conversion tool?
- Is there a documented method to safely read data from a Realm Java file using the Kotlin SDK in a read-only capacity to facilitate a manual export/import?