Core Data provides an architecture to support versioning of managed object models and migration of data from one version to another.
You should read this document if you are an experienced Core Data developer and want to learn how to support versioning in your application.
Important: This document assumes that you are familiar with the Core Data architecture and the fundamentals of using Core Data. You should be able to identify the parts of the Core Data stack and understand the roles of the model, the managed object context, and the persistent store coordinator. You need to know how to create a managed object model, how to create and programmatically interact with parts of the Core Data stack.
If you do not meet these requirements, you should first read the Core Data Programming Guide and related materials. You are strongly encouraged also to work through the Core Data Utility Tutorial.
This document contains the following articles:
“Basic Concepts” describes the fundamental ideas behind versioning and migration, and outlines the support Core Data provides for these processes.
“Versioning” describes what is meant by a “version” of a managed object model.
“Lightweight Migration” describes how you can easily migrate data using just a versioned managed object model.
“Mapping Overview” describes the mapping model.
“The Migration Process” describes the process of migrating data, including the three stages of migration.
“Initiating the Migration Process” describes how you start the migration process, and how the default migration process proceeds.
“Customizing the Migration Process” describes how you can customize the migration process—that is, how you programmatically determine whether migration is necessary; how you find the correct source and destination models and the appropriate mapping model to initialize the migration manager; and then how you perform the migration.
You only customize the migration process if you want to initiate migration yourself. You might do this to, for example, search locations other than the application’s main bundle for models or to deal with large data sets by performing the migration in several passes using different mapping models.
Last updated: 2010-02-24