4

Say I have an existing content type and related view on a site. Can I install Features and convert that content type and view into a feature.

I want to start using Features for better portability.

3

Yes, you can. You can install features, then export all the things you want to change. Install the feature on a copy of the site you are working on, and export again, after you made the changes. (and reinstall again to that copy site, until you are satisfied).

Then copy your feature to your production site, enable, and revert the feature (revert in this case means, making sure the feature behaves like defined in the feature, hence upgrading).

Good luck!

  • +1 I really enjoy using features in this way. It can be tricky at first to get into the habit of checking that your features aren't overridden before starting work (analagous to syncing to the latest with source control). I've found drush fd, drush fr and drush fu invaluable for this. – Andy Dec 9 '11 at 10:59
  • Say I have a dev site and a production site. On the dev site, I create a feature from existing types, views, etc. I then install the feature-created module on production. Do I need to do anything else? Thanks for the help, just wanna make sure i understand it clearly. – kidbrax Dec 9 '11 at 17:26
  • @kidbrax After updating the code you need to check that the features on the production site aren't overridden. drush fd will let you quickly check, and drush features-revert-all will revert the features back to the code. Also be aware not everything exports: custom node displays fields, plenty of content type related settings (though you can get most via strongarm), wysiwyg settings, input formats, and plenty more. – Andy Dec 11 '11 at 11:13
  • Got it, thanks again. I am doing some testing now. – kidbrax Dec 12 '11 at 15:42

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.