Reputation: 17329
How can I backup my core data objects created in version 1 and restore them in version 2? Simply copy the .sqlite-file won't work if the model changes... Is there a way to backup the file restore it and then start the migration?
Upvotes: 1
Views: 730
Reputation: 17329
Thanks a lot for your suggestions!
Solved it with MagicalRecord the following way:
[MagicalRecord cleanUp];
[MagicalRecord setupCoreDataStackWithAutoMigratingSqliteStoreNamed:sqliteFileName];
finished - works perfect!
Upvotes: 1
Reputation: 86067
You need to migrate your database using Automatic Lightweight Migration.
iPhone Core Data "Automatic Lightweight Migration"
Upvotes: 0