Moodle course migration tip: cleaning out legacy files
November 7, 2012 Leave a comment
If you’ve moved from Moodle 1.9 to 2.x using the “clean slate” method (new, empty site) as opposed to upgrading an old one may have run into the issue I faced today…
Most of last year’s courses had already been shifted to the new site but this one in particular caused me a problem due to the amount of data in the legacy file structure. The course had numerous Lightbox Gallery items with large, uncompressed photos inside and the backup file size was ~1.1GB!
Being on an externally hosted site I don’t have control of php.ini to change upload limits nor did I have direct FTP access to use the file system repository so had to make the course smaller somehow. Tried a few methods around deselecting the galleries (files were still left in the backup from course files) or removing course files from the backup completely (broke all the images inside labels)
In the end I found a way to keep the active resources in the course whilst removing all the detritus that builds up in the old file structure:
- back up everything in the course from your 1.9 site
- restore it into a local Moodle 2.3 instance (WAMPServer etc) where you can set your upload limits in php.ini to be silly high (2GB+)
- create a new blank course on the local Moodle server
- use the Import function to import all desired activities, labels etc into the blank course
- back up the blank course
- upload and restore into your live site
The legacy files aren’t taken over as the import only copies the active data but preserves images used in labels and places them neatly into the new file system, along with activities, resources etc.
End result? Backup file went from 1GB to 20MB (the rest of the course is links, assignments & files) and restores nearly into the live site within a couple of minutes 🙂
The galleries will probably get recreated manually after the images have been shrunk down a bit, with the drag and drop feature in 2.3 it’ll be trivial to do and will end up neater than trying to migrate the old 1.9 version.
The usual disclaimer applies, test this with a copy of any courses you want to try it out with before handing the end product over to the tutor!
Still want that FTP access though!