Well, here is what I ended up doing - for better or worse:
- Open the new UIManagedDocument.
- Open up the legacy Core Data Model.
- Copy each audio file (NSData) from Legacy CoreData Context to the UIManagedDocument Context.
Reconnect all relationships based on the Legacy CoreData Context.
NSManagedObjectContext *legacyMOC = [[NSManagedObjectContext alloc]init]; [legacyMOC setPersistentStoreCoordinator:psc]; //fetch all audio recordings from legacyStore NSArray *legacyRecordingArray = [self fetchAudioRecordingsfrom:legacyMOC]; //fetch all audio recordings form UIMDStore NSArray *uimdRecordingArray = [self fetchAudioRecordingsfrom:self.managedObjectContext]; //for each audio recording, copy the audio object from legacy and save it to UIMDStore for (int i = 0; i < legacyRecordingArray.count; i++) { //save audio to core data RunningRecord *legacyRR = (RunningRecord *)legacyRecordingArray[i]; RunningRecord *uimdRR = (RunningRecord *)uimdRecordingArray[i]; uimdRR.audioData = [NSData dataWithData:legacyRR.audio.file]; uimdRR.audio.file = nil; } if (![self.managedObjectContext save:&error]) { NSLog(@"Whoops, couldn't save: %@", [error localizedDescription]); }