We have three custom pieces of code for our Drupal website: module, theme and a non-drupal php library. The names of these components have become awkward over time. I would like to rename our custom module from "rsm_library" to "rsm_module".

I created a copy of "rsm_library" on Github as "rsm_module". I then changed all of the internal references from "rsm_library" to "rsm_module". These changes were mostly namespace and use statements. I also made updates to .info and .module. I then used composer to load the new module into the website so that both "rsm_library" and "rsm_module" are available at modules/custom. So far so good.

My next step is to uninstall "rsm_library" using the drupal admin gui. I received a warning message saying the listed configuration will be deleted when I uninstall the module:

  • three custom blocks
  • one REST resource

This seems correct as the support for the blocks/rest is coded in the "rsm_library" module. I looked at the configuration of one of the custom blocks. It contains the following lines -- among others:

    - node
    - rsm_library
provider: rsm_library

This is likely the interface between the custom module and the custom block. The REST configuration contains a dependency on "rsm_library" but does not include a provider:.

I am not sure how to proceed to complete the rename of "rsm_library" to "rsm_module". Perhaps something like this:

  • Export the four configurations
  • Change the dependencies/provider from "rsm_library" to "rsm_module"
  • Should I delete the uuid: line?
  • Include the resulting yml in "rsm_module/config/install"

The four configurations will be deleted when I uninstall "rsm_library". They will be included once again when I install "rsm_module". Does this seem to be the correct approach?

  • 2
    I would probably just place 3 new blocks, but this can probably be fixed by changing the dependency names in the config yamls and importing that, then trying to uninstall the old module. Also, probably makes sense to avoid using _library or _module as a naming convention in general.
    – Kevin
    Jan 10, 2022 at 1:40

1 Answer 1


I proceeded the way I described in the question above -- including deleting the uuid: lines from the yml files. I now have "rsm_library" uninstalled and "rsm_module" installed on the website. The block and rest configurations are in place and seem to be working. I should be able to promote this to our public website with some additional testing.

  • I don't believe there's any reason to delete the uuid lines.
    – sonfd
    Jan 12, 2022 at 20:31
  • There isn't, just replacing the dependency lines.
    – Kevin
    Jan 13, 2022 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.