MigrationCallback not found

Hi, i need migrate a SYNC Realm, but in PartitionSyncConfiguration i have SchemaVersion and not found MigrationCallback to process documents need to Add Properties with value.
Using : Xamarin .Net SDK

Synchronized realms don’t allow local migrations because the data is inherently distributed and executing a migration does not guarantee that you won’t get data in the old format from other clients. Instead, refer to the Sync docs on how to update the schema of a synchronized Realm.

In this case i will need to verify in client when access existing documents new properties contain valid value and update then with value ?

It is better to do that with a trigger on the server rather than do it on the client. This is typically achieved by creating a partner collection with the new schema, then setting up database triggers that keep both collections in sync. You can refer to this guide on how to achieve it.

If you only want to add properties, then that’s a non-breaking change and can be done directly. If you need to populate the new properties with initial values or populate them with data based on other properties (e.g. FirstName and LastName are combined into a FullName property), then you can use backend triggers for that as well.

1 Like

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