One-way configuration synchronization between production and development servers

Re: One-way configuration synchronization between production and development servers

by Mark Johnson -
Number of replies: 0
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Not quite, we have a per-environment JSON file that looks something like this:

{
    "config_values": [
        {"name": "debug", "value": "32767"},
        ...
    ],
    "config_plugin_values": [
        {"plugin": "auth_saml2", "name": "logdir", "value": "/var/log/saml2/", "wherenot": ""},
        ...
    ],
    "config_value_replacements": [
        {"name": "example", "find": "Live", "replace": "Test"},
        ...
    ]
}

The script then uses each of those values or find/replace lines to construct a query that updates the config value in the database. If it includes a property like "wherenot" "wherelike" etc then the update is conditional based on the current value.