---
title: "MigrationStage.custom(fromVersion:toVersion:willMigrate:didMigrate:)"
framework: swiftdata
role: symbol
role_heading: Case
path: "swiftdata/migrationstage/custom(fromversion:toversion:willmigrate:didmigrate:)"
---

# MigrationStage.custom(fromVersion:toVersion:willMigrate:didMigrate:)

## Declaration

```swift
@preconcurrency case custom(fromVersion: any VersionedSchema.Type, toVersion: any VersionedSchema.Type, willMigrate: (@Sendable (ModelContext) throws -> Void)?, didMigrate: (@Sendable (ModelContext) throws -> Void)?)
```

## See Also

### Migration stages

- [MigrationStage.lightweight(fromVersion:toVersion:)](swiftdata/migrationstage/lightweight(fromversion:toversion:).md)
