I'm using Core Data in my app and would like to export only some of the data and import it on some other device.
To avoid migration issues, I'd like to do the following:
Export:
- create a second export.sqlite-file with the same database model, but empty
- add that file with addPersistentStoreWithType
- copy some ManagedObjects over to that .sqlite
- remove the added persistent store
Import: - copy export.sqlite-file into app - add that .sqlite-file with addPersistentStoreWithType - copy data over - remove added persistentStore
but how to achieve that? i.e. how can I tell my managed object so copy itself into the other store?