# Error in migration from v3 to v4 (Custom migration Policy)

**URL:** <https://forums.kodeco.com/t/error-in-migration-from-v3-to-v4-custom-migration-policy/110425>\
**Category:** Core Data by Tutorials\
**Created:** [May 28, 2020, 12:16pm UTC](https://forums.kodeco.com/t/error-in-migration-from-v3-to-v4-custom-migration-policy/110425 "2020-05-28T12:16:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alokc83](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/alokc83/32/107886_2.png) [@alokc83](https://forums.kodeco.com/u/alokc83)\
**Post date:** [May 28, 2020, 12:16pm UTC](https://forums.kodeco.com/t/error-in-migration-from-v3-to-v4-custom-migration-policy/110425/1 "2020-05-28T12:16:46Z")

</div>

I am getting this. Even though I can see where might be.  
I am not able to fix it. I would need little help to get over this hump. I have tried, redoing everything and still running into this, Any help?

```
**CoreData: warning: no NSValueTransformer with class name 'ImageTransformer' was found for attribute 'image' on entity 'ImageAttachment'**

**2020-05-26 18:30:50.240603-0500 UnCloudNotes[4250:11852422] [error] error: -addPersistentStoreWithType:SQLite configuration:(null) URL:file:///Users/achoudhary/Library/Developer/CoreSimulator/Devices/AD161A8F-E227-4828-BD4B-FFCA8DAE84F6/data/Containers/Data/Application/69C4DB1C-D437-4DC9-BC54-9BCB31BF8F01/Library/Application%20Support/UnCloudNotesDataModel.sqlite options:{**

**NSInferMappingModelAutomaticallyOption = 0;**

**NSMigratePersistentStoresAutomaticallyOption = 1;**

**} ... returned error NSCocoaErrorDomain(134110) with userInfo dictionary {**

**NSUnderlyingException = "Couldn't create mapping policy for class named (AttachmentToImageMigrationPolicyV3toV4)";**

**}**

**CoreData: error: -addPersistentStoreWithType:SQLite configuration:(null) URL:file:///Users/achoudhary/Library/Developer/CoreSimulator/Devices/AD161A8F-E227-4828-BD4B-FFCA8DAE84F6/data/Containers/Data/Application/69C4DB1C-D437-4DC9-BC54-9BCB31BF8F01/Library/Application%20Support/UnCloudNotesDataModel.sqlite options:{**

**NSInferMappingModelAutomaticallyOption = 0;**

**NSMigratePersistentStoresAutomaticallyOption = 1;**

**} ... returned error NSCocoaErrorDomain(134110) with userInfo dictionary {**

**NSUnderlyingException = "Couldn't create mapping policy for class named (AttachmentToImageMigrationPolicyV3toV4)";**

**}**

**CoreData: annotation: <NSPersistentStoreCoordinator: 0x600000844d00>: Attempting recovery from error encountered during addPersistentStore: Error Domain=NSCocoaErrorDomain Code=134110 "An error occurred during persistent store migration." UserInfo={NSUnderlyingException=Couldn't create mapping policy for class named (AttachmentToImageMigrationPolicyV3toV4)}**

**Fatal error: Unresolved error Error Domain=NSCocoaErrorDomain Code=134110 "An error occurred during persistent store migration." UserInfo={NSUnderlyingException=Couldn't create mapping policy for class named (AttachmentToImageMigrationPolicyV3toV4)}: file /Users/achoudhary/Documents/edu.self/RW/Core_Data_by_Tutorials_v6.0.0/06-versioning-and-migration/starter/UnCloudNotes/CoreDataStack.swift, line 81**

**2020-05-26 18:30:50.244532-0500 UnCloudNotes[4250:11852422] Fatal error: Unresolved error Error Domain=NSCocoaErrorDomain Code=134110 "An error occurred during persistent store migration." UserInfo={NSUnderlyingException=Couldn't create mapping policy for class named (AttachmentToImageMigrationPolicyV3toV4)}: file /Users/achoudhary/Documents/edu.self/RW/Core_Data_by_Tutorials_v6.0.0/06-versioning-and-migration/starter/UnCloudNotes/CoreDataStack.swift, line 81**

```

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [July 7, 2020, 12:46am UTC](https://forums.kodeco.com/t/error-in-migration-from-v3-to-v4-custom-migration-policy/110425/2 "2020-07-07T00:46:39Z")

</div>

@alokc83 Please check out the updated version of the book:

[https://store.raywenderlich.com/products/core-data-by-tutorials](https://store.raywenderlich.com/products/core-data-by-tutorials)

I hope it helps!

---

<div class="post-metadata">

**Author:** ![system](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@system](https://forums.kodeco.com/u/system)\
**Post date:** [November 11, 2020, 4:16am UTC](https://forums.kodeco.com/t/error-in-migration-from-v3-to-v4-custom-migration-policy/110425/3 "2020-11-11T04:16:49Z")

</div>

This topic was automatically closed after 166 days. New replies are no longer allowed.
