3

Once upon a time a made a terrible mistake on one of the test sites by not enabling feature module but cloning database along with content types data from my local dev machine (drush sql-sync @local @test). This test site went live with feature disabled, but content type exists and has content.

Is it somehow possible to enable this feature at this stage to override existing content type and keep it's content?

1
  • 1
    Yes, if the feature matches the content type there should be no problem. Commented Apr 23, 2015 at 15:36

1 Answer 1

2

Yes, it is possible to enable the feature. Enabling the custom feature module does not change anything on the site. The feature will have a different state depending on if the code in the feature module differs from what is stored in the database. A quick way to check the state of your features is the drush command:

drush fl

If your custom feature's components are simply the content type, and assuming field_base and field_instance components, then enabling the feature will tell you if they are either:

  1. Overridden: the components (content type settings, field settings) are different in the database and the custom feature code.
  2. Default: the components in the custom feature code are the same as the settings in the database.

If your custom feature is "Overridden" you have two options:

  1. Update: drush fu featurename - Updating your feature will update the custom feature code with the settings that are stored in the database.
  2. Revert: drush fr featurename - Reverting your feature will restore the feature's component's settings in the database to what is stored in the custom feature module's code.

So, either way, this shouldn't affect your node content. Unless you revert your feature components thus affecting the content type or field settings.

See the drupal.org documentation for more on using features & drush: https://www.drupal.org/node/960926

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.