Migrating from Realm Cloud to Mongodb Realm without losing offline data

Hello,

I am working on migrating my application from Realm Cloud to MongoDB Realm, as Realm Cloud will
close before the end of the year and I have a few questions about it:

  • During the migration, I will copy all the data from Realm Cloud to MongoDb, but how to be sure all users have synced their data to Realm Cloud ? If a user was offline last timed he used my application, data will not have been transferred to the Cloud and therefore they will not be on the new MongoDB server. Is there a way to know if all the data have been uploaded to Realm Cloud before performing the migration?

  • With Realm Cloud, local data is stored in a * .realm file. But what about MongoDB Realm ? Will it replace/delete the .realm file or will it create a new file ? If the .realm file still exists, I plan to transfer it on a storage server in case offline data was not synchronized during the migration, so I could always get them back.

  • MongoDB Realm sync is still in beta, when will it no longer be ? When Realm Cloud will be closed, will it work ? Do I have to wait before migrating? Because sync is essential for my app.

Thanking you for your help.

1 Like

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

Thanks for your feedback and all the details !
I have already made good progress on the migration, so I will do it as soon as everything is ready :slight_smile:

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.