How to synchronize configurations

How to synchronize configurations

by Alex Seif -
Number of replies: 5

Hello, I'm a moodle noob.

We're currently customizing moodle to our needs, however a challenge I'm facing is that a lot of the customizations are configured through the admin panel (currently mainly in appearances).

The challenge here is 2 part

  1. Having the same configurations across all members working on the project
  2. Deploying these configurations to our servers when done

We use git to manage our instance, we setup a child theme based on boost, so code change is managed, but how do you manage configurations (separate from courses and users)

We're using moodle/MOODLE_38_STABLE Moodle 3.8.1+ (Build: 20200214)

Any help would be appreciated.

Average of ratings: -
In reply to Alex Seif

Re: How to synchronize configurations

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
It depends what you are trying to manage.

You could use https://moodle.org/plugins/block_admin_presets to import/export system configuration between sites.

Other than that, I'd normally recommend that any configuration that is essential to the operation of your custom code, should be deployed in the install.php or upgrade.php scripts for your plugins (e.g. I often use this to create custom user profile fields or custom roles that are required for the operation of a a particular plugin on a customer's site).

Average of ratings: Useful (1)
In reply to Davo Smith

Re: How to synchronize configurations

by Alex Seif -

Thank you for your replies.

Firstly: I came across that plugin, but the description didn't really convince me it's what I'm looking for. I will give it a shot smile

But mainly, I feel the discussion is running in a different direction, I love git, but not submodules, and since this is a single website, I will just update the plugins manually on my machine, and have the administrator go through the update in the next release.

The main issue is still, the settings are being configured on multiple machines, I can't have the admins and coders remember every setting they changed to reach the desired result, and then have them share it without conflicting or overriding each other. Drupal for example in their last upgrade has this feature built in https://www.drupal.org/project/config_sync because with configurable sites, the configuration is in the DB and is difficult to compare.

I will give the suggested plugin a try, but I need to set it up so that the deployer doesn't need to perform additional steps.

I guess at some point we'll just take database exports of specific tables.

In reply to Alex Seif

Re: How to synchronize configurations

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
There is another dimension to this: third-party plug-ins. I haven't found an automated upgrade method for these. Ref. Maintaining contributed extensions as submodules when they don't have the same branch (yet).
In reply to Visvanath Ratnaweera

Re: How to synchronize configurations

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Visvanath,

Maintaining 3rd-party plugins in a single repository is really not a huge job - it takes about 5 min for someone to run the built-in checker to see if there are any new updates, then they can either make their local install writable (to allow automatic download of new plugins) or manually download + replace the existing code. After that, it is simply a case of committing the changed plugin(s) and pushing - everyone else in the team can then pull the latest code.

This becomes a lot harder to manage when managing the repositories for hundreds of different customers, but for a single site it is only a very tiny amount of time, compared to any form of custom development.

Personally I dislike git submodules and find them far more effort than it is worth to use, but maybe others find them helpful in some situations.

In reply to Davo Smith

Re: How to synchronize configurations

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hello Davo

Thanks for responding! I know the web-based installation of upgrade procedure for plug-ins. I am thinking of many sites, like the OP, and was looking for a "magic" command, git being the obvious, to update the code. That will kick the web-based Moodle upgrade procedure and update the database.

Since there is the possibility that this being not what OP is looking for I added a new post to my thread (rather than hijacking this thread). Would appreciate if you (or anybody else) could shed some light in to this. It is here: https://moodle.org/mod/forum/discuss.php?d=396476#p1604043.