New to Realm : upgrading from realm database to realm platform?

I’m new to realm and I want to use it offline first and have the possibility to sync it online after with the $30 plan.

So what I understand is the realm database is an offline and free database (same job as CoreData).
And the realm platform is a realm database which is synchronized on the cloud.

My question : is it possible to build an app with realm database and later migrate this database on realm platform to move the database online ?

Yes, of course.
Note: there is no local-to-cloud conversion. So, when you want to sync your database, then you need to create a synced realm and copy all of your current data to there. Otherwise it working fine.

Ok but if I distribute an iPhone app which contain the realm offline database, is it possible to release an update of this app to sync all my customers realm database to the realm cloud ?

1.) Release an app with local realm. There will be a realm file in the storage, with the user data.
2.) a.) Write the new app version.
b.) Write this function (pseudo code):
- open the local realm (you have the code for that from the previous version
- create a new, synced realm (new code)
- copy all data from local realm to synced realm (you have the local models, you can get access to them. ). It will be synced to the cloud, as the copied data are “new” [its new in the synced realm]
- delete local realm [free the storage]
- test,test,test
- test
- enjoy :slight_smile:

Thanks for this explanation! I’m deciding on using Realm and have a similar use case. Is it possible to go the other way? ie. read all data from a synced realm and copy it to a local realm, then delete the synced realm?