I customized a civicrm. I want to put on github.I cannot maintain a mysql database versioning. How can I do that?


It's really bad idea to customize CiviCRM core files when you can do thing using extensions. If you feel your customization fixes core issues than you should try to submit pull request against civicrm-core. If your changes are client specific than you can either move those files into custom php or custom template(again bad idea since its very difficult to maintain for future upgrade) or implement JS/hooks. There are many hooks available in CiviCRM where you can alter the content of website or perform additional function that is missing for example sending emails to group admin when a contact is created or change the content of Thank you page of Contribution or Membership signup or Event registration.

If you want to maintain the versioning of db then I would suggest to create extension and implement install/upgrade hook to create/update/delete custom fields or any settings in this way you can version your extension and can deploy on various instances without any hassle. There are also various migration tools available in CiviCRM which is responsible to migrate custom fields, contact types etc from one instance to another. You can also use them to copy your custom fields over staging or production instances.

https://www.drupal.org/project/civicrm_field_migrate https://github.com/CiviCooP/org.civicoop.configitems https://github.com/catorghans/net.trinfinity.orgis.mi.dataquality https://github.com/xurizaemon/civicrm-configexport

  • No sir. I add some custom field in contact (pre-define are Individual organization etc) like Question and answer (dropdown). But I want to push on github and then pull on another machine. But Whatever I changed the value, they all are reflecting in database. And database versioning is not possible for mysql. – Dipak Giri Oct 16 '18 at 11:10
  • Updated my answer! – Pradeep Nayak Oct 16 '18 at 11:23
  • I am also changing the permissions of each user. then how can I do that? If this will go in production level and again want to change some fields then data may overwrite. – Dipak Giri Oct 16 '18 at 11:31
  • Use drupals feature module (drupal.org/project/features_roles_permissions) – Pradeep Nayak Oct 16 '18 at 11:36
  • Please come in chat link – Dipak Giri Oct 16 '18 at 11:43

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.