Skip to content

Conversation

@flipswitchingmonkey
Copy link

@flipswitchingmonkey flipswitchingmonkey commented Oct 6, 2025

This PR adds a number of flags to the extract command.

  • --skipCollectionFiles: do not extract the directus_files collection
  • --skipDownloadFiles: do not download the actual file attachments
  • --syncExtractContent: extract content collections in a serial manner to limit load on instance
  • --limitContentCollections "articles,something_else": only extract named content collections

Motivation

We have a few very underpowered instances running Directus in a Kubernetes context, with a limit on CPU usage. Some of these have large collections, for example large amounts of image files. Running the template extract will cause the CPU load on these instances to spike over a long time, causing them to crash eventually (either by running out of RAM or by being forcibly stopped by Kubernetes).

To make the template CLI usable without crashing the instances, we had to disable all file related extractions. Thus, these added flags.

Possible Issues

By selectively extracting collections or files, there is a real danger of breaking relations if other collections point to these missing entries. Managing these issues is the responsibility of the user - since these flags are only to be used in specific use cases, it is assumed that the user knows what he or she does...

Edit: just noticed that a similar PR exists. Oh well...

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

Successfully merging this pull request may close these issues.

1 participant