Assistance with restoring a backup requested ...

Assistance with restoring a backup requested ...

Russell Thomson -
回帖数:39

Am trying to set up a new Moodle 3.8.1+ on OVH VPS.
New server meets specs for PHP version + extensions as well as DB version.

Have backup .mbz files from my old site also hosted on OVH shared hosting.  When attempting to use a .mbz file on new server using Dropbox as the source for backup files, restoring debug shows:

Debug info: Header does not have POSIX ustar magic string
Error code: errorprocessingarchive

Stack trace:

line 290 of /lib/filestorage/tgz_extractor.php: moodle_exception thrown
line 223 of /lib/filestorage/tgz_extractor.php: call to tgz_extractor->process_header()
line 142 of /lib/filestorage/tgz_extractor.php: call to tgz_extractor->extract_or_list()
line 648 of /lib/filestorage/tgz_packer.php: call to tgz_extractor->extract()
line 106 of /lib/filestorage/mbz_packer.php: call to tgz_packer->extract_to_pathname()
line 325 of /backup/util/ui/restore_ui_stage.class.php: call to mbz_packer->extract_to_pathname()
line 297 of /backup/util/ui/restore_ui_stage.class.php: call to restore_ui_stage_confirm->extract_file_to_dir()
line 116 of /backup/restore.php: call to restore_ui_stage_confirm->process()

My questions:
1. what does the above mean in 'english'?
2. if anyone host on OVH VPS, have you had similar issues?
3. IF you've contacted OVH help desk did you get any help?

回复Russell Thomson

Re: Assistance with restoring a backup requested ...

Russell Thomson -
Also:
Error: mdb->get_record() found more than one record!
line 1599 of /lib/dml/moodle_database.php: call to debugging()
line 1487 of /backup/util/dbops/restore_dbops.class.php: call to moodle_database->get_record_sql()
line 1616 of /backup/util/dbops/restore_dbops.class.php: call to restore_dbops::precheck_user()
line 156 of /backup/util/helper/restore_prechecks_helper.class.php: call to restore_dbops::precheck_included_users()
line 420 of /backup/controller/restore_controller.class.php: call to restore_prechecks_helper::execute_prechecks()
line 992 of /backup/util/ui/restore_ui_stage.class.php: call to restore_controller->execute_precheck()
line 367 of /backup/util/ui/restore_ui.class.php: call to restore_ui_stage_process->process()
line 131 of /backup/restore.php: call to restore_ui->requires_substage()
回复Russell Thomson

Re: Assistance with restoring a backup requested ...

Rick Jerz -
Particularly helpful Moodlers的头像 Testers的头像
I don't know. But I do wonder what version of Moodle is your backup? My guess is that because Moodle is always improving, that you might not be able to simply restore your old backup into a new Moodle. It could be like saying "how do I put the engine of my Modle-T ford into this year's Mustang?"

You might need to restore your old backup into an old version of Moodle, and then do a series of upgrades.

I am not the expert at these things, but I am just giving you some of my ideas.
回复Rick Jerz

Re: Assistance with restoring a backup requested ...

Howard Miller -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像

"might not be able to simply restore your old backup into a new Moodle"

It may be nothing to do with this but that's always not true. It is "guaranteed" that older versions of backups restore into newer versions of Moodle. If it doesn't work then it's a bug. 

The reverse (obviously - I hope) is not true. 

回复Howard Miller

Re: Assistance with restoring a backup requested ...

Russell Thomson -
Quizzes and resources backed up Moodle 3.8.1+ (Build: 20200117) are being restored in Moodle 3.8.1+ (Build: 20200221)
回复Russell Thomson

Re: Assistance with restoring a backup requested ...

Howard Miller -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像
Looking at the code for the above - it is trying to extract the record of a user from the database. It is finding multiple records for the same user based on a number of criteria. The code is quite old so not very likely it's a bug in the code.


I appreciate that this doesn't help you that much. Further debugging would be required followed by some digging in the database. 
回复Howard Miller

Re: Assistance with restoring a backup requested ...

Visvanath Ratnaweera -
Particularly helpful Moodlers的头像 Translators的头像
A simple control experiment would be to restore the course without user data.

If that works and you must migrate the users too, you need to unzip the mbz and read the resulting XML. it would also be useful to know the Moodle release in which the backup was made.
回复Visvanath Ratnaweera

Re: Assistance with restoring a backup requested ...

Ken Task -
Particularly helpful Moodlers的头像

Well, I told OP and myself I'd not respond but can see what's being suggested is beyond OP's abilities and would take a different platform.   Soooo ... the following is technical (highly).   I kept a troubled backup from old system OP was attempting to restore to new system.  Have re-visited the troubled backup which cannot be restored to new OVH VPS 3.8.1+ server.

Here we go ... hold on to your hats!

Have one of your troubled backups on my workstation for testing purposes.

Kens-MBP-2:russelbutest kentask$ ls -l
total 558608
-rw-r--r--@ 1 kentask  staff  272646215 Dec  4 06:26 backup-moodle2-course-12-c1course-20191201-1145-nu.mbz

File name shows nu in it ... no user.
Date is from Dec. 2019.

In attempting to extract a users.xml and a mooodle_backup.xml file from the
mbz:  Note: if.a valid backup moodle_backup.xml would be present ... it acts
as a roadmap for restores.

Command:
tar zxvf backup-moodle2-course-12-c1course-20191201-1145-nu.mbz moodle_backup.xml users.xml

reports:

tar: users.xml: Not found in archive
tar: Error exit delayed from previous errors.
Kens-MBP-2:russelbutest kentask$ file -b *.mbz
gzip compressed data, from Unix, original size modulo 2^32 318411776 gzip compressed data, unknown method, ASCII, has CRC, extra field, has comment, from FAT filesystem (MS-DOS, OS/2, NT), original size modulo 2^32 318411776

The users.xml not found expected as it's a no user backup.
No moodle_backup.xml however indicates issues.
And one can see info like ASCII CRC check extra field has comment? and from
FAT file system ... MS-DOS/OS NT (ugh!)

A command just to list contents of the .mbz works

tar -tzf backup-moodle2-course-12-c1course-20191201-1145-nu.mbz
Present are:

moodle_backup.xml
moodle_backup.log

.log 0 bytes
.xml file shows:
backup-moodle2-course-12-c1course-20191201-1145-nu.mbz
3.7.3 (Build: 20191111)

questions.xml

LARGE: 19963886 Dec  1 04:43 questions.xml

Contained therein references to mp3 audios

Listening%204%20-%20Complete%20%281%29.mp3

In extracting files.xml and searching for the above name:
Listening%204%20-%20Complete%20%281%29.mp3" not found

Listening 4 - Complete (1).mp3
contenthash:
d0feedf3b1718283919c06544d486aeb0a054f15

can play the .mp3 from mac command line but only if I rename the .mp3 file
and remove the (1) from the name.

When viewing editing the quiz on old system and the audio file embedded noticed 3 audio files .... one like name.mp3 ... two more like name(1).mp3 and name(2).mp3 ... to make things worse ... names had spaces in them ... assume single space ... the %# references above in the name: Listening%204%20-%20Complete%20%281%29

Not having the files locally and not knowing if OP had a local copy of those .mp3 files left them alone.

The strange behavior on old sever, some of those mp3's would play and some would not.

Took one of those backups and restored to a 3.8.x on RS ... not OVH/Plex Linux.  Extracted all mp3 files to look at their mimetypes and what was discovered:

MPEG ADTS, layer III, v1, 192 kbps, 44.1 kHz, 2x Monaural
MPEG ADTS, layer III, v1, 128 kbps, 44.1 kHz, JntStereo
MPEG ADTS, layer III, v1, 128 kbps, 44.1 kHz, JntStereo
MPEG ADTS, layer III, v1, 128 kbps, 44.1 kHz, JntStereo
MPEG ADTS, layer III, v1, 128 kbps, 44.1 kHz, JntStereo
MPEG ADTS, layer III, v1, 128 kbps, 44.1 kHz, JntStereo

Course restore on RS 3.8.1+ just fine but ...

"Playing of audios on it just as broken as your site ... and there is
no bandwidth usage restriction on my site like yours ...
conclusion ... you are going to have to re-record or re-upload those audio's
one at a time am afraid as there is no tool to upload a bunch nor convert a bunch."

I'll reserve comments on OVH VPS hosting Debian/PlexLinux cept to say it appears to be a lot like NT 4.0!  Ugh!  Cough! Spit! ... but that's my 'prejudice'! :|

There ya have it!

'SoS', Ken


回复Ken Task

Re: Assistance with restoring a backup requested ...

Russell Thomson -

Hi Ken, In ENGLISH I am trying to add questions from the question bank and as soon as I press the add button I get:

回复Russell Thomson

Re: Assistance with restoring a backup requested ...

Ken Task -
Particularly helpful Moodlers的头像

??? ... are we using TinyMCE with an addon that is no longer compatible with 3.8?

Clicking the X to close (might have to click multiple times) that popup eventually allows you to move forward, correct? 

Might cancel attempt to create new until you can turn on debugging to see if Moodle will provide more info.

BTW .. am certainly NOT the 'last word' on issues ... please don't 'single me out' ... others might be trying to be too polite and may not respond thinking you want 1to1 with me. 微笑

'SoS', Ken

回复Ken Task

Re: Assistance with restoring a backup requested ...

Russell Thomson -
The Tiny MCE I thought was removed: anyway, I haven't touched it. It doesn't move forward, well not after 15 minutes. Debugging didn't produce anything.
回复Russell Thomson

Re: Assistance with restoring a backup requested ...

Ken Task -
Particularly helpful Moodlers的头像

Does the same thing happen in DEV?

And debugging produces no more info?

Well, then the only other place for more info is in Plex interface error log.  Your server does have 'extra protections' ... like mod_security ... which, if turned on might throw something that is really misleading.  IF you turn something off in Plex, remember where you did it.  Try it again.  If no change then whatever you turned off, turn on again.   Just don't change a bunch of things all at once ... one at a time.

New quiz in an existing quiz bank?   Of question type?

Can you record each and every step that leads to the popup box? and share back those steps?  In your screen shot can barely see in the background ... 'add from the question bank at the end' ... what is that?

Did the quiz questions come from a restored backup from .com?

'SoS', Ken


回复Ken Task

Re: Assistance with restoring a backup requested ...

Russell Thomson -
Doesn't happen in DEV. No more info from debug. Have not touched anything in Plesk.
Steps in ENGLISH: B2: Upper Intermediate - choose: Reading and Use of English - 1 hour 15 minutes - Edit quiz - Add (Popup menu) from Question bank. Produces error.
I was surprised to find them. When I was manually entering a quiz I notice many questions in a category I hadn't created and when I investigated a lot of questions in the question bank.
回复Russell Thomson

Re: Assistance with restoring a backup requested ...

Ken Task -
Particularly helpful Moodlers的头像

Well those questions came from somewhere ... I certainly did not create them.

However, might have stumbled upon ... looking your server logs ... the reason ...

In your servers proxy_error_log

2020/03/13 18:09:52 [error] 8200#0: *16345 FastCGI sent in stderr: "PHP message: PHP Notice:  Undefined offset: 37441 i
n /var/www/vhosts/domain/russell-" while reading upstream, client: IP, server: russell-english.e
s, request: "GET /elearning/question/category.php?courseid=45&movedowncontext=1537&tocontext=739&sesskey=gLo24H4IGH HTT
P/2.0", upstream: "fastcgi://unix:///var/www/vhosts/system/domain/php-fpm.sock:",
host: "www.domain", referrer: "https://www.domain/elearning/question/category.php?courseid=45"

How about it guys/gals in Moodle la-la-land ... does his server need a proxy config?   And if yes ... how 2, please ... for the OP to follow.

'SoS', Ken

回复Russell Thomson

Re: Assistance with restoring a backup requested ...

Ken Task -
Particularly helpful Moodlers的头像

Wait a minute ...

"Doesn't happen in DEV"

Do you have 'B2: Upper Intermediate" course restored in DEV?

If you do does it have the same quiz module?

DEV and Elearning are both the same version of Moodle and running in the same environment.  So ... am gonna assume that if it works with DEV ... it should work with eLearning.

BUT ... think I'd test in DEV first.

'SoS', Ken

回复Ken Task

Re: Assistance with restoring a backup requested ...

Ken Task -
Particularly helpful Moodlers的头像

From your elearning on new server.

backup-moodle2-course-45-first-20200313-2308-nu.noquiz.mbz     13/03/20, 23:10    968MB
backup-moodle2-course-45-first-20200314-0134-nu.mbz     14/03/20, 01:35    999.4MB
backup-moodle2-course-6-4restores-20200306-1308-nu-nf.mbz     6/03/20, 13:08    3.4KB   


Download all to sos.sosoftexas.org and extracted all the files from the nu backup. The third backup file above ... nu-nf - had no files and no users.  3.4 KB ... nothing but structure of a course ... sections, etc.

The nu-noquiz backup is misleading.  There no real quizzes in the course.
You have titled assignments as 'blah blah blah quiz'.

You can access via this URL.
https://sos.sosoftexas.org/russell/

https://sos.sosoftexas.org/russell/cid45firstnu/
Play/view files in:
https://sos.sosoftexas.org/russell/cid45firstnu/extracted/

Use any browser - FireFox, Safari, Chrome
Click on any link to an image file.  Does it render?

IF it doesn't ... corrupted file ... moodle code on backups/restores cannot fix
corrupted files ... of any type.

Click on any link to an audio file.  Does it play?

IF it doesn't ... corrupted file ... moodle code on backups/restores cannot fix
corrupted files ... of any type.

Example of corrupted file:

'SoS', Ken

回复Russell Thomson

Re: Assistance with restoring a backup requested ...

Ken Task -
Particularly helpful Moodlers的头像

Ok, maybe we could impose upon Visvanath Ratnaweera  (Debian) and/or Howard Miller who did say he'd had some experience with OVH/Plesk.

IF they agree to take a deeper look at this and IF DEV site is doing same thing, you could create manual accounts for either/both gentleman and set them to admin levels on DEV.

Do consider that this thread started with restoring backups from your .com site which has issues ... and more than likely, quiz bank issues as well - just now rearing their ugly heads.

Even if one were to restore a .com backup successfully, quiz bank comes with those restores - in whatever state those quiz banks are in the .mbz files.

This to suggestion ... broken quiz bank in .com .mbz backup file ... restores broken quiz bank in new/elearning or in DEV.

'SoS', Ken

回复Ken Task

Re: Assistance with restoring a backup requested ...

Russell Thomson -
This is caused by the restores of part of the question bank. This didn't happen in DEV when I tried it before but I'm sure that is because there are no questions in that category. I've just tried it with some question that are in System and the same thing happens. If you add a question and change the 'select a category' to one of the system categories with quizzes it happens.
I am sure this is importing the problem from the .com quizzes. Unless a solution can be found, I'll need to reconstruct the whole Moodle.
I'll create admin level accounts as soon as they are needed.

In the question bank under categories, I thought I might be able to move the categories to System and then add the questions but when I tried to move the categories down to system I received the following:

Notice: Undefined offset: 36289 in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 588

Warning: Invalid argument supplied for foreach() in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 590

Notice: Undefined offset: 36290 in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 588

Warning: Invalid argument supplied for foreach() in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 590

Notice: Undefined offset: 36291 in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 588

Warning: Invalid argument supplied for foreach() in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 590

Notice: Undefined offset: 36292 in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 588

Warning: Invalid argument supplied for foreach() in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 590

Notice: Undefined offset: 36293 in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 588

Warning: Invalid argument supplied for foreach() in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 590

Notice: Undefined offset: 36294 in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 588

Warning: Invalid argument supplied for foreach() in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 590

Notice: Undefined offset: 36295 in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 588

Warning: Invalid argument supplied for foreach() in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 590

Notice: Undefined offset: 36296 in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 588

Warning: Invalid argument supplied for foreach() in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 590

Notice: Undefined offset: 36297 in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 588

Warning: Invalid argument supplied for foreach() in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 590

Notice: Undefined offset: 36298 in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 588

Warning: Invalid argument supplied for foreach() in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 590

Notice: Undefined offset: 36299 in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 588

Warning: Invalid argument supplied for foreach() in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 590

Notice: Undefined offset: 36300 in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 588

Warning: Invalid argument supplied for foreach() in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 590

Notice: Undefined offset: 36301 in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 588

Warning: Invalid argument supplied for foreach() in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 590

Notice: Undefined offset: 36302 in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 588

Warning: Invalid argument supplied for foreach() in /var/www/vhosts/russell-english.es/russell-english.es/elearning/lib/questionlib.php on line 590 
....
回复Ken Task

Re: Assistance with restoring a backup requested ...

Visvanath Ratnaweera -
Particularly helpful Moodlers的头像 Translators的头像
Hi Ken

Heard the call. Sorry, we are deep in the Corona crisis. The infrastructure is shutting down at the rate of a solar eclipse. Trying to keep the virtual world going. Never seen a desperate situation like this, in this country.

Even without all that, I am not too inclined to jump in, Debian or not. The OP hasn't responded to my suggestions and seem to meander, pulled by an unknown logic. So, I'll pass.
回复Ken Task

Re: Assistance with restoring a backup requested ...

Russell Thomson -
Moodle 3.8.2
When I backup my files I get the following message:
The backup April 2, 2020 12:07 AM was created and can be restored, although some minor issues occurred.
The log file is as follows:
WARNING: (Database object 'moodle') Unable to make database dump. Error: Failed to exec mysqldump: mysqldump: Got error: 1932: "Table 'moodle.mdl_tag_correlation' doesn't exist in engine" when using LOCK TABLES
How can I fix this error?
Regards
回复Russell Thomson

Re: Assistance with restoring a backup requested ...

Ken Task -
Particularly helpful Moodlers的头像

'Fix' ... dunno for sure, however ...

First, it says mysqldump was created and can be restored, but had minor issues.

Can you restore the SQL dump you made to another database?

Second ... the error that a table (mdl_tag_correlation) in the 'moodle' database. doesn't have an engine ... but only when using 'lock tables'.

So if you made a myqldump without using lock tables what happens?

https://kb.virtubox.net/knowledgebase/backup-your-databases-with-mysqldump/
which has a section that says:

Disable tables locking during the dump

By default, mysqldump will lock the table of your database during the dump process to make sure there will not have new data added during this time-frame.
But it may impact your applications during the dump, because it will not be possible to read/write/update data inside the locked table.

Nowadays,MySQL servers are running with the storage engine InnoDB by default, and it provide the ability to perform backup with mysqldump without locking tables.


To dump your databases without locking tables, you can use the flag --single-transaction with mysqldump. It will automatically turn off the option --lock-tables and perform a snapshot by dumping all tables in a single transaction.

And third ... what if you tried using PHPMyAdmin?  Taking into account what's above about locked tables.

'SoS', Ken

回复Russell Thomson

Re: Assistance with restoring a backup requested ...

Ken Task -
Particularly helpful Moodlers的头像
Fixed! ...
2 scripts existed for backing up elearning ... one for DB ... that script had --single-transaction in the script. Results:
-rw-r--r-- 1 root root 73977066 Apr 2 22:08 /mnt/data/backups/elearningmoodle-20200402220754.sql

The buelearning script created back in March had a line for DB dump that did not have --single-transaction but now does:

-rw-r--r-- 1 root root 678696960 Apr 2 22:09 /mnt/data/backups/elearningcode-20200402220947.tar
-rw-r--r-- 1 root root 16377569280 Apr 2 22:16 /mnt/data/backups/elearningdata-20200402220950.tar
-rw-r--r-- 1 root root 73977066 Apr 2 22:08 /mnt/data/backups/elearningmoodle-20200402220754.sql

If you used some tool in Plesk interface, add option for single_transaction.

'SoS', Ken
回复Ken Task

Re: Assistance with restoring a backup requested ...

Russell Thomson -
Thanks Ken. With the quarantine, I've had a lot of time to input the data from the .com website. I've recreated about 70% and most of the quizzes with audio and all the books with audio. The curious thing is the first HD has 12.6G used, 12.5% of capacity. and the second has 35.6G used, 35% of capacity. When you were fixing everything there was no space to do anything but now the total used is only 48G. I wonder where the missing Gs have gone.
Thanks again and best regards,
Russell
回复Ken Task

Re: Assistance with restoring a backup requested ...

Russell Thomson -
Hi Ken,
When my first HD was full, you moved files to an additional HD. I have used 12% of the capacity of the first and 36% of the second. Could you tell me how to move the files on the additional disk back to the main disk so that I have everything on the main disk?
Regards
Russell
回复Russell Thomson

Re: Assistance with restoring a backup requested ...

Ken Task -
Particularly helpful Moodlers的头像

Wow ... been many moons ago ... don't keep notes, etc. on jobs that were 'probono' ... but ... basically.

Before you move find out size of moodledata and of devmoodledata ... current locations can be seen in config.php file of each site.

Calculate if both of them can be moved to /var/www/

If enough space for your comfort level ... remember you are making the decision ...

cd /path/to/current/location/ where you can ls and see both data directories.  Found in config.php file of site.

then

mv [datadir] /var/www/

check ownerships/permissions to see if changed on move.

Then edit config.php and change path to moodledata.

If I re-call there was some Plesk thing that needed tweaking ... so do dev first, get it working first, and if that checks out, then do production.   By 'working'  I mean you test everything in dev site ... install a quickie test course ... upload files to it ... etc. etc.

Take it slow ... THIMK BEFORE YOU CLICK OR HIT ENTER!

'SoS', Ken



回复Visvanath Ratnaweera

Re: Assistance with restoring a backup requested ...

Russell Thomson -
I am running two Moodle 3.8.1+ (Build: 20200221). I am trying to retore books. I did it in two stages on the first Moodle as the total gave the error message Syntax error. The first stage restored with any problems. The second restored with the following message:
Technical information and warnings
setting controller status to 700
saving controller to db
calculating controller checksum a07dc220d77e8d16d2dd75f13c198c0b
setting controller status to 600
saving controller to db
calculating controller checksum 1996faacc32cdc6116854e9c62e5722c
I combined both parts and backed up from the first Moodle and restored in the second Moodle, which produced the following result.


回复Russell Thomson

Re: Assistance with restoring a backup requested ...

Ken Task -
Particularly helpful Moodlers的头像

In your description of actions taken, am trying to understand this part:

"I combined both parts and backed up from the first Moodle and restored in the second Moodle"

How did you 'I combined both parts and backed up from the first Moodle'?

Am guessing that means backed up once selecting sections 0 and 1.  Backup file name example:

backup-courseid#-section0and1.mbz

Then backed up  again selecting only section 2 - no other resources.  Backup file name example:

backup-courseid#-section2.mbz

Then went to other moodle.   Restored backup-courseid#-section0and1.mbz ok ... no issues.  Didn't clean up nor remove blank/unused sections so course showed a Section 0 and Section 1 where the book actually existed. And there were blank sections - Section 2, 3, 4, 5 with no resources.

Then restored backup-courseid#-section2.mbz into existing course with option to add to existing course.

Is that right?

In backups, a book mod was the only content of Section 1 and another book mod was the only content in Section 2.

'SoS', Ken


回复Ken Task

Re: Assistance with restoring a backup requested ...

Ken Task -
Particularly helpful Moodlers的头像

Follow up questions ...

3.8.x has a slightly new process of restoring.  Can (if working) put the restore process in the background by clicking a button, then go onto other things.

So are you doing that on the first restore?

See pics.

Are you then immediately starting the second restore and choosing a course that hasn't finished restoring?

I've found the first one still pending ... the next day!  So, I stay on that first screen to watch the restore progress and when it finishes, the click. (giving me time to play PCH Lotto!).

'SoS', Ken

附件 finish.png
附件 start.png
回复Ken Task

Re: Assistance with restoring a backup requested ...

Russell Thomson -

I have a .com Moodle: Moodle 3.8.1+ (Build: 20200117), which I am having problems with so two new Moodles DEV and ENGLISH were created with a new domain .es: Moodle 3.8.2 (Build: 20200309) Version 2019111802.

From the .com I downloaded 15 books which I could not upload to .es DEV, so I split them into two groups and was able to upload but got the warning:

Technical information and warnings
setting controller status to 700
saving controller to db
calculating controller checksum a07dc220d77e8d16d2dd75f13c198c0b
setting controller status to 600
saving controller to db
calculating controller checksum 1996faacc32cdc6116854e9c62e5722c

In the DEV I combined the two backup files with the import function and then backed up and downloaded. I tried to restore into .es English and and got the Syntax error.

With different section of the .com Moodle with quizzes and pages I backup and tried to restore in .es DEV. I got the following error

Can't find data record in database table course.

More information about this error

×Debug info: SELECT * FROM {course} WHERE id = ?
[array (
0 => 31,
)]
Error code: invalidrecord

×Stack trace:

·     line 1562 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown

·     line 1538 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()

·     line 33 of /course/view.php: call to moodle_database->get_record()

The restore doesn't proceedand the screen remains blank. I don't get Process pending or Process complete 


回复Russell Thomson

Re: Assistance with restoring a backup requested ...

Ken Task -
Particularly helpful Moodlers的头像

Please see:
https://docs.moodle.org/38/en/Import_course_data

Import is for resources from one course on an instance of Moodle (like your .com site) to another course on the **same** instance of Moodle (your .com site).

You should be making  *backups* from .com and **restoring** to DEV - the 'restore' link in site/course menus.

Please see:
https://docs.moodle.org/38/en/Activity_backup

'SoS', Ken

回复Ken Task

Re: Assistance with restoring a backup requested ...

Ken Task -
Particularly helpful Moodlers的头像

Follow up ... and afraid it's your ONLY option ...

In your .com site, Extended Reading course, you have a "Harry Potter and the Philosopher's Stone + Auto" book.

The book consists of 17 chapters - each chapter with it's own audio.

The backup of just that book is 197MB

In Extended Reading course on .com site, you have a Section entitled:
Detective Stories - consisting of 23 books

IF ... IF in Extended Reading course on .com site the Harry Potter book is representative of all books in the Extended Reading course, taking only Detective Stories (Section) 23 books.

23 x 197MB = 4531MB
Now am not a math person, but MB means one adds 000,000 to the end of any number that says its in MB and that, in this case, would be 4,531,000,000.  In short form 4.5GIG


Your shared hosting .com site will not allow a 4.5Gig backup.
Even if it did, you'd have trouble restoring (note that's NOT import but restore) into DEV on VPS via GUI interface as PHP limits on uploading is 900M

Solution is very painful ... on .com site you have to create a backup of the Extended Reading course that consist of **just one** book.  Moodle has no tool to calculate in advance how large that one book backup would be.  IF the backup file is over 900MB, cannot upload to DEV.

IF backup is over 900MB, now you have to use the file system repo set up for large course restores set up for DEV and upload via SCP - that doesn't use Moodle admin GUI.

Now before someone suggest site migration ... can't be done ... can't make backup of moodledata/filedir.

'SoS', Ken



回复Ken Task

Re: Assistance with restoring a backup requested ...

Visvanath Ratnaweera -
Particularly helpful Moodlers的头像 Translators的头像
Hi Ken

> Now before someone suggest site migration ... can't be done ... can't make backup of moodledata/filedir.

Have been in that situation in Plesk for somebody. After deleting all sorts of backups and backups of backups managed to zip moodledata/filedir/. It was still beyond the quota but the hosting allowed a spurious overbooking.
回复Visvanath Ratnaweera

Re: Assistance with restoring a backup requested ...

Ken Task -
Particularly helpful Moodlers的头像

@Visvanath - thanks for suggestion ...

As an additional admin level user and not the author of any of the content on site ... which includes backup files ... one has to login as the other admin user and navigate to all courses, pretend to restore, one can then see the backup files to manage them.   With the number of courses that exist on shared system, that's lots of clicking/navigation and might take a 'volunteer' a week.

On OP's shared system, ssh is allowed.   Have run the cli backup.php script and used destination parameter outside of moodledata/filedir/ to a directory that was created manually (ownerships and permissions correct).

Script would run, but would not save backup to the designated directory for some reason.  No errors seen on screen.  Would report success and show reference to location in moodledata/filedir/

Think OP's shared site is like others have reported on OVH shaerd hosting setups ... 32 bit version of php 7.x - and from what I re-call, all Linux flavored boxen had issues with backups of 4 Gig.   Routine still uses 'cp' rather than 'move'.

One can find all backup files in filedir via DB query, manually copying contenthashed file name to web accessible directory for downloading.  Then remove row in db and manually remove contenthashed named file in moodledata/filedir/

That takes some effort and CLI knowledge not to make a mistake.  Been there ... done that as well ... on system that had no space left and no place to archive backups.

Anyhooo ... one messed up site.

'SoS', Ken

回复Ken Task

Re: Assistance with restoring a backup requested ...

Russell Thomson -
Talking of quizzes and not books, when I backup 1 quiz it has the same file size as a backup of 17 quizzes: 229.8MB. Is this normal? The book backups have varying sizes. I am not able to restore either backup.
回复Russell Thomson

Re: Assistance with restoring a backup requested ...

Ken Task -
Particularly helpful Moodlers的头像

When these attempts to restore (not import) failed, was there any debug?

Many of your quizzes also contain audio and images.

Please see:

https://docs.moodle.org/38/en/How_to_minimize_the_question_bank_when_doing_backup/restore

'SoS', Ken

回复Ken Task

Re: Assistance with restoring a backup requested ...

Russell Thomson -
I manually entered the quiz in .es ENG and backed it up the size was 700.6KB. This quiz contained 7 audio files. Something else is being backed up.
There was no debug; just an empty screen.
I tried the suggestions in the link but they didn't work.
回复Russell Thomson

Re: Assistance with restoring a backup requested ...

Ken Task -
Particularly helpful Moodlers的头像

Been into .es ENG ... there are now two admin level users with 'Admin' as user name.  The one I created had city somewhere and country Spain ... the other now shows no city no country.

If you use that account to restore courses user had different ID thus not same files.

In course sizes report:

Users (top 10)
User     Disk Usage
Admin User     12,421MB  (add 000,000 to that number)

That's the original admin user.

Detective Stories     4,068MB ... remember to add 000,000 .. that means that course is now 4.068 GIG.

Moodle modules usage:

Module usage:
Page    204
 Book    64
 Quiz    371

As far as quiz bank.

from moodledata/temp/backup/

directories still present .. ie, not removed:
Mar 11 12:30 4b08a176e1782210dbd5e578100133cf
Mar 11 12:02 69dfeb13fcc35c928be565122ba81327
Mar 11 13:29 b32a4aa054588d460b3cf4479bd6a43d
Mar 11 12:09 f9cac3ca553669b5307d645a9bc6c0f4
Mar 11 12:16 fd9cf7caecb7aa4e83defa09f65d9952

Two of those were dups ... second attempts?

backup-moodle2-course-90-c1_-_unit_1-20200311-1226-nu.mbz
3.8.1+ (Build: 20200117)
C1 - Unit 1
In 69dfeb13fcc35c928be565122ba81327
21109375 Mar 11 12:02 questions.xml

moodle_backup.xml shows:

backup-moodle2-course-90-c1_-_unit_1-20200311-1025-nu.mbz - same course as above
3.8.1+ (Build: 20200117)
C1 - Unit 1

questions.xml is the quiz bank ... all questions.

In b32a4aa054588d460b3cf4479bd6a43d - different course
21355474 Mar 11 13:29 questions.xml

moodle_backup.xml shows:
backup-moodle2-course-12-c1course-20200311-1325-nu.mbz

In fd9cf7caecb7aa4e83defa09f65d9952
21094343 Mar 11 12:16 questions.xml
backup-moodle2-course-90-c1_-_unit_1-20200311-1208-nu.mbz

When I visit the site, login, view/preview ... no errors?

Soooooooo .... ??????

'SoS', Ken

回复Russell Thomson

Re: Assistance with restoring a backup requested ...

Ken Task -
Particularly helpful Moodlers的头像

Revisted your .com site as that's where you are making backups in attempts to restore to .es DEV or production.

There is now a russellenglish directory at web root

Wasn't there 2 weeks ago.

Just this week, a 3.8.2 upgrade was released.

Did we try to update the site?
$release  = '3.8.2 (Build: 20200309)'; // Human-friendly version name

Looks like we did!!! but never config'd.

Also new ... not present 3-4 weeks ago:
e-learning  e-learning_ACTUAL  www  www_ACTUAL
Directories with _ACTUAL

e-learning_ACTUAL shows a moodledata directory contained therein
drwx---r-x+ 14 russelleyh users 15 févr. 11 19:00 moodledata
no group ownerships or permissions and has a february month?

The old active code still present in
/www/english/e-learning
Can execute it's admin/cli/cron.php script.

Which runs fine until it executes the adhoc task.
At that point output turns from text to html

Adhoc task complete: core_course\task\course_delete_modules
Execute adhoc task: core_course\task\course_delete_modules
... started 21:29:24. Current memory use 50MB.

<table class="generaltable">
<thead>
<tr>
<th class="header c0" style="" scope="col">Category</th>
<th class="header c1 lastcol" style="" scope="col">Action</th>
and shows
<td class="cell c1 lastcol" style="">This category has been deleted because, after deleting the course, its questions weren't used any more.</td>
</tr>
it's deleting a quiz bank category ... after deleting a course ... questions not used.

... used 40613 dbqueries
... used 50.948743104935 seconds

lots of queries to DB as seen above.

it repeats and repeats and repeats on different quiz categories as the course
they were used in has been deleted.

Cron never finishes ... ssh session times times out.

A query of mdl_files show many/many/many recyclebin created 'backup.mbz' files and appears you've been deleting entire courses.

Also appears I no longer have a login to it via web to .com site.  Ok by me.

So from what I understand about backups ... if moodle sees a reference to a file (like a .mp3 file) it copies it to the build area used to create the backup file.  It does not, however, actually check the .mp3 file for corrpution.

Same for quizzes and quiz bank ... question referenced in a course, queries run to acquire ... and in this case images and audio files included ... copied to build area in whatever state they are in ... no crc checks etc.

So taking that backup file to .es and restoring basically could be restoring junk which when new site tries to render/play, oops.

Only way to avoid ... rebuild the course/quiz etc. from scratch.

'SoS', Ken


回复Ken Task

Re: Assistance with restoring a backup requested ...

Ken Task -
Particularly helpful Moodlers的头像

Follow up ..

Are you interested in updating new servers dev and english?

Ya can ... easily!   Both were installed via git and have been updated once already to the highest 3.8.1+ at that time.

Can do same to update both to 3.8.2 ... just released earlier this week.

Just finished updating s 3.5,3.6,3.7, and a 3.8 on sandbox server in a matter of 1 hour + full site backups of each.

If you are, ssh into your server as root user.

After logging on, type: mymenu [ENTER]

You'll see some brief how2's for backing up and updating both dev and elearning sites on your server - the easy way ... the less prone to human error way! 微笑

'SoS', Ken