Add Config import and export commands #539
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
config-export
Exports all Moodle configuration settings from the
mdl_configtable to a JSON file.This command allows administrators to back up all site configuration values for migration, backup, or review. The output is a JSON file mapping config names to their values.
Available options:
Example 1: Export all config values to a file named
config.json.Example 2: Export all config values to stdout.
The output file will contain a JSON object, for example:
{ "sitefullname": "My Moodle Site", "siteshortname": "moodle" }config-import
Imports Moodle configuration settings from a JSON file into the
mdl_configtable and purges all caches.This command allows administrators to restore or update site configuration from a previously exported JSON file. By default, existing config values are overwritten. Use the
--skip-existingoption to only insert new config values.Available options:
Example 1: Import config values from
config.json, overwriting existing values.Example 2: Import config values from
config.json, skipping existing values.After import, all Moodle caches are purged automatically.
The input file must be a JSON object mapping config names to values, for example:
{ "sitefullname": "My Moodle Site", "siteshortname": "moodle" }