Upgrading Realm databases created in .NET

Viewed 72

I have been using Realm for a while now in a WPF app using Costura. https://blog.jonstodle.com/using-realm-with-fody-costura/

Everything is working fine, but when I try to open a database file created in .NET, I am presented with this message. I've updated all my nuget packages, as well as the realm-wrapper files in the costura directories. It occurs with old, existing databases as well as newly created ones.

Is there some sort of migration I can perform to update existing databases as well as create databases in this new format from now on?

Message on opening the database file in Realm Studio

1 Answers

Yes there is, when it comes to realm there are two things you can do:

  1. Delete the old db file and create a new one

  2. Use migrations. Migration in realm is seperated into two different parts

    • Schema versioning automatic migration
    • Schema versioning custom migration

There is alot to cover about these two subjects and it will be too long for this post. You will havae a better time reading it at realm swift guide part 6.

Related