Skip to content

migrate-content snapshot does not handle linked items that don’t exist in source environments #150

@bwlng

Description

@bwlng

Brief bug description

When a content item contains a reference to another item that does not exist in the source environment, content snapshots fail.

The snapshot fails due to the error thrown in getMigrationElementToStore from migration-toolkit: https://github.com/kontent-ai/migration-toolkit/blob/d02256b3e1a4f437579a0e24c441e7c908b5578d/lib/export/export-manager.ts#L146-L160

Repro steps

  1. Via migration, create a content item with a value in a linked item field that does not exist
  2. Run migrate-content snapshot
  3. Snapshot creation fails when mapping items and assets
Failed to map value of element 'references' of type 'modular_content'. Value: [{"id":"71c3e029-2b14-5515-a8a5-d1b703fbbb15"}]. Message: Missing item with id '71c3e029-2b14-5515-a8a5-d1b703fbbb15'

Expected behavior

The sync tool should maintain the broken reference that is in the source environment and log

Screenshots

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions