Reference

Migration Tools

Use the console options below when running a source conversion. Events demonstrates a complete type-mapping listener for a bootstrapped module.

Console Options

Run commands from the Craft project directory. For example, php craft hyper/migrate/typed-link --step=content --dry-run=1 previews the Typed Link content step. The source-specific User Guides explain the required stages.

OptionBehaviour
--stepSelect a source’s field or content step, or all for its full sequence. Defaults to all. Typed Link also exposes a legacy step. Entrification has its own action without a field/content sequence.
--dry-run=1Preview supported field and content conversions without saving them. Typed Link’s legacy step is skipped without changing settings. Select --step=content to preview only content.
--sync-relations=1Synchronise Hyper’s relation index after content conversion. Enabled by default; 0 disables it.
--create-backup=1Create a database backup before a write operation. Defaults to the backupOnMigrate setting; 0 disables it.

Source action names are typed-link, linkit, link, craft-link and oembed. The category-to-entry action is entrify-categories.

Type Mapping

EVENT_MODIFY_LINK_TYPE supplies a verbb\hyper\events\ModifyMigrationLinkEvent. Read oldClass to identify the source type and set newClass to the destination Hyper class. Source identifiers may be strings such as entry rather than PHP class names.

SourceField MigrationContent Migration
Typed LinkMigrateTypedLinkFieldMigrateTypedLinkContent
LinkitMigrateLinkitFieldMigrateLinkitContent
Craft LinkMigrateCraftLinkFieldMigrateCraftLinkContent
Flipbox LinkMigrateLinkFieldMigrateLinkContent

These classes are in the verbb\hyper\migrations namespace. Register on both field and content classes when both stages need the mapping. Typed Link’s separate MigrateTypedLinkFieldLegacy step updates its old settings; it does not trigger this event.

This event selects the target type. It does not provide a general transformation of every field in the source payload. Use the Content API when you need an explicit raw-value conversion.