<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreData",
  "identifier" : "/documentation/CoreData/NSMigrationManager",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:objc(cs)NSMigrationManager"
  },
  "title" : "NSMigrationManager"
}
-->

# NSMigrationManager

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

```
class NSMigrationManager
```

## Topics

### Creating a Migration Manager

[`init(sourceModel:destinationModel:)`](/documentation/CoreData/NSMigrationManager/init(sourceModel:destinationModel:))

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

### Getting the Manager’s Configuration

[`destinationContext`](/documentation/CoreData/NSMigrationManager/destinationContext)

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

[`destinationModel`](/documentation/CoreData/NSMigrationManager/destinationModel)

The destination model for the migration manager.

[`mappingModel`](/documentation/CoreData/NSMigrationManager/mappingModel)

The mapping model for the migration manager.

[`sourceContext`](/documentation/CoreData/NSMigrationManager/sourceContext)

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

[`sourceModel`](/documentation/CoreData/NSMigrationManager/sourceModel)

The source model for the migration manager.

[`destinationEntity(for:)`](/documentation/CoreData/NSMigrationManager/destinationEntity(for:))

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

[`sourceEntity(for:)`](/documentation/CoreData/NSMigrationManager/sourceEntity(for:))

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

### Customizing the Manager

[`userInfo`](/documentation/CoreData/NSMigrationManager/userInfo)

The user info for the migration manager.

[`usesStoreSpecificMigrationManager`](/documentation/CoreData/NSMigrationManager/usesStoreSpecificMigrationManager)

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

### Managing Sources and Destinations

[`associate(sourceInstance:withDestinationInstance:for:)`](/documentation/CoreData/NSMigrationManager/associate(sourceInstance:withDestinationInstance:for:))

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

[`destinationInstances(forEntityMappingName:sourceInstances:)`](/documentation/CoreData/NSMigrationManager/destinationInstances(forEntityMappingName:sourceInstances:))

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

[`sourceInstances(forEntityMappingName:destinationInstances:)`](/documentation/CoreData/NSMigrationManager/sourceInstances(forEntityMappingName:destinationInstances:))

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

### Performing a Migration

[`migrateStore(from:type:options:mapping:to:type:options:)`](/documentation/CoreData/NSMigrationManager/migrateStore(from:type:options:mapping:to:type:options:))

Migrates the source store to the destination using the specified mapping model.

[`migrateStore(from:sourceType:options:with:toDestinationURL:destinationType:destinationOptions:)`](/documentation/CoreData/NSMigrationManager/migrateStore(from:sourceType:options:with:toDestinationURL:destinationType:destinationOptions:))

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.

### Monitoring a Migration’s Progress

[`migrationProgress`](/documentation/CoreData/NSMigrationManager/migrationProgress)

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

[`currentEntityMapping`](/documentation/CoreData/NSMigrationManager/currentEntityMapping)

The entity mapping currently being processed.

### Aborting a Migration

[`cancelMigrationWithError(_:)`](/documentation/CoreData/NSMigrationManager/cancelMigrationWithError(_:))

Cancels the migration with a given error.

[`reset()`](/documentation/CoreData/NSMigrationManager/reset())

Resets the association tables for the migration.

### Deprecated

[Deprecated Symbols](/documentation/CoreData/nsmigrationmanager-deprecated-symbols)

Review unsupported symbols and their replacements.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)