Skip to content

Add easier way to upgrade Moodle code between versions when using persistent volumes #103

@erseco

Description

@erseco

Currently, when /var/www/html is mounted as a named volume (e.g. moodlehtml:/var/www/html), upgrading between Moodle versions requires manually removing the volume to replace the old application code. This can be error-prone and risky for less experienced users, especially if they are not aware of the difference between moodledata and moodlehtml.

Suggestion:
Implement a structure where only essential persistent files (e.g. config.php and plugin/theme folders) are stored in the moodlehtml volume, while the rest of the Moodle core files are kept in the container. This would allow:

  • Safe upgrades by simply changing the image tag (e.g. v5.0.1v5.0.2) without having to manually remove the entire HTML volume.
  • Keeping site-specific customizations (plugins, themes, config.php) across upgrades.
  • Avoiding leftover outdated core code files after switching to a new container version.

Potential approach:

  • Split /var/www/html so that the volume mounts only:

    • /var/www/html/config.php
    • /var/www/html/theme/* (custom themes)
    • /var/www/html/mod/* (custom modules)
  • Everything else remains inside the container and is replaced automatically on image update.

This would simplify maintenance and reduce the risk of accidentally running old Moodle code after an upgrade.

Related to: #1 and #102

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesthelp wantedExtra attention is needed

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions