My app ships with a default local Realm file, which upon install is copied from the assets directory to an app specific directory. This file has default values for certain objects (Playlists, Media Items) used for onboarding. Occasionally these get updated as the app versions change. For example, I may add or remove Playlists, or the media associated with them.
When this happens, for existing users I now have this situation:
- The user will have had the default Realm file copied to the internal location, and they will have added to it.
- The default Realm file in assets has been updated.
- I need to replace these “internal onboarding” objects in the Realm file in the assets directory into the user’s live Realm file.
Is it possible to have two Realm files open simultaneously? That would solve my problem I think, I could just open both, and delete/replace the objects used for onboarding in the user’s Realm with the updated values in the Realm located in the assets directory.