Migration
Adopt the package field by field. Keep collection slugs, access control, collection hooks, versions, database adapters, and generated Payload types in their existing modules. This page targets 1.1.0; use the package changelog to identify version-specific changes from your installed release.
Incremental path
Section titled “Incremental path”- Identify duplicated intrinsic validation in a Payload field and Zod schema.
- Model only that data field with the nearest factory.
- Replace its Payload config with
entity.payload.field(key). - Derive one application schema from
entity.schema. - Compare Admin, REST, Local API, and existing data.
- Repeat after the first field is stable.
Use field.native for unsupported data-affecting fields. Leave layout fields outside the entity. Do not model populated relationship results as canonical relationship inputs.
Defaults migration
Section titled “Defaults migration”Move static Payload defaults to factory defaultValue and dynamic functions to dynamicDefaultValue. Remove payload.defaultValue. Confirm static defaults pass the canonical schema and remember that derived Zod schemas do not apply defaults.
Verification
Section titled “Verification”Run type tests, config boot, create/update through Local API, nested validation, and schema parsing. Check hook ordering where existing beforeValidate hooks transform values. Inspect each entity for schema-blocking native descendants.
Rollback
Section titled “Rollback”Keep the previous field configs until persistence shapes are proven equivalent. Replacing compiled fields with previous configs is safe only when normalization did not rewrite stored values. Back up data before introducing transforms. Never run old and new normalizers concurrently when they produce different canonical values.