Migrating from Realm Cloud to Mongodb Realm without losing offline data

There is not. If a user was working offline the last time the used the app, that data would not have been sync’d but there’s no way to know that, unless you accounted for it programmatically in some way.

Several parts to that question.

  • MongoDB Realm uses partitions to store it’s data in ‘Realms’, each partition will be a different local realm File. For example an Object whose partition key (a Realm in MongoDB Realm) is Task Tracker will have a local file name of %22Task%20Tracker%22 . Additionally the path to the file stored on the device will be different.
  • It will not delete the existing *.realm file as new files are created to handle the new realm partitions

A Mongo employee can address those questions but you should begin the migration now and not wait.

Keep in mind that there are a number of differences between Realm Cloud and MongoDB Realm, including adding _id and partition properties to you objects. There’s a whole thread on the process that you should definitely review. See Migrating from Legacy Realm Sync to MongoDB Realm Guide

2 Likes