โœจ moodle migration magic โœจ

โš  this project is still work in progress, use with caution! ๐Ÿ‘ทโ€โ™€๏ธ
This nifty tool allows you to convert a moodle course backup into a spreadsheet to easily update course information in bulk, such as due dates of exercise submissions. Once you edited the spreadsheet to your liking, you can patch your course backup with the changes in the spreadsheet to generate a new backup that can then be imported into moodle. This conversion and patching happens all in your browser, no course data will leave your device. If something is not working or a feature is missing, feel free to open an issue or pull request on GitHub.

Contents

Step 1: Create a Suitable Course Backup

Navigate to your existing course that you want to use as a template and navigate to "Course Reuse" within the course administration menu.

Then select "Backup" instead of "Import" in the dropdown menu.
Alternatively, you can directly navigate to https://moodle.example.com/backup/backup.php?id=YOUR_COURSE_ID. Here you can freely select what you want to export, the only important setting is to NOT check "IMS Common Cartridge 1.1" so that the resulting backup is in Moodle's native backup format .mbz.
In the next screen you can optionally exclude some activities from the course or simply continue. The last screen gives you an overview of the backup to be performed and allows you the enter a filename for your backup, which you may change or simply keep the default name. Then click "Perform backup" and wait until it is completed.
Once it is completed you can download your backup from the "Restore" page.

Step 2: Create Spreadsheet Representation

Log Output

Step 3: Alter Patch File

Now you can use your favorite spreadsheet application to update certain properties of the course's activities.

The columns represent different properties that can be assigned to an activity within Moodle. However, not every column is respected for every activity type, as detailed in the following table.

Property Assignments Quizzes Label Section Other
name โœ… โœ… โš โต โœ… โœ…
completionexpected โœ… โœ… โŒ โœ… โœ…
availableFromยน โœ… โœ… โœ… โœ… โœ…
availableToยน โœ… โœ… โœ… โœ… โœ…
allowsubmissionsfromdate โœ… โœ…ยฒ โŒ โŒ โŒ
duedate โœ… โœ…ยณ โŒ โŒ โŒ
cutoffdate โœ… โŒ โŒ โŒ โŒ
intro โœ…โด โŒ โœ…โด โŒ โŒ
Legend: โœ… = supported, โŒ = not supported, โš  = partially supported

Step 4: Apply Patch

โš  You first have to select your Moodle backup file in step 2.

Log Output

Step 5: Import Patched Backup into Moodle

Now navigate to your new course where you want to import the patched backup and navigate to "Course Reuse" within the course administration menu.

Then you select "Restore" in the displayed dropdown menu.
Alternatively, you can directly navigate to https://moodle.example.com/backup/restorefile.php?id=YOUR_COURSE_ID. Here you can simply drag-and-drop your patched .mbz file or upload it using the file chooser.
Once uploaded click "Restore", which will not actually restore the backup yet, but instead leads you to a wizard that guides you through the restoriation process. This wizard for example allows you to specify whether the current course contents should be deleted before import or if activities should be merged (Note: merging unfortunately means keeping both old and new, there unfortunately is no option to modify existing activies using the restore process).

โ„น We highly recommend to only use the restore process to provision empty courses and not update existing courses. The later might otherwise result in data loss, depending on your user's privileges.

Step 6: Enjoy Your Newly Provisioned Moodle Course

๐Ÿ˜Ž