How do I correctly inform the system about my module's new config? I'm working on a module that already comes with a config file in mymodule/config/install/mymodule.settings.yml, and I'm working on a new feature that requires its own set of configuration in mymodule/config/install/mymodule.newfeature.yml.

I assume I need to put the following code in an update hook.

function mymodule_update_8003() {
  \Drupal::service('config.installer')-&gt;installDefaultConfig('module', 'mymodule');
}


But if I do this, will sites that have overridden my existing configuration (from mymodule.settings.yml) get hosed, or is there another way to tell Drupal about my new configuration?
I think I found a strategy that is only slightly hackish to let Drupal know that your module has created a new config. This solution assumes that your new config is in a separate yml file in yourmodule/config/install but it should be adaptable to a situation where you are adding a new config to an existing file....

/**
 * Install new config.
 */
function your_module_update_8003() {
  // Get all current configs for Your Module.
  $existing_settings_config = \Drupal::configFactory()-&gt;getEditable('your_module.settings');
  $existing_foo_config = \Drupal::configFactory()-&gt;getEditable('your_module.foo');
  $existing_bar_config = \Drupal::configFactory()-&gt;getEditable('your_module.bar');

  // Install the new configuration 
  // (a new file was added a your_module/config/install/your_module.baz.yml)
  \Drupal::service('config.installer')
    -&gt;installDefaultConfig('module', 'your_module');

  // Reset the existing configs in case they were changed when installing the
  // new configuration.
  $existing_settings_config-&gt;save();
  $existing_foo_config-&gt;save();
  $existing_bar_config-&gt;save();
}


It's not ideal, but it seems to work.