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
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
Comment #2
mradcliffeUpdate the parent to the "stable" meta, and added manual testing instructions.
Comment #3
bircherComment #5
bircherThe CI is now happy with it, I am happy with it. Needs review.
Comment #7
mradcliffeThe 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:exportwithdr. 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.
Comment #8
jb044I'm at drupalcon 2026 Rotterdam, today I will be working on this issue. @rikkert86 will be my mentor.
Comment #9
jb044On a fresh drupal 12 install I did a `dr config:export`
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.
So from a functional perspective this MR looks just fine.
Comment #10
jb044Comment #11
mradcliffeThank you for manual testing the module. I think this is RTBC.
I went ahead and added a proposed resolution.
Comment #12
bircherI approve of the changes by moshe and second the RTBC.