Installing and upgrading help

Restoring a course from a ten year old moodle.xml?

 
Female Ephemerella Infrequens
Restoring a course from a ten year old moodle.xml?
 

I'm retired.  About a decade ago I made a series of online courses in elementary computer programming: bash shell, perl, html and php.

I thought I kept mysql dumps but I cannot find them.  And now I have a reason to restore those courses.

But I do, for each such course, have a zip file that includes, among other things, a file named moodle.xml that seems to contain the text for each dynamically generated page in the moodle parts of these courses.

Is it possible to restore from a moodle.xml?  Have data formats changed?  Would I have to start by installing a ten year old version of the moodle server?  It was 8 years ago actually--2009.


I'll also keep looking for the mysqldumps.  I must have them somewhere.

 
Average of ratings: -
Picture of Emma Richardson
Re: Restoring a course from a ten year old moodle.xml?
Documentation writersParticularly helpful Moodlers

You might actually be able to restore into a newer version of Moodle.  My suggestion would be to fire up a Moodlecloud site and see if you can import it in there - make sure to exclude and user data as that will not work.

 
Average of ratings: -
Picture of Ken Task
Re: Restoring a course from a ten year old moodle.xml?
Particularly helpful Moodlers

Blast from the past! ;)

Emma might be correct .... worth a try.

if, for some reason, that doesn't work ... yes, there's but much that has changed ... all is not lost when it comes to files you had uploaded to the 1.9 or less version course.

files.xml contains the 'roadmap' for files that were contained in the course which are located in the 'files' directory of the un-archived zip backup of the course.   Those files have humanly recognizable names with filename extensions (no longer true with 2.x/3.x).

Since you programmed before, might have to use some xml editor for some of the content to extract the text from the xml tags ... xmllint comes to mind.   If using xmllint, you need to work with a copy of the original xml files just in case there's a hickup and you'll probably have to run a series of xmlint commands to 'scrub' and xml file of the xml tags.

If you are game ... I have put together a CLI 'app' to extract files from a 2.x/3.x backup of a course (not a 1.9 or less).  Does require xmllint, php, and bash shell.   Since you are a progammer and have experience you might be able to adjust the scripts to extract the content of other content like forums and html pages contained in the other xml files of the extracted moodle .zip backup.

https://sos.tcea.org/extractscripts.zip

There's a README.TXT file in the extracted files of the script above that tells how to use.   Have run it on a Mac and on Linux servers successfully ... many many many moons ago! ;)

So you thought you'd retire, huh? ;)   Welcome back to the 'rat race'? ;)

'spirit of sharing', Ken


 
Average of ratings: -
Female Ephemerella Infrequens
Re: Restoring a course from a ten year old moodle.xml?
 

This sounds promising.    I was an xml/database (sleepycat and exist) programmer so I wouldn't have any trouble modifying an xml file.


Cloud version of Moodle?  Boy am I obsolete.  I hung up the keyboard just as all that got started.  I'll start with a moodle installation on linux localhost.  Tomorrow I'll read the links suggested above.  Thank you.

 
Average of ratings: -
Picture of Howard Miller
Re: Restoring a course from a ten year old moodle.xml?
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers

Older course backups are "supposed to be" backwards compatible. The problem you may have is if these are 1.9 era backups. 

Even then... all the older versions of Moodle can still be downloaded so you can just install one that *will* restore your backups and go from there.

 
Average of ratings: -
Picture of AL Rachels
Re: Restoring a course from a ten year old moodle.xml?
Core developersParticularly helpful MoodlersPlugin developersTesters

A restore from 1.9.19 will work. Others less than 1.9.19 may have problems. The one thing you WILL get an error message about is any assignments will not restore as an old assignment type version, but will be converted and restore as a new assign version. Restore from 1.9+ is one of the standard quality assurance tests included and conducted during each QA Testing cycle for each new Moodle release.

 
Average of ratings: Useful (1)
Picture of Howard Miller
Re: Restoring a course from a ten year old moodle.xml?
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers

Is it? Good.

I was tempted to wonder when the last time somebody tried it was...

 
Average of ratings: -
Picture of AL Rachels
Re: Restoring a course from a ten year old moodle.xml?
Core developersParticularly helpful MoodlersPlugin developersTesters

Yes. Someone beat me to it on the just completed 3.4 QA cycle, but I have ran the Moodle 1.9 course restore on each of the previous four or five cycles and it has worked each time. That is with a backup of a course with one of every core activity and resource available in Moodle 1.9.19+. The only ones that burp, are assignments, all are restored as the new type assignment, and then depending on how many there were, you will get that many messages about not being restored...meaning the old version of assignment.

 
Average of ratings: Useful (1)