Skip to content

[Discussion] Improve performance for updateReferences in a transformEntriesToType migration #1250

@andonimihai

Description

@andonimihai

Expected Behavior

When using updateReferences in a transformEntriesToType migration, i would love to have API calls only for the entries that should be affected.

Actual Behavior

In a transformEntriesToType migration, when using the updateReferences, it fetches all the available entries in the space. While this could work for smaller entry amounts, when there are like 60k+, it takes forever.
(source: https://github.com/contentful/contentful-migration/blob/master/src/lib/fetcher.ts#L14, https://github.com/contentful/contentful-migration/blob/master/src/lib/intent/entry-transform-to-type.ts#L50)

Possible Solution

For each entry that requires to have references updated, use the rest API to fetch only the entries where the current entry is referenced, and update them.

Context

The migrations are running very slow when there are a lot of entries(even though it should migrate 200 entries from 60k)

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