Add a command to export all content of a particular entity type, with optional filtering by bundle

Created on 17 September 2025, about 1 month ago

Problem/Motivation

As we march towards better recipe authoring tools, the next logical step in having a good default content export system is the ability to export all content of a particular entity type and bundle.

Possible uses for this:

  • Let's say you make 10 sample blog posts in a site, and you want to export all of them into your blog recipe.
  • Or maybe you set up a megamenu with 30 links in it, and you want to export that entire menu in one fell swoop.
  • You want to export a collection of image media.

I'm sure we can think of others!

Proposed resolution

Core already has all of the necessary infrastructure for this. We just need an interface to do it.

Rather than overload the existing content:export command, which is focused around exporting a single entity (and its dependencies), I propose we add a new command for this, whose entire purpose is to export a batch of content.

  • To export all content: drupal content:export:all node --dir=content
  • ...of a particular bundle: drupal content:export:all node --bundle=blog --dir=my-blog

For now, let's require an entity type ID as an argument -- only one entity type at a time can be exported. Maybe in a follow-up we can expand that to automatically export all content, indiscriminately. But that feels like a separate scope.

Remaining tasks

Implement that, with some test coverage for both usage modes.

API changes

No API changes should be necessary. Combined with an entity query, core's default content exporter is already capable of this.

Release notes snippet

TBD

✨ Feature request
Status

Active

Version

11.0 πŸ”₯

Component

default content system

Created by

πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Pipeline finished with Success
    27 days ago
    Total: 724s
    #608023
  • Pipeline finished with Failed
    27 days ago
    Total: 107s
    #608051
  • Pipeline finished with Failed
    27 days ago
    Total: 550s
    #608055
  • Pipeline finished with Canceled
    27 days ago
    Total: 169s
    #608074
  • Pipeline finished with Success
    27 days ago
    Total: 821s
    #608076
  • Pipeline finished with Success
    27 days ago
    Total: 550s
    #608092
Production build 0.71.5 2024