As for the transition to SwiftData from Core Data with CloudKit enabled, there are a couple of considerations. You are already following the first one by using the replacePersistentStore method. Using migratePersistentStore will create duplicates in our data. The second one is the speculation that app might freeze during migration if iCloud is disabled. That is why you might want to turn off the sync while the migration is running.
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: