Class

NSMigrationManager

A migration manager instance that performs a migration of data from one persistent store to another using a given mapping model.

Declaration

@interface NSMigrationManager : NSObject

Topics

Initializing a Manager

- initWithSourceModel:destinationModel:

Initializes a migration manager instance with given source and destination models.

Performing Migration Operations

- migrateStoreFromURL:type:options:withMappingModel:toDestinationURL:destinationType:destinationOptions:error:

Migrates the store at a given source URL to the store at a given destination URL, performing all of the mappings specified in a given mapping model.

- reset

Resets the association tables for the migration.

- cancelMigrationWithError:

Cancels the migration with a given error.

Monitoring Migration Progress

migrationProgress

A number between 0 and 1 that indicates the proportion of completeness of the migration.

currentEntityMapping

The entity mapping currently being processed.

Working with Source and Destination Instances

- associateSourceInstance:withDestinationInstance:forEntityMapping:

Associates a given source managed object instance with an array of destination instances for a given property mapping.

- destinationInstancesForEntityMappingNamed:sourceInstances:

Returns the managed object instances created in the destination store for the named entity mapping for the given array of source instances.

- sourceInstancesForEntityMappingNamed:destinationInstances:

Returns the managed object instances in the source store used to create the given destination instances for the passed in property mapping.

Getting Information About a Migration Manager

mappingModel

The mapping model for the migration manager.

sourceModel

The source model for the migration manager.

destinationModel

The destination model for the migration manager.

- sourceEntityForEntityMapping:

Returns the entity description for the source entity of a given entity mapping.

- destinationEntityForEntityMapping:

Returns the entity description for the destination entity of a given entity mapping.

sourceContext

The managed object context the migration manager uses for reading the source persistent store.

destinationContext

The managed object context the migration manager uses for writing the destination persistent store.

userInfo

The user info for the migration manager.

Using Store-Specific Migration Managers

usesStoreSpecificMigrationManager

A Boolean value that indicates whether the migration manager tries to use a store specific migration manager to perform the migration.

Relationships

Inherits From

See Also

Entity Mapping

NSMappingModel

A model instance that specifies how to map a model from a source to a destination managed object model.

NSEntityMapping

A mapping instance that specifies how to map an entity from a source to a destination managed object model.

NSEntityMigrationPolicy

A policy instance that customizes the migration process for an entity mapping.

NSEntityMappingType

Data type used for constants that specify types of entity mapping.

NSPropertyMapping

A mapping instance that specifies in a model how to map from a property in a source entity to a property in a destination entity.