Migrating modules installed/created on staging server to production

We are just getting started with SuiteCRM and have been trying to work out a development path from our staging server to the live production server. We have installed some modules on one server and the files have all been committed to our git repo but when we pull everything down to the other server and run repair/rebuild we are not seeing any of the modules come through even though the files are present on the server.

Is there something we need to do differently in order to make these transitions between servers? Do we just need to export developed/installed modules from one server and install them manually on the other?

Two things you can check

  1. Is the destination server Installed, meaning, did the installer run? SuiteCRM needs to run the installer (there is a silent installer you automate), it’s not enough to fetch files from git.

  2. There is a table in the database called fields_meta_data which you can import/export that matches your Studio changes and customizations.

Basically, automatic deployment is not very good for SuiteCRM. I would like this to be improved, but it won’t happen tomorrow. Some things make this really complicated, for example if an admin user decides to edit something in Studio after you deploy (and so those changes are not in your git repo).

You can read a good discussion here
http://blog.indrek.io/articles/version-control-and-deployment-practices-for-sugarcrm/

We have the base system installed on both servers, we are just trying to migrate changes via modules we are installing (and will eventually be developing) on one to another.

So am I to assume that the best course of action here is to install/develop the module on our staging server and then export said module to a file and use the Module Loader on the production server to install it there?

The module package export/import is probably the safe, recommended way to go.

However if you’re aiming to have a more automated process, I wonder if maybe something better could be achieved.

I don’t see any reason why a simple transfer of the relevant files in “custom” wouldn’t work. Maybe you can explore that in more depth and try to figure out what is missing.

This might be a great tool to let you see what’s going on in Studio, or during the packaging of a module:

https://pgorod.github.io/Audit-File-Accesses/

Please share your findings here. Thanks

At this point it’s looking like we are going to develop on staging and export the modules for installation on the production server. As we continue to learn about SuiteCRM and how the different pieces work, if we come up with a way to do it via Git I’ll come back and share.

Thanks

Hi!
Did you found any worked ways how to develop & delivery new/changed modules from dev to production?

@lmax

For using Git you can:

  1. load all files of module to server
  2. create the file custom/Extension/application/Ext/Include/<name_of_loading>.php and load it too.
$beanList['<name_of_module_1>'] = '<name_of_module_1>';
$beanFiles['<name_of_module_1>'] = 'modules/<name_of_module_1>/<name_of_module_1>.php';
$moduleList[] = '<name_of_module_1>';
...
$beanList['<name_of_module_n>'] = '<name_of_module_n>';
$beanFiles['<name_of_module_n>'] = 'modules/<name_of_module_n>/<name_of_module_n>.php';
$moduleList[] = '<name_of_module_n>';
  1. call the code (as a variant usnig cron)
if (ini_get('opcache.enable')){
    ini_set('opcache.enable',false);
}
require_once('modules/Administration/QuickRepairAndRebuild.php');
$rac = new RepairAndClear();
$rac->repairAndClearAll(array('clearAll'), array('<name_of_module_1>',...,'<name_of_module_n>'), true, false);
1 Like