I have a live app on App Store which uses SQLite as database, now with the next update I want to implement Core Data in App loading all data from .sqlite file without breaking the App. I have been reading tutorials but it didn’t help much. I don't know how to proceed. Please, point me in right direction.
I think @SaintThread hit the main issue here. The reason for it is that Core Data is not a wrapper around SQLite-- it's a different API with different assumptions that just happens to use SQLite internally. Core Data doesn't attempt to be compatible with how you'd use SQLite if you were using SQLite on its own.
That said, if you still want to migrate, you'll have to design a Core Data model and then write fully custom code to migrate from your existing SQLite file to Core Data. Your code would need to read everything from SQLite, convert it to the new Core Data representation, save the changes, and then remove the existing SQLite files.
When removing the existing SQLite file, make sure to also remove the SQLite journal files (if any).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With