Answers.Body: <p>When I posted this question in 2015, we were looking at implementing something. The result, which is <strong>not a complete solution</strong> as of March 2017, was <a href="https://github.com/fuzionnz/civicrm-configexport" rel="nofollow noreferrer">this extension</a>.</p>
  
  <p>Ultimately, we ended up doing something else on that project, which was exporting specific CiviCRM tables and copying them across from dev ➡ stage ➡ prod.</p>
  
  <p>I've documented what did and didn't work over on the extension README, and happy to discuss further. Posting this to follow up and as a pointer for future searchers.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-06T20:14:43.610Z
Answers.LastActivityDate: 2017-03-06T20:14:43.610Z
Answers.UserDisplayName: Chris Burgess
Answers.Body: <p>I have not tried this but <a href="https://lab.civicrm.org/extensions/configitems" rel="nofollow noreferrer">https://lab.civicrm.org/extensions/configitems</a> says</p>
  
  <p>The extension can import the following types of items:</p>
  
  <ul>
  <li>ContactTypes</li>
  <li>MembershipTypes</li>
  <li>RelationshipTypes</li>
  <li>OptionGroups with OptionValues</li>
  <li>Groups</li>
  <li>Tags</li>
  <li>FinancialAccounts</li>
  <li>FinancialTypes</li>
  <li>EventTypes</li>
  <li>ActivityTypes</li>
  <li>LocationTypes</li>
  <li>CaseTypes</li>
  <li>CustomGroups with CustomFields</li>
  <li>CiviCRM Settings (system settings set through the Setting.API - be especially careful with that!)</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-11T23:19:15.317Z
Answers.Text: While you're updating these this reminds me there's the community wiki answer: https://civicrm.stackexchange.com/a/30474/181 (I'm not sure what community wiki really means - it sounds like something that you'd expect would be more visible - but FWIW).
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-12T03:03:39.800Z
Answers.Text: cool. thx. added 'deployment' to that answer
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-12T03:05:06.727Z
Answers.Text: came back to life here https://civicrm.stackexchange.com/questions/30438/reproduce-civicrm-configuration-best-practice/30474#30474 - do you want to add as an answer there to avoid me adding a third answer :-)
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-12T03:06:29.837Z
Answers.Text: Oh it's already there as 5.1 but under a different name.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-11T22:43:22.930Z
Answers.LastActivityDate: 2020-06-11T22:43:22.930Z
Answers.UserDisplayName: petednz - fuzion
Answers.Body: <p>CiviCRM Features looked like it had promise:
  <a href="https://www.drupal.org/project/features_civicrm" rel="nofollow">https://www.drupal.org/project/features_civicrm</a></p>
  
  <p>I spoke to the former maintainer, <a href="https://www.drupal.org/u/mallezie" rel="nofollow">Tim Mallezie</a>, about this a while ago. He was very helpful. The module was proving hard to maintain, as each entity in CiviCRM required it's own handler (perhaps this is something CiviCRM Entity could help with); and the overhead was proving too much to be worth continuing development.</p>
  
  <p>At the time Tim noted that:</p>
  
  <blockquote>
    <p>...we now use the CiviCRM API in custom modules with update hooks to deploy CiviCRM configuration.</p>
  </blockquote>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-29T23:03:26.450Z
Answers.LastActivityDate: 2015-09-29T23:03:26.450Z
Answers.UserDisplayName: John
Body: <p><em>Motivation: we're looking into building something in this space for a current project, so this question is intended to identify what approaches are already available / being utilised.</em></p>
  
  <p>For multi-developer and multi-branch workflows, it would be beneficial to "wrap up" site configuration and have it able to be merged into the site before deployment.</p>
  
  <p>I see that there are some approaches to this already:</p>
  
  <ul>
  <li><a href="https://www.drupal.org/project/features_civicrm">Features CiviCRM</a> is a (now-abandoned?) approach to using Drupal's Features module </li>
  <li><a href="https://www.drupal.org/project/civicrm_entity">CiviCRM Entity</a> seems a good candidate for exporting entities in Drupal space, <em>although it doesn't provide this currently</em></li>
  <li><a href="https://github.com/totten/civix"><code>civix</code></a> can scaffold code to import <a href="http://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension#CreateaModuleExtension-Addacasetype(CiviCRMv4.4+)">Case Types</a> and <a href="http://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension#CreateaModuleExtension-Addcustomfields(CiviCRMv4.4+)">Custom Fields</a></li>
  <li>CiviCRM's <a href="http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_managed"><code>hook_civicrm_managed</code></a> can generate managed entities in CiviCRM.</li>
  </ul>
  
  <p>For comparison, in host-CMS space there are different approaches also:</p>
  
  <ul>
  <li>WordPress has an <a href="https://wordpress.org/plugins/options-importer/">Options Importer</a> plugin</li>
  <li>Drupal 6 onwards has <a href="https://www.drupal.org/project/features">Features</a></li>
  <li>Drupal 8 onwards has <a href="https://www.drupal.org/documentation/administer/config">Configuration Management</a> (and retains Features for "bundled" configurations)</li>
  </ul>
  
  <p>My question here is: how are people managing and deploying configuration in CiviCRM today?</p>
  
Tags: <best-practice><configuration><deployment>
Title: How can CiviCRM manage and deploy configuration?
ThreadText: # How can CiviCRM manage and deploy configuration?
  
  (Asked by: username_0 on 2015-09-23)
  
  *Motivation: we're looking into building something in this space for a current project, so this question is intended to identify what approaches are already available / being utilised.*
  
  For multi-developer and multi-branch workflows, it would be beneficial to "wrap up" site configuration and have it able to be merged into the site before deployment.
  
  I see that there are some approaches to this already:
  
  * [Features CiviCRM](https://www.drupal.org/project/features_civicrm) is a (now-abandoned?) approach to using Drupal's Features module
  * [CiviCRM Entity](https://www.drupal.org/project/civicrm_entity) seems a good candidate for exporting entities in Drupal space, *although it doesn't provide this currently*
  * [`civix`](https://github.com/totten/civix) can scaffold code to import [Case Types](http://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension#CreateaModuleExtension-Addacasetype(CiviCRMv4.4+)) and [Custom Fields](http://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension#CreateaModuleExtension-Addcustomfields(CiviCRMv4.4+))
  * CiviCRM's [`hook_civicrm_managed`](http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_managed) can generate managed entities in CiviCRM.
  
  For comparison, in host-CMS space there are different approaches also:
  
  * WordPress has an [Options Importer](https://wordpress.org/plugins/options-importer/) plugin
  * Drupal 6 onwards has [Features](https://www.drupal.org/project/features)
  * Drupal 8 onwards has [Configuration Management](https://www.drupal.org/documentation/administer/config) (and retains Features for "bundled" configurations)
  
  My question here is: how are people managing and deploying configuration in CiviCRM today?
  
  **Tags:** best-practice, configuration, deployment
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_0 on 2017-03-06. Score: 3
  
  When I posted this question in 2015, we were looking at implementing something. The result, which is **not a complete solution** as of March 2017, was [this extension](https://github.com/fuzionnz/civicrm-configexport).
  
  Ultimately, we ended up doing something else on that project, which was exporting specific CiviCRM tables and copying them across from dev ➡ stage ➡ prod.
  
  I've documented what did and didn't work over on the extension README, and happy to discuss further. Posting this to follow up and as a pointer for future searchers.
  
  
  ---
  
  ### Answer by username_1 on 2020-06-11. Score: 3
  
  I have not tried this but <https://lab.civicrm.org/extensions/configitems> says
  
  The extension can import the following types of items:
  
  * ContactTypes
  * MembershipTypes
  * RelationshipTypes
  * OptionGroups with OptionValues
  * Groups
  * Tags
  * FinancialAccounts
  * FinancialTypes
  * EventTypes
  * ActivityTypes
  * LocationTypes
  * CaseTypes
  * CustomGroups with CustomFields
  * CiviCRM Settings (system settings set through the Setting.API - be especially careful with that!)
  
  > **Comments:**
  > **username_2**: While you're updating these this reminds me there's the community wiki answer: https://civicrm.stackexchange.com/a/30474/181 (I'm not sure what community wiki really means - it sounds like something that you'd expect would be more visible - but FWIW).  
  > **username_1**: cool. thx. added 'deployment' to that answer  
  > **username_1**: came back to life here https://civicrm.stackexchange.com/questions/30438/reproduce-civicrm-configuration-best-practice/30474#30474 - do you want to add as an answer there to avoid me adding a third answer :-)  
  > **username_2**: Oh it's already there as 5.1 but under a different name.  
  
  ---
  
  ### Answer by username_3 on 2015-09-29. Score: 2
  
  CiviCRM Features looked like it had promise:
  <https://www.drupal.org/project/features_civicrm>
  
  I spoke to the former maintainer, [Tim Mallezie](https://www.drupal.org/u/mallezie), about this a while ago. He was very helpful. The module was proving hard to maintain, as each entity in CiviCRM required it's own handler (perhaps this is something CiviCRM Entity could help with); and the overhead was proving too much to be worth continuing development.
  
  At the time Tim noted that:
  
  > ...we now use the CiviCRM API in custom modules with update hooks to deploy CiviCRM configuration.
  
  
  ---
  
  