realm-kotlin icon indicating copy to clipboard operation
realm-kotlin copied to clipboard

UPDATE instruction had incorrect partition value for key "_partition" { expectedPartition: xxx, foundPartition: (ProtocolErrorCode=212)

Open CavalcanteLeo opened this issue 3 years ago • 2 comments

Hi everyone, somehow my app has saved some wrong partition for some users, but we can't lose all those data with wrong partitions.

When the app tries to sync the data, it gets an error:

UPDATE instruction had incorrect partition value for key "_partition" { expectedPartition: xxx, foundPartition: (ProtocolErrorCode=212)

But some partitions are correctly and already on server.

How can i update the partition on a local data and sync it to server?

CavalcanteLeo avatar Sep 20 '22 19:09 CavalcanteLeo

Screen Shot 2022-09-20 at 16 28 16

CavalcanteLeo avatar Sep 20 '22 19:09 CavalcanteLeo

I am afraid you cannot just update the partition key. You would need to move the data manually from the wrong partitioned Realm to a Realm with the right partition key.

To do so, you will need to:

  • create two different SyncConfigurations each with a partition key
  • open a Realm instance on each configuration
  • copy the data

clementetb avatar Sep 21 '22 09:09 clementetb

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

github-actions[bot] avatar Jan 11 '23 00:01 github-actions[bot]