Working with Git/Github

Greetings!

I’ve reviewed tons of discussions on this topic but the more I dig, the more variations I find.

Here’s what I’m trying to accomplish:

  • 1 Dev environmnent
  • 1 Prod environment
  • 1 Training environment

Almost all customizations are with with the tools in the Admin menu. I would like to commit these to a Dev branch in Github and then pull them into the Prod or Training environments.

I do want to track all customizations as I will want appearance and functionality to be consistent from one environment to another.

Here’s what I’m thinking of doing:
Before committing significant changes that I will want to pull to the other environments, export appropriate database changes and save them to a directory inside the Dev instance (which will be tracked by git). On the Prod or Training server, pull changes from the remote, then import database changes into MySQL, then run a Quick Repair and Rebuild.

Among the following, I have not been able to figure out what parts of the database I need to be exporting/importing across instances::

  • db schema
  • fields_meta_data
  • workflow
  • _cstm (I’m guessing this refers to all the all the *_cstm tables rather than any specific one)
  • Other?

Any suggestions on which combination of the above (or perhaps not listed above) would do the job?

Any assistance will be most appreciated! :slight_smile:

Server info
SuiteCRM 7.12.7
Debian 11 (Prod) / Ubuntu 20.04 (Dev & Traning)
MariaDB
PHP 7.4

Hi @Northern_Dude,

Git is 100% the correct way to go with this setup! As for what to commit and database stuff;

  • You only need to migrate across database stuff if your wishing to save the data itself. The structure, _cstm tables, fields_meta_data and DB schema are all created when running “Quick Repair and Rebuild” from the Administration > Repair Menu.
  • You would need to migrate across things like email & PDF templates, workflows and schedulers as those are saved as data in the database itself.
  • So long as you have worked only in the custom folder then you can purely just migrate that and your config_override.php (Tho I suggest committing the whole CRM removing custom and dev from the standard .gitignore file).

Afterwards, just install it like normal producing a new config.php and database, again run repair and rebuild along with some of the other repair options if they sound like things you’ve changed and you’ll be (fingers crossed) right as rain!

Hopefully, a dev will come along and pass on some more exact details of the process but this will get you somewhere in building out your plans.

Best of luck and if you have any questions please feel free to ask!

1 Like

Great answer… nice & clear!

For the exact details of the process, you hit the nail on the head once again! :wink:

If a dev would be so kind as to fill in the gaps, that would be a tremendous help!

Thank you!

1 Like

Just to be sure I understand correctly…

Do I run the installer only if setting up a new server? Or do I also re-run it when pulling new customizations into an existing instance?

Thanks!

On a new instance just run the installer as it sorts it all for ya. On an already existing instance a Quick repair and rebuild along with any other relevant repair options should hook up all the stuff needed for your changes :+1:

1 Like