---
title: "init(sourceModel:destinationModel:)"
framework: coredata
role: symbol
role_heading: Initializer
path: "coredata/nsmigrationmanager/init(sourcemodel:destinationmodel:)"
---

# init(sourceModel:destinationModel:)

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

## Declaration

```swift
init(sourceModel: NSManagedObjectModel, destinationModel: NSManagedObjectModel)
```

## Parameters

- `sourceModel`: The source managed object model for the migration manager.
- `destinationModel`: The destination managed object model for the migration manager.

## Return Value

Return Value A migration manager instance initialized to migrate data in a store that uses sourceModel to a store that uses destinationModel.

## Discussion

Discussion You specify the mapping model in the migration method,  migrateStore(from:sourceType:options:with:toDestinationURL:destinationType:destinationOptions:). Special Considerations This is the designated initializer for NSMigrationManager. Although validation of the models is performed during migrateStore(from:sourceType:options:with:toDestinationURL:destinationType:destinationOptions:), as with NSPersistentStoreCoordinator once models are added to the migration manager they are immutable and cannot be altered.

## See Also

### Related Documentation

- [destinationModel](coredata/nsmigrationmanager/destinationmodel.md)
- [mappingModel](coredata/nsmigrationmanager/mappingmodel.md)
- [sourceModel](coredata/nsmigrationmanager/sourcemodel.md)
- [migrateStore(from:sourceType:options:with:toDestinationURL:destinationType:destinationOptions:)](coredata/nsmigrationmanager/migratestore(from:sourcetype:options:with:todestinationurl:destinationtype:destinationoptions:).md)
- [Core Data Model Versioning and Data Migration Programming Guide](apple-archive/documentation/Cocoa/Conceptual/CoreDataVersioning/Articles/Introduction.html.md)
