Questions tagged [core-data-migration]

for issues related to Migration of CoreData on OS X systems

553 questions
85
votes
3 answers

Example or explanation of Core Data Migration with multiple passes?

My iPhone app needs to migrate its core data store, and some of the databases are quite large. Apple's documentation suggests using "multiple passes" to migrate data to reduce memory use. However, the documentation is very limited and doesn't…
Jason
  • 14,035
  • 24
  • 87
  • 151
64
votes
9 answers

iPhone Core Data "Automatic Lightweight Migration"

I am attempting to update an app that implements a core data store. I am adding an attribute to one of the entities. I added the following code to my delegate class: - (NSPersistentStoreCoordinator *)persistentStoreCoordinator { if…
Eric
  • 1,329
  • 1
  • 13
  • 19
32
votes
2 answers

CoreData crash error Xcode 11 Beta, IOS 13 Beta

Im trying building my application from Xcode11 beta on phone IOS 13 Beta. I have crash when application loading. 2019-07-22 13:58:12.910460+0300 GoodWine[3738:792501] [error] fault: One or more models in this application are using transformable …
27
votes
2 answers

How do I set default values on new properties for existing entities after light weight core data migration?

I've successfully completed light weight migration on my core data model. My custom entity Vehicle received a new property 'tirePressure' which is an optional property of type double with the default value 0.00. When 'old' Vehicles are fetched from…
Moritz
  • 2,895
  • 21
  • 16
25
votes
3 answers

Detecting a Lightweight Core Data Migration

I'm using Core Data's automatic lightweight migration successfully. However, when a particular entity gets created during a migration, I'd like to populate it with some data. Of course I could check if the entity is empty every time the application…
hadronzoo
  • 1,676
  • 1
  • 15
  • 17
21
votes
6 answers

Core Data & Xcode 11: Please switch to using "NSSecureUnarchiveFromData" or a subclass of NSSecureUnarchiveFromDataTransformer

Just moved to Xcode 11 and getting the following crash at launch: CoreData: fault: One or more models in this application are using transformable properties with transformer names that are either unset, or set to…
user1107173
  • 8,798
  • 14
  • 64
  • 105
20
votes
4 answers

"Can't find model for source store" occurring during iphone "Automatic Lightweight Migration"?

I'm really stuck here with upgrade testing from v1 to v2 of an iPhone application. I have IPA releases that I'm testing via ad hoc distribution via iTunes to my iPhone device, one for v1 of the app and one for v2. Note that: v1 installs runs…
Greg
  • 31,898
  • 75
  • 232
  • 424
20
votes
3 answers

Core Data - mixing lightweight and custom migration

So I have version 1 of my Core Data app in the App Store and now I started working on version 2. I have some small changes to my data base model, and some custom code I need to run after those changes to complete the upgrade from version 1 to…
Eyal
  • 10,429
  • 18
  • 73
  • 127
18
votes
2 answers

How can I unit test a Core Data migration?

I'm building a mapping model for my migration with a custom entity migration policy, and I'd really like to build some unit tests for this migration. The migration seems to work correctly when I run the app, but my NSEntityMigrationPolicy subclass…
Greg
  • 9,304
  • 5
  • 39
  • 62
17
votes
4 answers

Core Data - lightweight migrations and multiple core data model files (xcdatamodel)

I'm having a problem performing a lightweight migration when migrating from a store that is defined by two separate xcdatamodel files. In version 1.0 of my app, I had the models broken out into an analytics model, model-A, and everything else in…
Mark
  • 6,416
  • 6
  • 41
  • 83
13
votes
1 answer

Multiple Pass Core Data Migration In Chunks With iOS

I'm trying to migrate an iPhone/iPad sqlite store of about 11Mb. It has around thirty different entities, all quite heavily interrelated. On a 3GS, it takes quite some time. Even a lightweight migration takes around four minutes. I guess this is…
Max MacLeod
  • 24,338
  • 10
  • 91
  • 123
13
votes
4 answers

Renaming coredata .xcdatamodeld file and migration

We had a 2 separated apps that we have merged to 2 targets in the same workspace. Both had their core data model (app1.xcdatamodeld and app2.xcdatamodeld). Now that both are in the same workspace there is no need for 2 models as they are 99%…
shannoga
  • 19,000
  • 20
  • 99
  • 163
12
votes
2 answers

Core Data Migration: How to delete the Core Data stack?

My plan is to delete the old Core Data stack (the NSManagedObjectModel .momd file & the NSPersistentStore .sqlite file) because: I don't have experience with Core Data migrations. the new .xcdatamodel schema is completely different than the old…
ma11hew28
  • 106,283
  • 107
  • 420
  • 616
12
votes
6 answers

Custom code execution after light weight migration of particular version

I have 2 object models in Core Data (say v1 and v2). This migration is eligible for light weight migration. Now, I want to execute custom code after the migration but only when the migration is from v1 to v2. Later on if I introduce v3, I don't want…
Anupam Godbole
  • 366
  • 2
  • 12
12
votes
2 answers

How to Test Core Data Migration With an App Already in the App Store?

We have an app that is currently in the app store. It uses Core Data as its persistence mechanism. We have a new version ready to go, and it has some schema changes. Specifically, we have added 1 new entity and added a new attribute to an existing…
Mark Struzinski
  • 31,745
  • 33
  • 103
  • 135
1
2 3
36 37