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 entity. From my understanding and reading, this is one of the most simple migrations that can occur. There are no field deletions, and no relationships to change. The data model consists of 5 entities with no relationships at all.
We have versioned the data model, and created an .xcmappingmodel to handle the migration. We are handling the migration by adding the following options to the creation of the PersistentStoreCoordinator:
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption, nil];
Currently, we have tested successfully with several members of the team using the following process:
My question is this: Is there an easier/better way to test this? Our concern is that once the app goes out the door, there is no other way to ensure our users have the best experience possible.
Application migration testing compares the migrated application with your legacy application to uncover discrepancies or errors. The goal is to ensure legacy data transfers over to the new application with minimal downtime or disruption with all essential data and functions intact.
Migrations happen in three steps: First, Core Data copies over all the objects from one data store to the next. Next, Core Data connects and relates all the objects according to the relationship mapping. Finally, enforce any data validations in the destination model.
What is Migration Testing? Migration Testing is a verification process of migration of the legacy system to the new system with minimal disruption/downtime, with data integrity and no loss of data, while ensuring that all the specified functional and non-functional aspects of the application are met post-migration.
I've been using Core Data
for my app and upgraded about 7 times, migrating from old models to new models.
Whenever, I am prepared to release the next version, I always test migration by using Model Mapping
. As long as I made every entity and attribute of source model is matched against corresponding
entity and attribute of destination model, I've experienced no problem.
Testing with your own project files are just as same as testing released ones that are distributed to the customers, so you don't have to worry if your test for migrating old model to new model is valid.
In other words, your project bundle's target, which is going to be archived and submitted, is same as what's being downloaded by the customer.
I'm pretty confident this is the case, since I've done testing with different versions of my app with no problem.
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