Hi there,
I need the ability for a customer to have the realm local only. Then subscribe and sync into the cloud. If not required anymore the Customer can go local again and unsubscribe from the sync. The sync method is flexible sync. How can it be archived? Does anyone have any experience with this procedure?
Hi @Bruno_Zimmermann unfortunately there is no automated way to do what you are trying to do with flexible sync, and your best option would be to do the conversion yourself, moving objects from one realm to another.
Open the sync realm the first time with the flexible sync configuration, and let the user log in, then close it.
Open the realm with the new “disconnected” config and let the user work offline
When the use registers you can open it again with the flexible sync configuration.
If needed, you can go back to using the “disconnected” config.
There are two issues with this approach though:
This is not yet implemented
Having a synced realm offline for a long time means that the realm file could greatly grow in size. An offline synced realm is still writing down the “history” of everything that is happening to the objects (so that it can be synced up when online again). This history could become quite big if the user doesn’t go online soon.
For those reason I still think that doing it manually is still the best option in your case.