<!--
{
  "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/NSMigratePersistentStoresAutomaticallyOption",
  "metadataVersion" : "0.1.0",
  "role" : "Global Variable",
  "symbol" : {
    "kind" : "Global Variable",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:@NSMigratePersistentStoresAutomaticallyOption"
  },
  "title" : "NSMigratePersistentStoresAutomaticallyOption"
}
-->

# NSMigratePersistentStoresAutomaticallyOption

Key to automatically attempt to migrate versioned stores.

```
let NSMigratePersistentStoresAutomaticallyOption: String
```

## Discussion

The corresponding value is an `NSNumber` object. If the <doc://com.apple.documentation/documentation/Foundation/NSNumber/boolValue> of the number is <doc://com.apple.documentation/documentation/Swift/true> and if the version hash information for the added store is determined to be incompatible with the model for the coordinator, Core Data will attempt to locate the source and mapping models in the application bundles, and perform a migration.

---

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)