What are the oldest backups that version 3.1 can restore?

What are the oldest backups that version 3.1 can restore?

by Timothy Takemoto -
Number of replies: 24

Dear Moodlers,

I am using Moodle 1.6, and 1.8 which work fine, at least until http was phased out in favour of https. I need to move to 3.1 mainly due to the age of the server.

My. 1.6 and 1.8 backups do not restore on a modern 3.1 Moodle.

I can only upgrade my version to 1.9 since the versions of php and mysql are too old for 2.0.

1.9 says

databasemysqlversion 4.1.16 is required and you are running 4.1.18OK
php
version 4.3.0 is required and you are running 5.1.2OK


but 2.0 says

databasemysqlversion 5.0.25 is required and you are running 4.1.18Check
php
version 5.2.8 is required and you are running 5.1.2Check


Does anyone know the oldest backups that current versions of Moodle can restore?

I see that someone had issues restoring backups from a 2.5.2 on a 31.

Backup in a version 2.5.2 and restore in a version 3.1.2

And 1.9 backups did not restore on 2.x (but perhaps this changed)
https://moodle.org/mod/forum/discuss.php?d=192355

Are there any test sites running older versions of moodle.


Tim

Timothy Takemoto 55yrs.

Average of ratings: -
In reply to Timothy Takemoto

Re: What are the oldest backups that version 3.1 can restore?

by Ken Task -
Picture of Particularly helpful Moodlers

Wow!  

Bottom line ... no way ... unless you have a test server of your own (localhost VirtualBox with X Guest OS) that you could dummy down the versions of PHP and MySQL to compat versions just to do old hops.   Trouble with that is ... where would you acquire the old versions of PHP and MySQL (probably Apache also)?  Makers of those do have an archive of old versions for download.   Do a google search for PHP 5.1.x or MySQL 5.0.28:

I'll save you some time:

https://www.php.net/releases/index.php

You'll be scrolling down a long time before you find 5.1.x.

If you note, old versions are available as .tar.gz's **but** may not include all the PHP extensions to run a Moodle! :|  See attached text file for how to build extensions.

For MySQL, it's even more complicated:

https://downloads.mysql.com/archives/community/

So, in that light, there is but one saving grace to your situation ... in your moodledata directory you will find numbered directories.   Those numbers are the course ID's.   Inside those #'d directories, you will find a file directory and inside that, files you have uploaded to those courses by humanly recognizable names (the last time moodle did that was the highest of 1.9 which was .20 if I re-call correctly).

So you could download your moodledata directory, and sort through all those files saving them to some local re-construction of course names.

Then, install a fresh 3.9.highest on a server, rebuild categories of courses to mimic oldsite, start a new fresh course that is named the same as old 1.6.x or 1.8.x course, and rebuild the course.   You have at least the files used in the old course(s).

That is probably the path of least resistance.

Of course any true Moodle guru age 70 or older could argue above and they might have nothing else to do and have all the time in the world (yeah, right) to set up a local VirtualBox server and play for hours and hours to march ... and it would be a march ... a total site backup of what you have,upwards ... painfully ... and with hickups along the road (NO yellow brick!).

Uhhh .... any test site with those old versions on internet would be prime target for take over ... so while one was marching, one would also have to fend off those that would be trying to use your server for other purposes.   Don't think any provider would tolerate that very long once discovered ... and there is no doubt a server like that would be discovered.   That's why I suggested VirtualBox with an OLD OS on your local machine.

Good luck!

'SoS', Ken


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

Re: What are the oldest backups that version 3.1 can restore?

by Timothy Takemoto -
Thank you.

That is a shame.

I don't have all that many files and ftp to my server is pretty quick.
I don't think I can access the new Moodle by ftp however.

The main backup issue is the test -- I mainly use Moodle as a test machine.

I have a lot of categories, about 300 per course. I think that GIFT
became able to import categories so I will look into modifying GIFT
files.
https://moodle.org/mod/forum/discuss.php?d=218950

Or perhaps I could edit the XML of new Moodle Test backups by hand.
In reply to Timothy Takemoto

Re: What are the oldest backups that version 3.1 can restore?

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

Moodle rel. 1.6 was a landmark. Neat, low on resources and de facto a LTS. As Ken already mentioned, marching forward 24 releases(!) is not practicable, definitely not with the user data. My impression is that Moodle 1.9 backups restored robustly in Moodle 2.x. Moving from there, you need to watch for the new (2.2) Assignment format, conversion of question categories and may be few things more.

The move from 1.9 to 2.x was the big obstacle. If your environment supports 1.9, I would give a try by upgrading the 1.6 and 1.8 sites to 1.9 first https://docs.moodle.org/19/en/Upgrading. (Keep backups https://docs.moodle.org/16/en/Site_backup or do on a copy https://docs.moodle.org/16/en/Moodle_migration). Take course backups https://docs.moodle.org/19/en/Course_backup, without user data, and try to restore in to different newer generations of Moodle https://docs.moodle.org/en/Course_restore. For that you need to enjoy installing Linux. I have the whole series of Debian Linux releases as virtual machines any way. I migrate the site from one VM to the other. The march route can be figured out from this (time) table: http://www.syndrega.ch/blog/#php-and-dbms-compatibility-of-major-moodle-releases.

You need to be certain that this automation makes sense. For example, you have a large number of courses. Sometimes it is worth the trouble to edit/update the course content taking in to account the modern tools Moodle has introduced over a period of 15 years. I mean recreating the courses directly in Moodle 3.9 transferring the content manually. It is like resurrecting an essay you wrote when your vocabulary was only 1'000 words vs rewriting it with your current vocabulary to 50'000(!) words.
wink
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: What are the oldest backups that version 3.1 can restore?

by Timothy Takemoto -
Thank you. I will try upgrading to 1.9. What is the chance that 1.9 will
import into 3.1 (which my university is using)? Or if I can find or build
a 2.x will backups from that import to 3.1?

I don't need the assignments.

I pretty much only use tests, so my Moodle "vocabulary" has not
increased much.

In fact, my 1.6/1.8 were fast enough to provide vocabulary tests which
need to be fast (10 matching pairs in 1 minute) to have any meaning.
The university Moodle 3.1 seems to be too slow to provide quick
matching tests, so my Moodle vocabulary has in a sense decreased.

I could export all 300 of my categories' questions to GIFT, and
then merge them into one file to import questions and categories together.
I think I would only need to manually modify the **category names**

I have hacked the import page to increment the category for when I
was importing a lot of questions. I think it would not be difficult
to hack the export page, so it increments the category, so that I can
download my 300 categories per course, and the questions they
contain to GIFT files, quite quickly.

// question: 0 name: Switch category to $course$/2021.1.1031130017 のデフォルト/test category2
$CATEGORY: $course$/2021.1.1031130017 のデフォルト/**test category2**


// question: 842295 name: test4
::test::[html]

test

{
~A
~B
~C
=D
}


// question: 0 name: Switch category to $course$/2021.1.1031130017 のデフォルト/test category3
$CATEGORY: $course$/2021.1.1031130017 のデフォルト/**test category3**


// question: 842295 name: test5
::test::[html]

test

{
~A
~B
~C
=D
}
In reply to Timothy Takemoto

Re: What are the oldest backups that version 3.1 can restore?

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Now we have to differentiate amoung the various types of content:

- Question categories
I would say, Moodle XML will allow you a lossless migration to any newer version - privided you haven't used all sorts of fancy question types and behaviours. OK, there was a format conversion somewhere in the 2.x generation. Please ask in the Quiz forum.

- Remaining content
What are they? You said no Assignments. Then, uploaded files? Moodle Page and Book resources? Try taking course backups in the 1.9 selecting only those components you need and try restoring in to the institutions 3.1.

Side note: Your institution is not bleeding edge. Support for 3.1 ceased two years ago!

Sorry for the decrease in vocabulary. Happens with advancing age.
wink
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: What are the oldest backups that version 3.1 can restore?

by Timothy Takemoto -
Thank you. I am more familiar with GIFT than XML so I think I will go with that to create the categor ies and questions.

As mentioned above I need to export all my questions and the code to increment the category by one each time, so Ican do it quickly and not miss any is the single line after my // comment line (which I copied from import.php in questions, since I had already hacked the latter to autoincrement)

echo "
$download_str
";
echo "
$downloadextra_str
";
// Takemoto goes onto the next category
$SESSION->questioncat = $categoryid+1;
print_continue("edit.php?courseid=$course->id");
print_footer($course);
exit;
}

The only other thing I really need to move is the files. I will try a backup of only files.
I am also asking my moodle admin for temporary ftp access to moodledata.

> Sorry for the decrease in vocabulary. Happens with advancing age.

I wonder if it were possible ONE DAY for admins or even teachers
to be able to turn off functionality in a course, so that some courses
can be light fast courses.

Thanks again,
Tim
In reply to Timothy Takemoto

Re: What are the oldest backups that version 3.1 can restore?

by Timothy Takemoto -
Ah, but come to think of it. The GIFT format can only create questions and categories so perhaps I will try editing XML.
TT
In reply to Timothy Takemoto

Re: What are the oldest backups that version 3.1 can restore?

by Timothy Takemoto -
No that is not going to work either because, as Ken Task points out elsewhere, the backup files are not humanly readable. There is some XML at the beginning but it turns into gobbledegook in the middle.

The mbz files are gzip files which one can decompress and turn into zip files here
https://extract.me/

I think I am going to have to rebuild quizzes one by one. I have about 50 per course.
In reply to Timothy Takemoto

Re: What are the oldest backups that version 3.1 can restore?

by Ken Task -
Picture of Particularly helpful Moodlers

In that case ... upgrade to 1.9.highest first.   That was the first recommended step when migrating to version 2.x anyway.

Still, potential catch 22 even with your hack ... somewhere around version 2.3 up until early 3.x there was in existence a new admin item called 'quiz upgrade helper'.   So some massive changes took place in quiz.   Do know if one waited too late, issues not resolved and fix was to delete the quiz in question and rebuild it.

So suggest looking at making a backup in which ever old version of two courses and select only the quizzes for the backup ... no users, no students, no other content ... just quizzes.   In your older versions of Moodle, that will create .zip backups.   Download both backups.  Unzip into different folders/directories.   Compare the questions.xml flie of both backups.   Same size?  Same content?

A tool was added in version 2.2 -> called 'health' ... it checked the health of ... guess what ... the quiz bank.  Not linked in the admin menu so one had to know of it's existence to run it via url line of browser.

If it found issues, would list brief description of what and then provide a 'Solutions' button.   Solutions were sql quries to fix the issues and most of the time those worked.   Have been into some sites however where it would report too difficult to determine and recommended posting details in the quiz forum for possible resolution to the issues.

To get such tools might be a good option to upgrade to 1.9.highest then at least to 2.2.highest ... which was the recommended steps in migration upwards anyway.   That way, one acquires that health tool and the quiz upgrade helper.  Of course, there might be a need to upgrade PHP/MySQL also as well as DB structure (innodb) soooooo

Again ... best of luck!

'SoS', Ken


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

Re: What are the oldest backups that version 3.1 can restore?

by Timothy Takemoto -
Thank you. The health thing sounds great. I wish I had had that because on two occasions over the past 15 or so years I have had to rebuild my quizzes due to crashes during restores that messed with the quiz bank.

I think that I am just going to use GIFT to move my categories and quizzes over.

Thanks again,

Tim
In reply to Timothy Takemoto

Re: What are the oldest backups that version 3.1 can restore?

by Timothy Takemoto -
Responding to myself. As Ken Recommends, someone over at Moodle in Russian updated a 1.6.2 Moodle backup to 1.9 and found that it could be used on a variety of newer moodles.
This is the thread in Russian
https://moodle.org/mod/forum/discuss.php?d=378625
This is an autotranslation
https://translate.google.com/translate?hl=en&sl=ru&tl=en&u=https%3A%2F%2Fmoodle.org%2Fmod%2Fforum%2Fdiscuss.php%3Fd%3D378625
They just used the Windows installable package (Apache, Php, Mysql) to update the backup, and that WORKS!

I am attempting to install Moodle on this my windows machine now.
The install stopped with a white screen. Perhaps it needs to be on my C drive.
(Yes, or rather there was the option to change to another drive but I did not change it)
And I did not create moodledata and did not give apache permissions.
Now I have given write permission to everyone but I am still white screening out.
I have installed moodle on my Windows before. I tried making the moodle directory writable by everyone too.

This thread is great on getting Moodle on Windows to work
https://moodle.org/mod/forum/discuss.php?d=100820

 Using a config.php in the moodle directory I got as far as not being able to connect to the database. I guess that there is no

user "root" with password "password"

I tried user root and no password but still database connection failed.


This would be a cool way of updating my backup files.

TT

My config.php is currently
<?php /// Moodle Configuration File

unset($CFG);

$CFG->dbtype = 'mysql';
$CFG->dbhost = 'localhost';
$CFG->dbname = 'moodle';
$CFG->dbuser = 'root';
$CFG->dbpass = '';
$CFG->dbpersist = false;
$CFG->prefix = 'mdl_';

$CFG->wwwroot = 'http://localhost';
$CFG->dirroot = 'C:\Moodle\server\moodle';
$CFG->dataroot = 'C:\Moodle\server\moodledata';
$CFG->admin = 'admin';

$CFG->directorypermissions = 00777; // try 02777 on a server in Safe Mode

require_once("$CFG->dirroot/lib/setup.php");
// MAKE SURE WHEN YOU EDIT THIS FILE THAT THERE ARE NO SPACES, BLANK LINES,
// RETURNS, OR ANYTHING ELSE AFTER THE TWO CHARACTERS ON THE NEXT LINE.
?>
In reply to Timothy Takemoto

Re: What are the oldest backups that version 3.1 can restore?

by Timothy Takemoto -
I am trying to install the XAMP windows installer for 1.9 on my home computer too.
If I don't add a config.php then I get a white screen.
If I do add a standard config.php like the below , then I get "Error: Database connection failed."
<?php /// Moodle Configuration File

unset($CFG);

$CFG->dbtype = 'mysql';
$CFG->dbhost = 'localhost';
$CFG->dbname = 'moodle';
$CFG->dbuser = 'root';
$CFG->dbpass = 'password';
$CFG->dbpersist = false;
$CFG->prefix = 'mdl_';

$CFG->wwwroot = 'http://localhost';
$CFG->dirroot = 'C:\Moodle\server\moodle';
$CFG->dataroot = 'C:\Moodle\moodledata';
$CFG->admin = 'admin';

$CFG->directorypermissions = 00777; // try 02777 on a server in Safe Mode

require_once("$CFG->dirroot/lib/setup.php");
// MAKE SURE WHEN YOU EDIT THIS FILE THAT THERE ARE NO SPACES, BLANK LINES,
// RETURNS, OR ANYTHING ELSE AFTER THE TWO CHARACTERS ON THE NEXT LINE.
?>
In reply to Timothy Takemoto

Re: What are the oldest backups that version 3.1 can restore?

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Sorry for responding so late as I've been busy with other life complications. If you upgrade any Moodle 1.x to the latest Moodle 1.9.19 and then make backups in the 1.9.19, they will restore into almost any later version of Moodle. I have never tried restoring into any Moodle 2.x but starting back at Moodle 3.2 I participated in each new versions QA Testing. One of the tests I have performed more than once is to take a Moodle 1.9.19 backup and restore it into the new Moodle. It has worked just fine each time. Note that the Assignments (assignments) in Moodle 1.9.19 are restored as the new version Assignments (assign) when you do this.
Average of ratings: Useful (2)
In reply to AL Rachels

Re: What are the oldest backups that version 3.1 can restore?

by Timothy Takemoto -
Thank you AL

I can't get XAMPP on windows 10 to work (there are people all over the Internet with the database connection error problem) but I will install 1.9.19 on my old sever and see if my 1.6 and 1.8 backups will restore there, and update one of the moodle installations to 1.9.19 if not.
In reply to Timothy Takemoto

Re: What are the oldest backups that version 3.1 can restore?

by Timothy Takemoto -
I installed 1.9.7 (! I think that is what it said) on my server in an empty database. Backed up a file on my old 1.6 or 1.8 and then sucessfully restored it on my university's newish moodle
(which I think is 3.1 but I am not entirely sure).

I then I uploaded the 1.9 backup to a new (3.1?) test server and after conversion the
restore can see what the activities the old course and suggests that it will be able
to restore them. It is executing now. It is taking a Long time.

It is spending a very long time at 99.37% with 3.76 seconds to go - about 30 minutes
and the course that I am restoring to is still empty. Drat -- so near and yet so far.

Someone else has a similar problem getting to 99.37% on a backup not restore, and the problem is being unable to read from a database.
https://moodle.org/mod/forum/discuss.php?d=267117


I may try backing up and restoring only the quizzes or try updating the databases of my older moodles by putting moodle 1.9 on top of them.

[With regard to XAMPP --- it is a shame that folks can't seem to get these installers to
work these days since they would be useful in many ways.
I think it is probably a permissions issue. I changed both moodle and moodledata to be read-writeable by "Everyone" (there is no "nobody" nor "apache" to select) but I still have to create my own config.php which suggests that appache is not able to write to moodle, so equally Mysql probably can't write to moodledata.]
In reply to Timothy Takemoto

Re: What are the oldest backups that version 3.1 can restore?

by Timothy Takemoto -
Yes! It works if
1) Backup on 1.6
2) Restore on 1.9
3) Backup only quizzes and course files on 1.9
4) Restore on 3.x

The other stuff should not be difficult to recreate. I think it is probable that labels will go to. Perhaps it was something minor like roles, which I accidentally included in the 1.9 backup though they don't exist in 1.6. If the quizzes go across then I am okay. Thanks everyone!

No. wait. Everything went across, but only when I did the second restore. The first restore got almost to the end but did not finish. Then I restored only the quizzes which allowed the first restore to finish. This means I have the quizzes twice! But next time I can just restore a label or something to get the first restore to finish.


In reply to Timothy Takemoto

Re: What are the oldest backups that version 3.1 can restore?

by Timothy Takemoto -
The assignments were not restored but that does not matter.

1) Backup on 1.6
2) Restore on 1.9
3) Backup omitting assignments (and anything else unneeded.)
4) Restore on 3.x
5) Backup and restore a label or something to get the previous restore to finish.
In reply to Timothy Takemoto

Re: What are the oldest backups that version 3.1 can restore?

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Timothy, I made a video presentation a few years back about installing MAMP and XAMPP. Maybe it will help. However, I haven't checked recently to see if anything has changed with XAMPP. I don't use XAMPP and instead use MAMP on my Mac, which is currently working.

Average of ratings: Useful (1)
In reply to Rick Jerz

Re: What are the oldest backups that version 3.1 can restore?

by Timothy Takemoto -
Thank you very much Rick
But I would really like to use the XAMP moodle for windows packages that are downloaded from the moodle site. They used to be 1 click to install.
https://download.moodle.org/windows/

I intend to use a sandbox Moodle on Windows to change my course dates at the beginning of term since my university does not have a course date changer type module installed, though I believe one exists for 3.x Moodle. The course date changer was a big reasons why I remained on 1.6 and 1.8 for so long.
In reply to Timothy Takemoto

Re: What are the oldest backups that version 3.1 can restore?

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Timothy, your plans to use a Sandbox to configure your course and then upload it to your production Moodle seem fine, but your success could depend upon both Moodles having the same configuration (version, plugins, etc.) It is worth a try. I wouldn't put much faith in moving a 1.8 course into 3.x, but again, it's worth a try.

Yes, I know what you mean about downloading and installing from the Moodle Windows installer. I have never had luck with it. Things do change over time, and I have not tried it recently to see if it now works. As I recall, my problem was with the PHP intl module, which was missing and I could figure out how to manually install it.
In reply to Rick Jerz

Re: What are the oldest backups that version 3.1 can restore?

by Timothy Takemoto -
I have managed to port my 1.6 and 1.8 course to a new(ish) moodle by going via 1.9 (that I loaded onto my server) as recommended here and by the Russians.

I will open a new thread about the XAMP Moodle for Windows packages if I have problems with them. Thanks again.
In reply to Timothy Takemoto

Re: What are the oldest backups that version 3.1 can restore? [RESOLVED]

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

Hi Timothy

Glad that you could RESOLVE the matter via Moodle 1.9.

<OT> What scared me was the Russian connection. Are we in the spy drama "Aide Caught Red-Handed In Russia Back Channel"? It is all over the web.</OT>
smile