I have been using Realm for many years in an app. I just upgraded to the latest version of Realm (10.8.1) and am struggling to convert my local realm to a synced realm.
I use/create realms throughout the app using
let realm = try! Realm() after setting
Realm.Configuration.defaultConfiguration = config in App Delegate. The config object contains migration blocks that I have added.
From what I understand my objects now need a _id field, but I also need to create an App object, log in and then use the app users configuration to create a new realm. If I do that, I lose all the old data. First, how can I copy the old local realm data to the new synced realm? Second, can I set the defaultConfiguration to the new synced realm configuration, so I can continue using the same old try! Realm() everywhere, or is there a better practice?