Problem/Motivation

Part of #3582246: [meta] CLI in Core community initiative. Referenced from theCLI in Core Initiative spreadsheet.

Exporting configuration is important for deployment scenarios and site source control.

Steps to reproduce

Working on a Drupal Core CLI Command issue > Test Commands

Ensure that the configuration sync directory is setup in environment.

Export configuration as a zip file via the user interface, and extract to a different directory for comparison.

Export the configuration using dr config:export.

Do a diff between the YAML files from UI export and the CLI export to ensure there are no differences.

Make a change in the user interface.

Export the configuration using the CLI to ensure that change is exported to YAML.

Proposed resolution

Adds a configuration export command matching the output of the UI configuration export.

Remaining tasks

User interface changes

N/A

Introduced terminology

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

To be determined.

Issue fork drupal-3594337

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mradcliffe created an issue. See original summary.

mradcliffe’s picture

Update the parent to the "stable" meta, and added manual testing instructions.

bircher’s picture

Component: config.module » configuration system
Assigned: Unassigned » bircher

bircher’s picture

Status: Active » Needs review

The CI is now happy with it, I am happy with it. Needs review.

moshe weitzman made their first commit to this issue’s fork.

mradcliffe’s picture

The Drupal Contribution Mentoring team is triaging issues for DrupalCon Rotterdam 2026, and we are reserving this issue for Mentored Contribution during the event.

After October 3, this issue returns to being open to all. Thanks!

I performed Novice Triage on this issue. I am adding the Novice tag because I think there are several tasks that need to be done such as updating the Proposed resolution in the issue summary as well as anything else that may be missing in there such as manual testing instructions. It would also be a good opportunity to manually test config:export with dr. Anyone familiar with Console applications may also want to help review the merge request and PHPUnit tests.

Once the issue summary is updated, please remove the Needs issue summary update task.

jb044’s picture

I'm at drupalcon 2026 Rotterdam, today I will be working on this issue. @rikkert86 will be my mentor.

jb044’s picture

On a fresh drupal 12 install I did a `dr config:export`

ddev exec ./vendor/bin/dr config:export
 ------------ ------------------------------------------------------ ----------- 
  Collection   Config                                                 Operation  
 ------------ ------------------------------------------------------ ----------- 
               block_content.type.basic                               Create     
               core.date_format.fallback                              Create     
               core.date_format.html_date                             Create     
               core.date_format.html_datetime                         Create     
               core.date_format.html_month                            Create     
               core.date_format.html_time                             Create     
               core.date_format.html_week                             Create     
               core.date_format.html_year                             Create     
               core.date_format.html_yearless_date                    Create     
               core.date_format.long                                  Create     
               core.date_format.medium                                Create     
               core.date_format.short                                 Create     
               core.entity_view_mode.block_content.full               Create     
               core.extension                                         Create     
               core.menu.static_menu_link_overrides                   Create     
               dblog.settings                                         Create     
               block.block.default_admin_secondary_local_tasks        Create     
               block.block.default_admin_primary_local_tasks          Create     
               block.block.default_admin_page_title                   Create     
               block.block.default_admin_local_actions                Create     
               default_admin.settings                                 Create     
               file.settings                                          Create     
               filter.format.basic_html                               Create     
               editor.editor.basic_html                               Create     
               filter.format.full_html                                Create     
               editor.editor.full_html                                Create     
               filter.format.plain_text                               Create     
               filter.format.restricted_html                          Create     
               filter.settings                                        Create     
               block.block.default_admin_help                         Create     
               image.settings                                         Create     
               image.style.large                                      Create     
               image.style.medium                                     Create     
               image.style.thumbnail                                  Create     
               image.style.wide                                       Create     
               navigation.block_layout                                Create     
               navigation.settings                                    Create     
               core.entity_view_mode.node.teaser                      Create     
               core.entity_view_mode.node.rss                         Create     
               core.entity_view_mode.node.full                        Create     
               node.settings                                          Create     
               block.block.default_admin_messages                     Create     
               block.block.default_admin_content                      Create     
               block.block.default_admin_breadcrumbs                  Create     
               system.action.node_delete_action                       Create     
               system.action.node_make_sticky_action                  Create     
               system.action.node_make_unsticky_action                Create     
               system.action.node_promote_action                      Create     
               system.action.node_publish_action                      Create     
               system.action.node_save_action                         Create     
               system.action.node_unpromote_action                    Create     
               system.action.node_unpublish_action                    Create     
               system.advisories                                      Create     
               system.cron                                            Create     
               system.date                                            Create     
               system.diff                                            Create     
               system.feature_flags                                   Create     
               system.file                                            Create     
               system.image                                           Create     
               system.image.gd                                        Create     
               system.logging                                         Create     
               system.mail                                            Create     
               system.maintenance                                     Create     
               system.menu.account                                    Create     
               system.menu.admin                                      Create     
               system.menu.content                                    Create     
               system.menu.footer                                     Create     
               system.menu.main                                       Create     
               system.menu.navigation-user-links                      Create     
               system.menu.tools                                      Create     
               system.performance                                     Create     
               system.site                                            Create     
               system.theme                                           Create     
               system.theme.global                                    Create     
               system.action.taxonomy_term_unpublish_action           Create     
               system.action.taxonomy_term_publish_action             Create     
               core.entity_view_mode.taxonomy_term.full               Create     
               taxonomy.settings                                      Create     
               field.storage.block_content.body                       Create     
               field.field.block_content.basic.body                   Create     
               core.entity_view_display.block_content.basic.default   Create     
               core.entity_form_display.block_content.basic.default   Create     
               text.settings                                          Create     
               system.action.user_unblock_user_action                 Create     
               system.action.user_cancel_user_action                  Create     
               system.action.user_block_user_action                   Create     
               field.storage.user.user_picture                        Create     
               field.field.user.user.user_picture                     Create     
               core.entity_view_mode.user.full                        Create     
               core.entity_view_mode.user.compact                     Create     
               core.entity_view_display.user.user.default             Create     
               core.entity_view_display.user.user.compact             Create     
               core.entity_form_mode.user.register                    Create     
               core.entity_form_display.user.user.default             Create     
               block.block.default_admin_login                        Create     
               user.flood                                             Create     
               user.mail                                              Create     
               user.role.administrator                                Create     
               system.action.user_remove_role_action.administrator    Create     
               system.action.user_add_role_action.administrator       Create     
               user.role.anonymous                                    Create     
               user.role.authenticated                                Create     
               user.role.content_editor                               Create     
               system.action.user_remove_role_action.content_editor   Create     
               system.action.user_add_role_action.content_editor      Create     
               user.settings                                          Create     
               language.entity.nl                                     Create     
               views.settings                                         Create     
               language.entity.und                                    Create     
               views.view.block_content                               Create     
               language.entity.zxx                                    Create     
               views.view.content                                     Create     
               language.mappings                                      Create     
               views.view.files                                       Create     
               language.negotiation                                   Create     
               views.view.promoted_content                            Create     
               language.types                                         Create     
               views.view.taxonomy_term                               Create     
               views.view.user_admin_people                           Create     
               announcements_feed.settings                            Create     
               automated_cron.settings                                Create     
               field_ui.settings                                      Create     
               language.content_settings.path_alias.path_alias        Create     
               locale.settings                                        Create     
               menu_ui.settings                                       Create     
               update.settings                                        Create     
               views.view.watchdog                                    Create     
 ------------ ------------------------------------------------------ ----------- 


 Do you want to export the configuration? (yes/no) [yes]:
 > yes

 [OK] Configuration successfully exported
      

Next I did a tradiional config export through the UI and downloaded the config export tarball. I then did a comparison on the yamls exported with `dr config:export` and the the expanded tarball, the only difference was in the created .htaccess in sites/default/files/sync, which is to be expexted.

Then I did a config change, I added 'config change' to the site name. And then ran `dr config:export` again.

grep 'config change' sites/default/files/sync/system.site.yml
name: 'Drupalcon 2026 config change'

So from a functional perspective this MR looks just fine.

jb044’s picture

Status: Needs review » Reviewed & tested by the community
mradcliffe’s picture

Issue summary: View changes
Issue tags: -Needs issue summary update

Thank you for manual testing the module. I think this is RTBC.

I went ahead and added a proposed resolution.

bircher’s picture

I approve of the changes by moshe and second the RTBC.