I have created a feature with a typo in the machine name. I've tried just search/replacing instances of the misspelling with the proper spelling in all files within the feature's directory, but when I do that it disappears from the list of available features entirely. (Yes, I drush cc all'd.)

How can I change the machine-readable name of this feature?

Using Drupal 6, btw.


Use this procedure to rename a Feature module:

  • drush pm-disable old_feature_name
  • drush pm-uninstall old_feature_name
  • rename the Feature module folder
  • rename the .info file
  • rename the .module file
  • rename any hook prefixes
  • drush pm-enable new_feature_name
| improve this answer | |
  • I also renamed all the hook names just to be safe, and apparently I missed one. Does the above work properly when the feature is enabled? – beth Dec 4 '12 at 15:17
  • 1
    After renaming, the module will appear disabled, since the system table will still indicate that the module's old name is enabled. I'd recommend, before renaming, drush dis and drush pm-uninstall, then rename, then drush en with the new module name. (I just updated my answer with the full procedure.) – smokris Dec 4 '12 at 16:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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