Server Handbook live check: run log ------------------------------------------------------------------------------ Tool https://serverhandbook.com/tools/moodle-backup-mbz-inspector Check scripts/live/checks/tool-moodle-backup-mbz-inspector.mjs (sha256 5a775d898c75064b87616a769fa65ea031cfea99c749c5a10f1eac1b99f6eba2) Ran at 2026-12-05T09:43:52Z (404 s) Result PASS, all 25 claims held Tested on System Ubuntu 24.04.5 LTS Kernel 6.8.0-151-generic Package nginx 1.24.0-2ubuntu7.21 Package php-fpm 2:8.3+93ubuntu2 Package postgresql-17 17.12-1.pgdg24.04+1 Package moodle 5.3.1 Setup A fresh Ubuntu 24.04 server (4 GB of memory) with Moodle 5.3.1 installed as lesson 1 of the Moodle course installs it (Nginx, PHP-FPM, PostgreSQL; done by the check before the first step shown; the site name moodle.example.com points to it through an /etc/hosts line, as your DNS would), reached over SSH as a sudo user. The course was made by Moodle's own test generator (maketestcourse.php, size XS). Every version above was read from the server at run time. Passwords used on the throwaway test server are shown as [password]. How we test: https://serverhandbook.com/how-we-test ------------------------------------------------------------------------------ What the steps changed on the server (recorded before the first step and after the last) Packages added (0) Packages upgraded (0) Packages removed (0) Services enabled at boot (0) Services disabled (0) Listening sockets opened (0) Listening sockets closed (0) Files added in /etc (0) Files changed in /etc (0) Files removed from /etc (0) Disk used on / (includes logs written during the run): +8.8 MB ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Claims (25), each with what the run saw ------------------------------------------------------------------------------ 1. ok a bare Ubuntu 24.04 server box (web-server) starts 2. ok (setup) the site name points to this server 3. ok (setup) Nginx, PHP-FPM and the PHP extensions 4. ok (setup) the PostgreSQL project's repository (Moodle 5.3 needs 17; 24.04 ships 16) 5. ok (setup) PostgreSQL 17 6. ok (setup) role and database moodle 7. ok (setup) Moodle 5.3.1 from git 8. ok (setup) the Composer libraries (vendor/) 9. ok (setup) moodledata 10. ok (setup) max_input_vars = 5000 (the installer needs it) 11. ok (setup) the command-line installer 12. ok (setup) config.php root:www-data 640, the router configured 13. ok (setup) Moodle's cron every minute (www-data) 14. ok (setup) the Nginx server block 15. ok (setup) the login page answers | Log in to the site | learn 16. ok maketestcourse.php made the course SH101 | [#######################################################] 100.0% | Course completed (1.1s) - done (0s) | | Generated course: http://moodle.example.com/course/view.php?id=2 | 2 17. ok the database lists its sections and its activities by type | 2 | assign|1 | forum|1 | page|1 | resource|2 18. ok backup.php wrote a .mbz file | == Performing backup... == | Writing /tmp/mbz/backup-moodle2-course-2-SH101-20261205-0950.mbz | Backup completed. | total 24 | -rw-rw-rw- 1 www-data www-data 22005 Dec 5 09:50 backup-moodle2-course-2-SH101-20261205-0950.mbz 19. ok tar: .ARCHIVE_INDEX, moodle_backup.xml, users.xml and files// (the layout the tool reads) | 109 entries, 64594 bytes | .ARCHIVE_INDEX | moodle_backup.xml | users.xml | 4 | 2 20. ok the tool refuses a cut-off file, a zip .mbz, a file that is not gzip and one with no moodle_backup.xml, each with its reason (local check: all pass) | PASS the hand-built backup is read | PASS entries equal tar -tzf (35) | PASS files and unpacked bytes equal python's tarfile (22 files, 14547 B) | PASS Moodle release, backup date, course names | PASS two sections, activities in their sections, in order | PASS the Urdu and Chinese titles survive | PASS an escaped & in a title is decoded | PASS counts by type: assign 2, then forum, quiz, resource 1 | PASS each activity has its folder size | PASS users included, 3 user records counted, user data per activity | PASS a user-data warning, with the count | PASS no personal data in the report (no username or email) | PASS stored files 2, 4500 B; files.xml areas summed, "." folders left out | PASS no other warning on a whole backup | PASS no users: users not included, no count, no user-data warning | PASS a missing gradebook.xml is warned | PASS a file listed in files.xml but not stored is warned | PASS a tar with no end marker is read with a warning | PASS refused: truncated (first half of the file) | PASS refused: cut inside the tar (whole gzip of a cut tar) | PASS refused: not gzip (a text file) | PASS refused: a zip .mbz (usezipbackups) | PASS refused: gzip of something that is not tar | PASS refused: damaged gzip data | PASS refused: a tar.gz with no moodle_backup.xml | PASS refused: a broken moodle_backup.xml | PASS refused: an empty file | PASS real backup /tmp/moodle-mbz-qhBtZG/course.mbz: read, entries and bytes equal tar | REPORT {"name":"backup-moodle2-course-2-SH101-20261205-0950.mbz","moodleVersion":"2026100501","moodleRelease":"5.3.1 (Build: 20261112)","backupRelease":"5.3","backupDate":"2026-12-05T09:50:02.000Z","type":"course","mode":"10","courseFormat":"topics","courseFullname":"Server basics","courseShortname":"SH101","usersIncluded":true,"users":2,"filesIncluded":true,"sections":2,"activities":5,"byType":[{"modulename":"resource","count":2},{"modulename":"assign","count":1},{"modulename":"forum","count":1},{"modulename":"page","count":1}],"entries":109,"fileEntries":94,"stored":{"count":4,"bytes":9280},"warnings":["This backup contains user data (2 user records): names, email addresses and, with activities' user data, their submissions and grades. Store and send it as personal data."]} | | all checks pass 21. ok the tool: the backup's name, Moodle 5.3.1, the course "Server basics" (SH101) | { | "name": "backup-moodle2-course-2-SH101-20261205-0950.mbz", | "release": "5.3.1 (Build: 20261112)", | "course": "Server basics", | "shortname": "SH101", | "sections": 2, | "activities": 5, | "byType": [ | { | "modulename": "resource", | "count": 2 | }, | { | "modulename": "assign", | "count": 1 | }, | { | "modulename": "forum", | "count": 1 | }, | { | "modulename": "page", | "count": 1 | } | ], | "usersIncluded": true, | "users": 2, | "filesIncluded": true, | "entries": 109, | "stored": { | "count": 4, | "bytes": 9280 | }, | "warnings": [ | "This backup contains user data (2 user records): names, email addresses and, with activities user data, their submissions and grades. Store and send it as personal data." | ] | } 22. ok the tool: the same sections and the same activities by type as Moodle’s database | { | "name": "backup-moodle2-course-2-SH101-20261205-0950.mbz", | "release": "5.3.1 (Build: 20261112)", | "course": "Server basics", | "shortname": "SH101", | "sections": 2, | "activities": 5, | "byType": [ | { | "modulename": "resource", | "count": 2 | }, | { | "modulename": "assign", | "count": 1 | }, | { | "modulename": "forum", | "count": 1 | }, | { | "modulename": "page", | "count": 1 | } | ], | "usersIncluded": true, | "users": 2, | "filesIncluded": true, | "entries": 109, | "stored": { | "count": 4, | "bytes": 9280 | }, | "warnings": [ | "This backup contains user data (2 user records): names, email addresses and, with activities user data, their submissions and grades. Store and send it as personal data." | ] | } | database: 2 sections {"assign":1,"forum":1,"page":1,"resource":2} 23. ok the tool: users and files included, the users.xml count and the stored files equal tar | { | "name": "backup-moodle2-course-2-SH101-20261205-0950.mbz", | "release": "5.3.1 (Build: 20261112)", | "course": "Server basics", | "shortname": "SH101", | "sections": 2, | "activities": 5, | "byType": [ | { | "modulename": "resource", | "count": 2 | }, | { | "modulename": "assign", | "count": 1 | }, | { | "modulename": "forum", | "count": 1 | }, | { | "modulename": "page", | "count": 1 | } | ], | "usersIncluded": true, | "users": 2, | "filesIncluded": true, | "entries": 109, | "stored": { | "count": 4, | "bytes": 9280 | }, | "warnings": [ | "This backup contains user data (2 user records): names, email addresses and, with activities user data, their submissions and grades. Store and send it as personal data." | ] | } | tar: 2 users, 4 stored files 24. ok the tool: every tar entry and every unpacked byte equal tar -tvzf | PASS real backup /tmp/moodle-mbz-qhBtZG/course.mbz: read, entries and bytes equal tar | tar: 109 entries, 64594 bytes 25. ok (tested on) the box reports its OS, kernel and the version of 4 package(s) | PRETTY_NAME="Ubuntu 24.04.5 LTS" | VIRT=none | KERNEL=6.8.0-151-generic | PKG nginx 1.24.0-2ubuntu7.21 | PKG php-fpm 2:8.3+93ubuntu2 | PKG postgresql-17 17.12-1.pgdg24.04+1 | moodle: $release = '5.3.1 (Build: 20261112)'; // Human-friendly version name ------------------------------------------------------------------------------ Commands and what they printed (5) ------------------------------------------------------------------------------ $ cd /var/www/moodle $ G=$(ls public/admin/tool/generator/cli/maketestcourse.php admin/tool/generator/cli/maketestcourse.php 2>/dev/null | head -n 1) $ sudo -u www-data php $G --shortname=SH101 --fullname="Server basics" --size=XS --bypasscheck 2>&1 | tail -n 4 [#######################################################] 100.0% Course completed (1.1s) - done (0s) Generated course: http://moodle.example.com/course/view.php?id=2 $ sudo -u postgres psql -d moodle -At -F '|' -c "SELECT count(*) FROM mdl_course_sections WHERE course = 2" $ sudo -u postgres psql -d moodle -At -F '|' -c "SELECT m.name, count(*) FROM mdl_course_modules cm JOIN mdl_modules m ON m.id = cm.module WHERE cm.course = 2 AND cm.deletioninprogress = 0 GROUP BY m.name ORDER BY m.name" 2 assign|1 forum|1 page|1 resource|2 $ sudo mkdir -p /tmp/mbz && sudo chown www-data /tmp/mbz $ cd /var/www/moodle && sudo -u www-data php admin/cli/backup.php --courseid=2 --destination=/tmp/mbz 2>&1 | tail -n 3 $ ls -l /tmp/mbz == Performing backup... == Writing /tmp/mbz/backup-moodle2-course-2-SH101-20261205-0950.mbz Backup completed. total 24 -rw-rw-rw- 1 www-data www-data 22005 Dec 5 09:50 backup-moodle2-course-2-SH101-20261205-0950.mbz $ cd /tmp/mbz && tar -tvzf backup-moodle2-course-2-SH101-20261205-0950.mbz | awk '{ n++; b += $3 } END { print n " entries, " b " bytes" }' $ tar -tzf backup-moodle2-course-2-SH101-20261205-0950.mbz | grep -E '^(\.ARCHIVE_INDEX|moodle_backup\.xml|users\.xml)$' $ tar -tzf backup-moodle2-course-2-SH101-20261205-0950.mbz | grep -cE '^files/[0-9a-f]{2}/[0-9a-f]{40}$' $ tar -xOzf backup-moodle2-course-2-SH101-20261205-0950.mbz users.xml | grep -c '