Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
andonimihai opened this issue Sep 20, 2023 · 0 comments

Comments

@andonimihai
Copy link

andonimihai commented Sep 20, 2023

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant