drewmccormack / ensembles

A synchronization framework for Core Data.
MIT License
1.63k stars 132 forks source link

Switching users from iCloud to CloudKit #239

Closed basebander closed 7 years ago

basebander commented 7 years ago

Hello!

I have a production app that has users using Ensembles with iCloud and am looking into the possibility of switching them over to CloudKit for increased reliability.

What is the best way to go about this? Am I correct in thinking that the user should be manually presented the option to convert to CloudKit in case they have existing ensembles data stored in iCloud? If the user chooses to switch to CloudKit, should it just be deleeched and the ensemble set back up with the new backend? Are there any special things that need to be done before hand?

drewmccormack commented 7 years ago

That is certainly one way to do it, yes. You could ask users if they want to switch. The main reason to do that is that you could warn them that they need to migrate all their devices over to the new system, otherwise they won't sync with each other.

As you say, if they choose to go across, just deleech, and leech again with the new backend.

That will clean up the local cache of data, but will leave the sync data in iCloud. If you app only has a little data, you could leave it there. If you have a lot of data, you probably want to remove that too. There is a class method on CDEPersistentStoreEnsemble for removing the data of a given ensemble (+remove...). You could use that to clear the cloud data if you like. You could choose to do that a week or two after the user switches, so that there are not little problems with other devices seeing the data has gone missing.

basebander commented 7 years ago

Great, thank you!