Moodle 1.9 - how to recover a course and run it locally

Moodle 1.9 - how to recover a course and run it locally

by Antonio Regina -
Number of replies: 46

The university is going to dismiss completely Moodle version 1.9, that was running in a old server.

My concern is to recover the courses I had there, before everything shuts down. Some of them are very big , with a lot of database driven resources, like forums, quizzes, assignments, etc.: from 6GB to 25GB looking at the folder of the file system.

I would like to run these courses locally to my pc with the same (actually almost the same 1.9.x) Moodle version.

  • a) As teacher, backing up a course fails (due to its size I guess).
  • b) Up to now, I backed up completely the  file system folder of each of my courses.

I suppose that having just b) is not enough to run a course locally in my pc. So my question is the following.

What exactly do I need, apart b) and given a), so to be able to "import" or "restore" (or just "run") locally the course?

In other words, what should I do, or what should I ask the administrators (even them are unable to make a full backup from what I understood), to run a copy of the course locally?

Thank you.




Average of ratings: -
In reply to Antonio Regina

Re: Moodle 1.9 - how to recover a course and run it locally

by Ken Task -
Picture of Particularly helpful Moodlers

First, you probably shouldn't ask for a full course backup with students information/accounts, assignments, quizzes, etc.   Privacy issues.

Second, you could try to make a no user backup ... that removes students and all their work from the backup - which means the backup zip file should be smaller in size.

To run that backup on a local computer would require a lot of work as one would have to find old version of MySQL (4.x.something if I re-call) and old version of PHP (5.3 if I recall).   Not sure you can find those anymore.

How about you try a no user backup first before going off into la-la-land with how to run a moodle that old on something local?

BTW. the one saving grace is the old file system ... a 1.9 backup zip file has a 'files' directory and all the files that were uploaded to that course are in there ... and by humanly recognizable file names (that version was the last to do that with files).

'SoS', Ken


In reply to Ken Task

Re: Moodle 1.9 - how to recover a course and run it locally

by Randy Thornton -
According the environment.xml file, Moodle 1.9 required MySQL 4.1.16 and PHP 4.3.0.

The official MySQL archive site only has versions going back to 5.0.15. https://downloads.mysql.com/archives/community/. So I don't know where you would find version 4.1. It must be somewhere: it had a GPL license and came out way back in 2004, well before Sun bought them.

Old PHPs can be found in the Museum: https://museum.php.net/
In reply to Randy Thornton

Re: Moodle 1.9 - how to recover a course and run it locally

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Even Moodle rel. 1.6 ran on PHP 5.6. See http://www.syndrega.ch/blog/#php-and-dbms-compatibility-of-major-moodle-releases.

So to get Moodle rel. 1.9 running on your local PC, install VirtualBox and create a https://en.wikipedia.org/wiki/Debian_version_history#Debian_6.0_(Squeeze) virtual machine in it. Try to get all the LAMP packages from the install CDs, because the PGP signatures of the packages in the repositories are now expired. If necessary, you can trick them by taking the clock of your VM to 10 years in to the past.
wink
In reply to Visvanath Ratnaweera

Re: Moodle 1.9 - how to recover a course and run it locally

by Randy Thornton -
Visvanath,

How far back do the LAMPP packages go, back to the 90s in some form I would think? That they were available on CDs back then would make sense but I don't remember installing things that way myself.

I think XAMPP packages go a long way back too: there was a Windows NT version (back when there was a Windows NT).

Question is where are they archived...
In reply to Randy Thornton

Re: Moodle 1.9 - how to recover a course and run it locally

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Randy

I am not familiar with XAMPP. I am talking of pure Debian install CDs and repos. For example starting from these CDs https://www.debian.org/releases/squeeze/debian-installer/ I managed to run Moodle rel. 1.6 and 1.9 not long ago, 2 years may be. I bet even Debian 2 Potato https://en.wikipedia.org/wiki/Debian_version_history#Debian_2.2_(Potato) from A.D. 2000(!) will run today https://www.debian.org/releases/potato/installmanual, admittedly 32 bit only.
In reply to Visvanath Ratnaweera

Re: Moodle 1.9 - how to recover a course and run it locally

by Randy Thornton -
Got it. So those sets will have not only core but the respective PHP and MySQL current at that time...
In reply to Randy Thornton

Re: Moodle 1.9 - how to recover a course and run it locally

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
I knew, I discussed it here. See "Courses for a Moodle showcase - from the generation 1.x?" https://moodle.org/mod/forum/discuss.php?d=421313#p1697896. Not much technical details though. It was pretty straightforward. Create an empty VM in VirtualBox, boot it from the ISO of the Debian Linux image, and run install, then install the full LAMP from the CD.
In reply to Antonio Regina

Re: Moodle 1.9 - how to recover a course and run it locally

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
> What exactly do I need, apart b) and given a), so to be able to "import" or "restore" (or just "run") locally the course?

Neither a) nor b), a https://docs.moodle.org/19/en/Site_backup rather. Or, if you don't mind the history, the set of https://docs.moodle.org/19/en/Course_backup.
In reply to Visvanath Ratnaweera

Re: Moodle 1.9 - how to recover a course and run it locally

by Antonio Regina -
Thanks Randy and Visvanath for your feedback.

I do not have problems running Moodle 1.9. I have a full portable copy of it that I saved and "installed" time ago. I guess it runs with the correct versions of php and sql. BTW, their specs are given here, if I am correct:
https://download.moodle.org/releases/legacy/

There is no much privacy issues, as far as I can understand: as a lecturer I have the legal duty to keep in my office any material (assignments, etc.) of my course that have contributed to the final mark.

My problem is to migrate my course(s) site(s) that will no longer run online.

1) As I said the backup Moodle function does not work (it was attempted both by the teacher and by the admin). Probably there is the limit of 4GB. Does this limit exist in v.1.9?

2) So, what else, that was my question. If I understood correctly your doc links, the database that manages forums, quizzes, etc. is not inside the file system of the course. Am I correct to say then that the file system of the course is of no use if one wants forums, quizzes, ect? (apart possibly for the attachments and figures linked to quizzes and forums).

If there is no alternatives to migrate the database of the course, as a workaround I could think the following:

3) Backing up by parts: first the forums, then assignments, then quizzes, and then importing them in succession locally

4) Copying locally (via ftp) the file system of the course. Then on the server erase as many files and folders as possibile, probably except what is inside moodledata, so to allow moodle to create a smaller backup. When imported locally re-copy re-insert the full system folder there. Not sure if the backup stucks when it does not find the majority of (attached) files of the course.
In reply to Antonio Regina

Re: Moodle 1.9 - how to recover a course and run it locally

by Antonio Regina -
Sorry, and thanks also to Ken obviously!
In reply to Antonio Regina

Re: Moodle 1.9 - how to recover a course and run it locally

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
I'll add a few thoughts.

I have an archived copy of Moodle 1.9 that I run using MAMP 6.6 on my Mac. To run Moodle 1.9, I pick PHP 5.6.40. The MAMP database is MySQL 5.7.34. When I run 1.9, it is exactly as it was on my server, perhaps 10 years ago (can't remember when I switched to Moodle 2.0).

But, Antonio, my Moodle 1.9 was quite small, about a gigabyte. In theory, if you could move your 260GB to your local computer, it should work. But I am not sure.

I do have XAMPP running on a local PC, but I haven't tried running Moodle 1.9 under it. My XAMPP is running MariaDB. According to Visvanath's summary, Moodle 1.9 doesn't work with MariaDB.  However, maybe one could find an old copy of XAMPP that runs MySQL 5.7.34, or earlier.  I think that there is a version of MAMP for Pcs, but I haven't used it.

(Visvanath, how is it that I can run Moodle 1.9 with MySQL 5.7.34?  Your chart, and Randy say 4.1.16 is the max?)

When I move my current production Moodle down to MAMP, I do a backup of the database and a backup of moodledata, and then I erase my MAMP's database tables and moodledata folder, and replace them with my backups. In theory, you should be able to do the same.

I don't know if anything that I have shared makes sense to you. The other folks participating might make more sense. I am just letting you know that I can run my archived Moodle 1.9 in MAMP on my Mac.
In reply to Antonio Regina

Re: Moodle 1.9 - how to recover a course and run it locally

by Randy Thornton -
When attempting to back up the course, have you tried to turn on debugging to see what messages it gives? Or does it just spin forever?

The 4GB limit sounds familiar to me (it's only been a decade ;) but if I recall the issue was not the backup but some limit in PHP or MySQL. There were certainly practical limits of about 512 Mb while backing up courses and it would start to time out. Setting your php.ini setting for memory_limit usually helped. Depending on your server OS and partition setup there could be an issue with just storing a file that size.

I agree with Rick that, "When I move my current production Moodle down to MAMP, I do a backup of the database and a backup of moodledata, and then I erase my MAMP's database tables and moodledata folder, and replace them with my backups. In theory, you should be able to do the same."

As long as the names and permissions of everything are the same (and the Moodle code is the same build), this should work.
In reply to Randy Thornton

Re: Moodle 1.9 - how to recover a course and run it locally

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
For those who might not believe that I can run Moodle 1.9, I'll attach two screenshots showing my frontpage and environment.  I think that this could be what Antonio desire, to be able to run Moodle 1.9, get to courses, and get to student's work.  Yep, he has a big Moodle.  I would probably put the moodledata on a 512GB microSD card instead of my local computer's hard drive.  I don't want to consume 250GB of local hard disk space.  Maybe there is a way to put the entire XAMPP and Moodle on the SD card.



Attachment Ricks Moodle 1.9 Environment.png
Attachment Ricks Moodle 1.9.png
Average of ratings: Useful (1)
In reply to Rick Jerz

Re: Moodle 1.9 - how to recover a course and run it locally

by Ken Task -
Picture of Particularly helpful Moodlers

since you, Rick, have a functioning 1.9, can you do no user and select only certain resources in the course to backup? and the flip of that, restore to same course just adding to it?

In an archive of 1.9.20+ moodle code (which was the highest/last of the 1.9.x series)
In admin/backup/
There are 2 txt files worth reading.
README.txt and STATUS.txt

The STATUS.txt file has this info:
   - Select manually the desired activities to backup...........NOT EXISTS
      - Modify the backup frontend..............................NOT EXISTS
      - Modify the backup of course_sections and course_modules.NOT EXISTS
      - Modify every module backuplib to work properly..........NOT EXISTS
As well as everything the backup does do.

The programmer also had this comment at the end of that .txt file:
This is all. It isn't a little thing !

 'SoS', Ken


In reply to Ken Task

Re: Moodle 1.9 - how to recover a course and run it locally

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Yep, Moodle 1.9 appears to allow a course backup with or without user data (see graphic). I also see our familiar "restore."



Attachment No User.png
In reply to Rick Jerz

Re: Moodle 1.9 - how to recover a course and run it locally

by Randy Thornton -
So, which is it?

Ken's STATUS.TXT says that you can not choose which activities to backup - but that note from Eloy is dated April of 2003, which is very early well before 1.9.

This screenshot says choosing activities does work in 1.9 last release. Does it work? I recall that it did.


If selecting specific activities to backup works, my approach to solve the OP problem would then be to do small incremental backups from the server, for example one course section at a time to keep the backups very small and so well under any limits the server may have.

Then I would restore those partial backups and merge them back into a single course on the local server.
In reply to Randy Thornton

Re: Moodle 1.9 - how to recover a course and run it locally

by Ken Task -
Picture of Particularly helpful Moodlers

I was going to propose the same solution to the problem, Randy, but after reading that STATUS.txt file, didn't know (re-call) for sure if that could be done or not.   Rick/Leon do have a 1.9.x running.   They could verify.

There's one more thing I seem to re-call about the backups of a 1.x.  

Example: Teacher makes a full backup of the course.   That backup.zip is stored in moodledata/courseid#/backups/.   Times passes, teacher adds to course and/or students submit assignments, etc. Teacher then decides it's time for another backup.   That second backup included the first backup zip thus making the second backup grow rather quickly until the backup of that course became difficult.

If Rick/Leon could test that also.

IF that behavior is still true, then all OP would need to do is login to server, go to course(s), and check out files/backups.   Download the old backups then delete them leaving only the most recent (or delete them all).   Then try the backup routine again to see if that one isn't reduced in size enough to complete.

I seem to recall having to do that very thing from the command line so that a couple of teachers could use the GUI backup routine.

'SoS', Ken

Average of ratings: Useful (2)
In reply to Ken Task

Re: Moodle 1.9 - how to recover a course and run it locally

by Randy Thornton -
Ah! I don't remember that it did that, include backups of backups of backups... Perhaps I put it out of my mind as a bad memory.

In that case, I think the combined suggestions would work well: clean out all the old backup zip files, make a partial one and see how big it is, then restore it as a new course. Then delete that backup, make a second partial backup, restore it as a merge into the new course.... and so on until the course is rebuilt. Depending on the size of the backup zips, that could be very doable.
In reply to Randy Thornton

Re: Moodle 1.9 - how to recover a course and run it locally

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
I would investigate what is inside those 25 GB in the first place! I can't image such "mountains of knowledge". Well, unless OP's is an Arts school teaching video production and the student's portfolios too land in the course.
wink
In reply to Visvanath Ratnaweera

Re: Moodle 1.9 - how to recover a course and run it locally

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
I agree, Visvanath. I looked at my Moodle 1.9 course backups (those .zip files) and found that I had about a dozen. Each was around 275KB. Very small.  No user data in any, however.

For Antonio, I suggest starting small. Do a course backup excluding all user data, and see if you have success. Then, go back and include "some" user data. Do another backup, see if you have success. Then build up from there.
In reply to Rick Jerz

Re: Moodle 1.9 - how to recover a course and run it locally

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Rick, I was talking about _investigating_ the content, not about moving old bloat (possibly) to the new place. Even if the OP wants that, technically he can't do it, the process needs site administrator privileges. Administratively, if the IT people locked out the lecturer from his Moodle site, they must at least have the courtesy of handing him his data, not that he should come back and do the digging and carrying.
sad

That is why I said, "Part I: The administrators of the old Moodle server must give you the data..." https://moodle.org/mod/forum/discuss.php?d=433536#p1744448.

Before the next discussion starts, the IT people must do the investigation, that is why they are sometimes called IT admins. If they are clueless, they are welcome to come here and ask.  The OP acting as the the mediator has no future.

In reply to Randy Thornton

Re: Moodle 1.9 - how to recover a course and run it locally

by Randy Thornton -
I installed 1.9.19 final release locally via MAMP 3.5.2 with PHP 5.6.10 and MySQL 5.5.42.

The course backup zips do not seem to include each other by default. The backup process skips the Files backupdata folder and does not include its content in the Course files or User files options when you back up.

HOWEVER, if you use the option to "Move to another folder" and move those out of the backupdata folder and then leave the option to include Course files set to Yes, then it WILL include those files in the course backup. Anything outside the backkupdata folder is considered a course file.

So, if you organized your backup zip files that way by moving them out of the backupdata folder, they become regular course files and you could have lots of prior backup files included in your course files, which would certainly inflate any potential backup process. (See screenshot showing this.)

To fix this you just need to move any such folders back under the backupdata folder and then a new backup will exclude them.

I'm not saying this is what has cause the OP course backup in the Gigabyte range, but it certainly would contribute to it if you did things that way.




Attachment screenshot_12279.jpg
Average of ratings: Useful (2)
In reply to Rick Jerz

Re: Moodle 1.9 - how to recover a course and run it locally

by owloptimus primecoke -

Thanks, Rick Jerz for this complete explanation on this. It worked for me.

Average of ratings: Useful (1)
In reply to Randy Thornton

Re: Moodle 1.9 - how to recover a course and run it locally

by Antonio Regina -
Thanks Rick and (again) Randy.
As a teacher I do not know all specs of the server. But I could ask the administrators. The limit of 4GB I guess could be connected to the max file size in zipping (for sure in a FAT32 formatted HDD, or in certain 32bit versions).

I am not an expert of SQL, and I cannot work myself on the server side. But I could ask, if the following is feasible.
a) Is it possible to backup the part of the database connected to just my course (i.e. not all the database in the server).
b) And in this case, is it possible at that point to import (or replace) the database connected to the course locally?
c) If the above two points are possible, is it enough to import with the course database, the moodledata folder of the course or one needs other tweakerings?

Thanks
In reply to Antonio Regina

Re: Moodle 1.9 - how to recover a course and run it locally

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
I wonder if the 4GB limit is a PHP filesize limit? Yes, you could be right that it might have something to do with FAT32, but your server is big, so I would be a little surprised if it is a FAT32 problem. If it is a FAT32, or other, filesize issue, then you would have to explore moving files with the Linux rsyn command. Also, creating a backup of your database could also be a problem with a 4GB limit.

Is your Moodle 1.9 is still working?

Oops, I just see that I misread what you had originally posted. You think that your moodle might be 25GB, not 250GB. That's a big difference. Sorry about that. The good news is that what you want to do should be easier. 

Also, when you say you have a PC, you mean a Windows PC and not a Mac, right?  If Windows, what version are you running?
Is your Moodle server Linux?
How many courses are in your Moodle?

I just noticed Ken's new post, and he is probing the same way.
In reply to Antonio Regina

Re: Moodle 1.9 - how to recover a course and run it locally

by Ken Task -
Picture of Particularly helpful Moodlers

Used to work for K12 entities that didn't have much for tech budget let alone 'screaming servers'.  So I have a tendency to re-use etc.   Having said that ...

But first ... Is this server Windows based?  Version of PHP 32 bit or 64 bit? If Windows and 32 bit php there was a max of 4 Gig backups.

Another thought ... if server is that old ... (as old as the software on it), what does IT department plan to do with this de-commissioned machine?  Scrap for parts? (dunno why they'd do that!).   Are there other teachers/profs that want what you want? 

What if you asked for the entire server?  You get your course(s) and other faculty could also acquire theirs with you doing the work!   You might have to take it home and put it on your home network - which would be private IP only.  And you would have to change some things like FQDN of the server to get the server/moodle to work under something like oldmoodle.lan but that's doable.

However, having said that ... you'd have to understand the above isn't a forever and ever situation ... hardware wears out, memory sticks do fail, NIC's also.   You'd have to shop around for replacement parts (good luck there) or finally send the server to the scrap heap!  By then, hopefully, you've another plan! smile

'SoS', Ken

In reply to Ken Task

Ri: Re: Moodle 1.9 - how to recover a course and run it locally

by Antonio Regina -
Hi again and thanks for your thoughts.
As I mentioned at the beginning, I have a couple of courses there running up to 25GB (not 250!). Though interesting I think it is almost impossibile that the IT office gives me the entire server. Apart for legal issues (I can keep the material of my courses, but not that of others), I fear it could be a very big deal, with more than 500 (if not 1000) courses.

So I could just ask an excerpt of the database concerning my courses, not the rest. Obviously, I could ask if this extraction is possible, and if its restore locally will work. From your feedback, I did not understand exactly how such a process should be carried on. I would like to know more, so to inform the administrators about it.

Locally my Moodle runs on Windows (either 64bit or 32bit). At the moment I do not have details of the type of the server, etc. Just the news that even the administrator was unable to make a full backup. I will ask about the server if this is an important information. But up to now I am looking for if there exists scenarious to make the title of this post work.
In reply to Antonio Regina

Re: Ri: Re: Moodle 1.9 - how to recover a course and run it locally

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Well, now I am seeing more of what you are after. You want to only get "your" courses, and none of the others. And you think that your courses could run up to 25GB. Hmmm, I was taking you down the path of migrating your entire Moodle to your personal computer, but now that doesn't make sense.

So, you might be back to that 4GB limit issue, perhaps something to do with the FAT32 issue, or a PHP setting, or something else. As I think about it, maybe your server has a setting that limits file sizes. Ken would know better than I.

Based upon Ken's question to me about backups in Moodle 1.9 (that screenshot above), you might try a backup without user data just to see what happens.

I wonder why a few courses would consume 25GB. I currently have around 50 courses in my Moodle, and I am up to around 13GB. Were you and your students uploading videos? Or big files? Or a lot of big photos?

So, if you have success doing a backup with no user data, you can think about what user data you want to start adding into your backups. You might know which activities could be the big data consumers, and ignore those. I am going to have to see what Ken thinks.

On the positive side of what I have shared, I have shown that Moodle 1.9 can run on a local computer, if set up correctly.
In reply to Antonio Regina

Re: Ri: Re: Moodle 1.9 - how to recover a course and run it locally

by Ken Task -
Picture of Particularly helpful Moodlers

A Moodle backup of a course is what you need really ... period!

We must have tech info (specs) of server ... so ask server admin's/IT department.

We (I, really), need to know: operating system, version of PHP (and if 32 bit or 64 bit) and version of MySQL ... again ... ask server admin/IT department so we can quit guessing and be more exacting.

There exist a command line only utility knife called 'moosh' that is capable of
backing up courses from command line.

Advantage ... doesn't use web server thus not restricted to Apache settings for
things like time outs.   It's just PHP and MySQL involved.

https://moodle.org/plugins/view.php?id=522

*** The trick here is to find a moosh version that can run under your version of PHP and MySQL.

The moosh command to backup isn't very extensive as to options ... doesn't have a switch to exclude users, for example.  But if site admin setup backup preferences for all backups to no user that would be great!   That should reduced the size of that backup.

If server is 64bit PHP and a Linux flavored box, one could use a moosh command wrapped inside a 'nohup' (no hang up) and it will chug along until it finishes ... did a 130+Gig course that way.   Of course, there wasn't a way to restore that course without manually hacking the xml files of the backup, rebuilding the .mbz, then restoring that hacked .mbz.  Actually 3 hacked .mbz's back into one course.   Pain in the arse!

Your 25Gig course is really not all that large when I look at that K12 site am still supporting.

So to repeat:

need to know operating system, version of PHP (and if 32 bit or 64 bit) and version of MySQL

'SoS', Ken

Also ... is your IT Dept/Server admins adverse to someone gaining remote access to the server via ssh (linux only) and being made part of 'sudo' group so this person with more experience with moodle from cli could possibly assist?  Yes, am talking about myself!   Crazy as I am!!!!


In reply to Ken Task

Re: Ri: Re: Moodle 1.9 - how to recover a course and run it locally

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Years ago, when moving all my old Moodle's to my Odroid XU4 small board computer, I had this same problem of trying to back up one or two of the sites, without success. Copying the moodledata and root code folder were no problem, it was the database that gave me fits. I tried phpMyAdmin multiple times without success. What finally worked was to ssh into the old server, log into mysql, and use the database itself to create a sql dump file. I then went to the new server, logged in to it's database and imported the sql dump file. Worked like a charm so I have kept those sql dumps so I could use them again, if needed.
On that Odroid, I have all the versions of Moodle from Moodle v1.9.19+ to Moodle v3.3.9+ running on mysql v5.7.37 and php v5.6.40.
In reply to AL Rachels

Re: Ri: Re: Moodle 1.9 - how to recover a course and run it locally

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
I had the same experience as you, Al. phpMyAdmin wasn't cutting it. I found that I had to do exactly the same thing, use the MySQL command line interface.

But what I have gathered from Antonio and others is that he doesn't want to migrate his school's complete moodle. All that he wants to do is to backup and restore some of his own courses. He hits this "4GB" limit for some reason. But I am not sure. One path for Antonio to try is to see if he can backup one of his courses but EXCLUDE user data, which should create a much smaller backup.

If Ken could gain access to Antonio's server, I bet Ken would solve this problem very quickly.  And it is extremely kind of Ken to make the offer.
In reply to Antonio Regina

Re: Moodle 1.9 - how to recover a course and run it locally

by Randy Thornton -
2) That's how it works. And so while, it's technically possible to do parts in the database but you would have to be very expert at the database structures to do that because there are very large amount of interdependencies between course, activities, completion tracking, grades, logs, question banks, and all the associated files. You would end up hand coding in SQL the same logic as what the course backup PHP code actually does. And perhaps run into the same issues as well.

3) Yes, I think this is the way to go. Partial backups and a merge restore. See the notes that Ken has below: https://moodle.org/mod/forum/discuss.php?d=433536#p1744491. It seems that Moodle 1.9 can do this okay, but Ken's note about how the backups include backups is important to consider.
In reply to Antonio Regina

Re: Moodle 1.9 - how to recover a course and run it locally

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Huge noise for a small task, or at least for a task that isn't clearly formulated. Here is a template, which you could edit and repost.

Background:
- Your institution wants to decommission a Moodle server which runs rel. 1.9.
- You as a teacher have the teacher role in your courses
- You can count on the support of the IT team, if needed.

What you want to do:
A. Clone the full Moodle site on to your local computer and keep it as an archive. i.e. it will be snap-shot of the prod. Moodle with all the user data, their logs in the database, and above all, will remain at Moodle rel. 1.9. It is for your reference, so not available to anybody else.
OR
B. Identical to A, the only difference being, it will contain only "your" data. i.e. the courses you conducted, all the participants of those courses, their work, logs. Still Moodle 1.9 and available only to you.
OR
C. Identical to B, except that there are absolutely no user data.
OR
D. Identical to A, but running a supported Moodle release, 3.9, 3.10 or 3.11 that is.
OR
E. Identical to B, but running a supported Moodle release, 3.9, 3.10 or 3.11 that is.
OR
F. Identical to C, but running a supported Moodle release, 3.9, 3.10 or 3.11 that is.
OR
something else. But please say what you want, not what you can and know and have tried and failed.
In reply to Visvanath Ratnaweera

Ri: Re: Moodle 1.9 - how to recover a course and run it locally

by Antonio Regina -

@Visvanath, it is very kind of you. 

I doubt it is ever possible to connect remotely to this university Moodle server. It was taken down (and kept only offline) very recently due to war security concerns, accelerating the pre-existent schedule dismissal. I shall ask, however.

Coming to your template:

Case B: run (only) my courses with full data in my local Moodle 1.9 (windows either Win10-64bit or WinXP-32bit), by migrating/copying/cloning them from a dismissed Moodle 1.9 site, which contains hundreds of other courses.

I asked info about Os/php/sql versions  to the IT office. I will let you know, as soon as I have them.


In reply to Antonio Regina

Re: Ri: Re: Moodle 1.9 - how to recover a course and run it locally

by Ken Task -
Picture of Particularly helpful Moodlers

You are between a rock and a hard place!  Acting as a 'middle person' between advisors and IT department isn't a good place to be.   Is there no one in the IT department that could join this conversation?

You should know, that, IF Linux, ssh access can be restricted to specific IP addresses and not open to the global internet thus reducing attack surface.

In addition to operating system and versions of PHP/MySQL, a general description of entire setup would also be nice ... is the server a single standalone ... meaning web server with moodle code + DB server + the storage of moodle files in moodledata ALL on the same physical server?  Or are there dedicated servers for DB and storage - which means there are 3 servers involved.

'SoS', Ken


Average of ratings: Useful (1)
In reply to Antonio Regina

Re: Ri: Re: Moodle 1.9 - how to recover a course and run it locally

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

Before going to the subject, I am sorry for the curt tone in my previous post. I "knew" it was something straightforward and was annoyed by the amount of discussion going on. Glad that you filtered those frequencies out and concentrated on the message.
wink

OK, the case is clear, which is, "Case B: run (only) my courses with full data in my local Moodle 1.9 (windows either Win10-64bit or WinXP-32bit), by migrating/copying/cloning them from a dismissed Moodle 1.9 site, which contains hundreds of other courses." There are two parts to it.

Part I: The administrators of the old Moodle server must give you the data in a standardized format. Moodle had it right from the beginning. It is called a https://docs.moodle.org/19/en/Course_backup. But in this case you can't take the backups you need, Moodle won't allow you extracting user data, the role Teacher does not have the permission. Only site administrators can do it. So you have to send the above link to the IT team. Remind them to keep all https://docs.moodle.org/19/en/Course_backup#Backup_of_user_data flags set. I think that is the default when a site admin takes a course backup. @others, could you please confirm?

Then perhaps you must have to tell the IT team how to find your courses. For that the admin coule open your profile by clicking on your name anywhere in Moodle. On the profile page there is a list of courses you are registered in. So they have to go to each of these and repeat. Each backup is a zip file, which they need to collect and give to you.

That reminds me the 25 GB big courses you have. Well, that is their problem, or a problem you caused. Try to resolve that bilaterally. If the IT folk need helo, they can always ask here. I don't believe you playing the proxy for them will lead anybody anywhere.

Part II: You need to https://docs.moodle.org/19/en/Course_restore them one by one in a fresh (empty) Moodle 1.9. This time you can do it, since you are the site administrator.

Now the next question is how you create a "local Moodle 1.9 (windows either Win10-64bit or WinXP-32bit)". That I don't know. I rarely touch Windows. In the other sub-thread with Randy I explained how I would do that in Debian Linux, taking an ancient release. You don't need a separate computer for that, install VirtualBox on your Windows computer and create a virtual machine. Well, it may not be easy going, if you are not familiar with Linux. You must ask others how to do it Windows native, if that is what you want.

So the path is clear, I hope. Somebody, the IT team and you, must take the path. Sure there are difficult passages. But the people here can help, only if somebody is in that path and ask as things are happening.

> I asked info about Os/php/sql versions  to the IT office. I will let you know, as soon as I have them.

No need, as long as the current Moodle is running. About your own Moodle 1.9? That is still future. The possibilities are documented here: http://www.syndrega.ch/blog/#php-and-dbms-compatibility-of-major-moodle-releases, line 2, Release 1.9.

Watch out, there are also maximum versions for the system software!

In reply to Visvanath Ratnaweera

Re: Ri: Re: Moodle 1.9 - how to recover a course and run it locally

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Visvanath, in your table of versions, what I have found is that my Moodle 1.9 seems to work fine with PHP 5.6.40, and MySQL 5.7.34. I see that you have a "?" for max MySQL. Of course, it's your web page, but as a suggestion, you might want to show something like "(5.7.34)" in the max MySQL column, somewhat indicating that "it seems to work with at least 5.7.34" but might work with even later versions.

I don't run Moodle 1.9 on my PC in XAMPP, I run Moodle 1.9 on my Mac using MAMP6.6. However, if I were to experiment, I see that XAMPP 1.7 can be downloaded, which might provide a successful PHP and MySQL version for Moodle 1.9.
Average of ratings: Useful (1)
In reply to Rick Jerz

Re: Ri: Re: Moodle 1.9 - how to recover a course and run it locally

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Rick

> Moodle 1.9 seems to work fine with PHP 5.6.40

That is what my table http://www.syndrega.ch/blog/#php-and-dbms-compatibility-of-major-moodle-releases says, PHP 5.6 (two digit) means all 5.6.*.

> and MySQL 5.7.34.

Really? 5.7.34 released in April 2021? Ref. https://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-34.html. That would be good news for Moodle 1.9 old-timers!

If that is the case, I will put 5.7 in my table under MySQL max for Rel. 1.9. I don't see a reason why Moodle should run on 5.7.34 and not on 5.7.37.
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: Ri: Re: Moodle 1.9 - how to recover a course and run it locally

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
All I can tell you Visvanath is that MAMP shows 5.7.34, and that is what the environment for Moodle 1.9 shows (see my graphic, above.). It would be nice if someone else could verify this since I am only "one."
In reply to Rick Jerz

Re: Ri: Re: Moodle 1.9 - how to recover a course and run it locally

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Thanks, Rick. I put 5.7? as the MySQL max from Moodle rel. 1.9 to 2.7. The 5.7 for rel. 3.1 was there already.

http://www.syndrega.ch/blog/#php-and-dbms-compatibility-of-major-moodle-releases
(the latest MkDocs seems to have upset the formatting. Will look in to that later.)
In reply to Visvanath Ratnaweera

Re: Ri: Re: Moodle 1.9 - how to recover a course and run it locally

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Visvanath, yes, your update looks fine. Yes, I do run my Moodle 2.9 with MySQL 5.7.34, too. I run my Moodle 2.9 in the same MAMP environment as Moodle 1.9! In my MAMP, I don't know how to upgrade MySQL, so I stick with 5.7.34. And PHP 5.6.40 might be the highest PHP (in the 5 series) that is available.
In reply to Rick Jerz

Re: Moodle 1.9 - how to recover a course and run it locally

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Rick, you've discovered the luckiest combination of PHP and MySQL for a Moodle version march: PHP 5.6.5-37 and MySQL 5.7.x. Moodle rel. 1.9 to 3.3 all will run in that same server! Ref. http://www.syndrega.ch/blog/#php-and-dbms-compatibility-of-major-moodle-releases.

Perhaps even Moodle 1.6 will run, if only a migration. The MySQL 5.7 broke the rel. 1.6 db creation script, because of some trivial SQL syntax changes - from memory - if somebody wants to confirm(?)

In reply to Visvanath Ratnaweera

Re: Moodle 1.9 - how to recover a course and run it locally

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Visvanath, I just tried installing Moodle 1.6 with PHP 5.6.40 and MySQL 5.7.34, and did not have success. I got a lot of database errors. So, this is about the best that I can tell you. It would take me more experimentation to help. I did have fun going through the installation process for Moodle 1.6, seeing a bit of history, yet seeing similarities to the current Moodle 4.0 installation.
In reply to Visvanath Ratnaweera

Ri: Re: Ri: Re: Moodle 1.9 - how to recover a course and run it locally

by Antonio Regina -

>I asked info about Os/php/sql versions  to the IT office. I will let you know, as soon as I have them.

@Visvanath:  this is the answer from IT office:

  • It runs on Linux:  red hat enterprise linux server 6.4
  • Php version: 5.2.17
  • Sql version: 14.14 with distribution 5.1.69 for red hat
They confirmed (but obviously I cannot verify what exactly they did) that as admin were unable to obtain a moodle backup of my courses as well as that the server cannot be put online anymore.  

In reply to Antonio Regina

Re: Ri: Re: Ri: Re: Moodle 1.9 - how to recover a course and run it locally

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
So, Antonio, from how I interpret what you have said, "no course backups" and "cannot put the server back online," it appears that you are "stuck," meaning you can't do what you originally desired to do.

I hate it when these things happen. One must start building their courses from scratch, and not be able to build upon previous knowledge. 😕
In reply to Antonio Regina

Re: Moodle 1.9 - how to recover a course and run it locally

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

> as admin were unable to obtain a moodle backup of my courses as well as that the server cannot be put online anymore

End of the road. The work of a 12-year Moodle veteran is gone, just like that!

I was going to blame your IT staff for that. I think, now I know whom to be blamed. You! Because you refused to find a sustainable work-flow for you images, you have been pestering the IT to run a Moodle 1.9 instance all these years, whereas the institution kept on upgrading their official Moodle. Ref. "static links for images et similar (v.3.5)" https://moodle.org/mod/forum/discuss.php?d=397506#p1603066.

You can't be running outdated software for ever!
sad