diff --git a/src/Drupal/Commands/config/ConfigExportCommands.php b/src/Drupal/Commands/config/ConfigExportCommands.php index 1a75c97db3..5d3438cc26 100644 --- a/src/Drupal/Commands/config/ConfigExportCommands.php +++ b/src/Drupal/Commands/config/ConfigExportCommands.php @@ -135,6 +135,12 @@ public function doExport($options, $destination_dir) } // Only delete .yml files, and not .htaccess or .git. $target_storage->deleteAll(); + + // Also delete collections. + foreach ($target_storage->getAllCollectionNames() as $collection_name) { + $target_collection = $target_storage->createCollection($collection_name); + $target_collection->deleteAll(); + } } // Write all .yml files.