Quantcast
Channel: Backup and restore
Viewing all 6662 articles
Browse latest View live

"The backup file contains more than one top-level question categories for context 396. "

$
0
0
by cyber sec.  

Moodle 3.7.7.

I create courses on my home PC, then I backup the courses and restore them to my online setup. Both sites are setup with Moodle 3.7.7.

I get this error when I try to restore a course from my homesite, to my online site:  "The backup file contains more than one top-level question categories for context 396. "

I suspect this may have something to do with my StudentQuiz plugin.



Re: "The backup file contains more than one top-level question categories for context 396. "

$
0
0
by cyber sec.  

I found a work-around, but it's not a very good one. It is time consuming and tedious. But it might give somebody better insight into what is happening.

1. backup and restore the course without the question bank.
2. backup restore each studentquiz activity.

Instead of one backup and restore, I needed to do 17. Besides that, this leaves me feeling less than confident of Moodle's backup and restore capabilities.

Also, doing this, I stumbled across something else, that I found odd. I can only have one file in my "Backup Activity Area." When I try to put another file there, it overwrites the first. Is it supposed to work like this?

How do I delete old Course backups?

$
0
0
by Conrad Bucsis.  

Hello, 

How do I delete old course backups from Moodle Cloud

Tried to find a back-up folder but had no luck.

Thanks in advance. 


Sincerely,

Conrad 

Re: [3.9] Automated backups consumes all disk space and trashdir is full

$
0
0
by Alain Raap.  

Have you all seen this checkbox in the automated backup settings? This is a new setting that I haven't seen before in Moodle 3.5.x, maybe in a later version it's already included?

backup | backup_auto_files

When it's checked, all the course files (in moodledata) are also included in the backup. I haven't taken a further look at this point yet, but I'm going to test our new upgrade with and without this setting checked to see the difference and if more data is stored after the automated backup.

Re: [3.9] Automated backups consumes all disk space and trashdir is full

$
0
0
by Richard van Iwaarden.  

That is interesting.

But what happens in this scenario:

  • auto-backup enabled
  • Teachers deletes course X which holds files X, Y, Z (it is the only course that holds these files)
  • Backup is restored (but only contains hyperlinks - not the actual files)

Will everything still be there? And if so... would it mean that step 2 (teacher deletes files) doesn't really delete files?


Re: [3.9] Automated backups consumes all disk space and trashdir is full

$
0
0
by Richard van Iwaarden.  

Answered my own question I think:



So that would mean that if I increase 'filescleanupperiod' to say 30 days, I can run autobackup with the setting not to include files... theoretically.

Re: [3.9] Automated backups consumes all disk space and trashdir is full

$
0
0
by Alain Raap.  

Richard, I think it’ll cost you a lot
of diskspace when you increase that number. Maybe try to test it as I said, what’s the difference in diskspace used when the checkbox I mentioned is enabled/disabled?

Re: [3.9] Automated backups consumes all disk space and trashdir is full

$
0
0
by Richard van Iwaarden.  

I don't know, let's see what Ken thinks. 'In the spirit of sharing' smile

We should think of two things:
  1. What if file x,y,z are in every daily backup stored
  2. OR... what if I keep deleted files for 30 days

I have no clue as to what would take more disk space...


Re: [3.9] Automated backups consumes all disk space and trashdir is full

$
0
0
by Ken Task.  

At this point, I don't know what to think ... do know there is no recycle bin for deleted courses ... only resources deleted from a course.

Think I'd set recyclebin button/link to display all the time ... normal behavior is to display the link in course admin menu only when there is something in recyclebin.   Go to one of these troubled courses and see if there is anything in recyclebin.

The only way to know for sure if files that were linked in a course are used else where in the site is via direct mysql query of mdl_files table.

And the only way to know for sure if a file is in a backup is to copy the mbz file out to some test area, uncompress it. Then check files.xml (humanly recognizable name + contenthash value seen) against what one finds in the uncompressed files directory.

The files.xml will show a path to a folder structure like that of moodledata I think 2 levels deep ... for finding using contenthash value seen in files.xml ... 1st two letters/numbers is a subdir in files folder ... 2nd two letters a subdir in the first subdir ... then the file which should be named the same as the contenthash value. Do file -b contenthashfilename to see if it's mimetype.

I do have a 3.9.highest sandbox using auto backups ... no issues .. of which I am aware ... but then again those courses would be small, etc. so ... not fair to compare.

moodledata size increases ... failed backups where those failures are not removed/cleaned up will take up space ... recyclebin files which are stored in the sea of files ... moodledata/filedir/

Query mdl_file table looking for any file using component recyclebin.

Fraid there is no admin tool to sort this out ... just a lot of inspecting various things ... only tool that does come to mind is moosh ... it does have optional commands for finding 'orphaned' files and checking that meta data in mdl_files table matches what can be found in moodledata/filedir/

'SoS', Ken

Re: [3.9] Automated backups consumes all disk space and trashdir is full

$
0
0
by Colin Fraser.  

I have no idea how the IT guys set up backups or how they handle this issue, I've not been a part of that. We actually don't delete courses quickly, the end Semester 1, all semester long courses are reset, then archived. At the end of each year, all courses are reset and archived to the same Category, e.g. Archive2019. (Our school year is the same as the calendar year in Oz.) Those courses to be repeated the next year are brought forward, those courses not repeating, and there are always a few, remain for future reference, or as resources for others to use. All teachers have access to all courses in the archive, they are set as non-editing Teachers at the Category level, I was lazy when setting it up. At the end of each year, the earliest Archive we have is deleted entirely so a course remains within the Moodle for 5 years. Works for our need.

Comparison of Course Restore/Copy Options

$
0
0
by Aletha Williams.  

Greetings:

I have searched the Moodle Community's post and Google for the following question. I have yet found a clear and straightforward answer.

Please outline the main differences between the following:

  • Backup and restore
  • Course copy
  • Importing a course
Any assistance would be greatly appreciated!

Many thanks.

Comparison of Course Restore/Copy Options

$
0
0
by John Provasnik.  

Importing a course: Only allows you to 'merge' some or all content from one location into another.
Backup and restore: Allows you to overwrite/delete the contents of a course prior to adding in the some or all content from a backup.
When you back up a course, you can select all or some of its contents to be part of the backup. When you restore that back up into another location, you can further decide to pull in the entire contents of the backup or further decide to select only a few items out of it.

If you're going to import contents from one course into several other courses, you can either (1) go through the 7 steps of the import process over and over, or (2) go through the 7 steps of the back up process just the one time. Then you can restore that backup into other courses (1 course at a time) but you don't have to go through all 7 steps each time.

I'm not familiar with Course Copy (Im' using 3.7). Hope that helps a little.

"Error writing to database"

$
0
0
by cyber sec.  

This is a constant problem. I am backing up from an online Moodle 3.7 site with a MySQLdatabase, and trying to restore to a desktop Moodle 3.7 site with a Postgres database. I think it may have something to do with StudentQuiz plugin. I turned on debugging. Here are the error messages:

Debug info: ERROR: duplicate key value violates unique constraint "mdl_studprog_queusestu_uix"
DETAIL: Key (questionid, userid, studentquizid)=(2554, 0, 53) already exists.
INSERT INTO mdl_studentquiz_progress (questionid,userid,lastanswercorrect,attempts,correctattempts,studentquizid) VALUES($1,$2,$3,$4,$5,$6) RETURNING id
[array (
'questionid' => 2554,
'userid' => 0,
'lastanswercorrect' => '1',
'attempts' => '2',
'correctattempts' => '2',
'studentquizid' => 53,
)]
Error code: dmlwriteexception
Stack trace:
  • line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown
  • line 259 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
  • line 975 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
  • line 1023 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->insert_record_raw()
  • line 191 of /mod/studentquiz/backup/moodle2/restore_studentquiz_stepslib.php: call to pgsql_native_moodle_database->insert_record()
  • line 137 of /backup/util/plan/restore_structure_step.class.php: call to restore_studentquiz_activity_structure_step->process_progress()
  • line 112 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process()
  • line 178 of /backup/util/xml/parser/processors/grouped_parser_processor.class.php: call to restore_structure_parser_processor->dispatch_chunk()
  • line 100 of /backup/util/helper/restore_structure_parser_processor.class.php: call to grouped_parser_processor->postprocess_chunk()
  • line 148 of /backup/util/xml/parser/processors/simplified_parser_processor.class.php: call to restore_structure_parser_processor->postprocess_chunk()
  • line 92 of /backup/util/xml/parser/processors/progressive_parser_processor.class.php: call to simplified_parser_processor->process_chunk()
  • line 190 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser_processor->receive_chunk()
  • line 278 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->publish()
  • line ? of unknownfile: call to progressive_parser->end_tag()
  • line 179 of /backup/util/xml/parser/progressive_parser.class.php: call to xml_parse()
  • line 158 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->parse()
  • line 110 of /backup/util/plan/restore_structure_step.class.php: call to progressive_parser->process()
  • line 181 of /backup/util/plan/base_task.class.php: call to restore_structure_step->execute()
  • line 210 of /backup/moodle2/restore_activity_task.class.php: call to base_task->execute()
  • line 178 of /backup/util/plan/base_plan.class.php: call to restore_activity_task->execute()
  • line 168 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute()
  • line 377 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()
  • line 219 of /backup/util/ui/restore_ui.class.php: call to restore_controller->execute_plan()
  • line 143 of /backup/restore.php: call to restore_ui->execute()

Re: "Error writing to database"

$
0
0
by Ken Task.  

Any reason not to have same MySQL DB on desktop version?

Above question for thought ...

I see there are user id's involved ... userid 0?!!!???

What if you were to make a no user backup of the course and attempt to restore that?

'SoS', Ken

Re: "Error writing to database"

$
0
0
by cyber sec.  

I thought I was doing a no-user backup, but now I'm not sure.

I did a backup without the question bank. Then I backed up each of the 24 studentquiz activities individually.

The backup without the question bank restored okay. 22 or the 24 studentquiz activities restored okay. But with two of the student quiz activities I got that error  about admin being logged in causing a conflict.

I don't think I enrolled in the course as admin. But I did try some of the quizzes as admin.

Re: [3.9] Automated backups consumes all disk space and trashdir is full

$
0
0
by Marius S.  

Hello Alain, we have this option enabled in automated backup settings, and 'filescleanupperiod' is set to 3 weeks.
However as I mentioned as we are doing automated backup to moodledata + specific directory (mbz files), so checking specific directory I can see that every week is similar number of backups made and it's about 240-280GB. So I assume that backups in Moodledata uses more or less same space. So each week ~240GB of new backups are stored in moodledata and ~240GB should be deleted.
We have 600GB free space if moodledata/trashdir and moodledata/temp/backup is empty.
And this weekend I checked moodledata/trashir after automated backups finished so we had ~540GB in trashdir and only 60GB free space.

Also now we run our cli cron every 5 minutes. So I don't understand why moodledata/trashdir are getting so big when we start automated backups on weekends.

Even if oldest backups are moved to trashdir and deleted only after 24 hours it should be plenty of free space left as new backups size are the same every week ~240GB..

Marius.

[3.9.1]Automated backup Emails

$
0
0
by Richard van Iwaarden.  

Since the upgrade from 3.7.1 tot 3.9.1 there's something wrong with the automated backup Emails.

We start our automated backup script every day at 22:00 hours. (10.00 pm) It is started from command line (not within Moodle)

Two minutes after that I already receive the Email from the automated backup process. This is way to fast, the proces is still running (it runs for hours).

The mails always look similar to this:

Summary

==================================================

Courses: 14862

OK: 0

Skipped: 11900

Error: 0

Unfinished: 40

Course backup ad hoc task pending: 2922

Warning: 0

Automated backup pending: 0


Some of your courses weren't saved!!

Please take a look at your backup logs in:


This happens every day. The info is pretty useless as almost 3000 backups are still running, so the result of these 3000 course backups will never be reported by mail.

In Moodle 3.7.1 I would always get these mails, which at least make sense:

Summary

==================================================

  Courses: 10851

  OK: 1393

  Skipped: 9458

  Error: 0

  Unfinished: 0

  Warning: 0

  Automated backup pending: 0

 

  Backup completed successfully

So what happened in Moodle 3.9.1 with this procedure? Why is it reporting by mail almost immediately after the start of this proces?

Re: [3.9.1]Automated backup Emails

$
0
0
by Richard van Iwaarden.  

Forgot to say: the proces runs fine, the backups are being made. The automated backup proces runs from 22:00 to 24:00 usually and then finishes, so I do have the backups.

Re: [3.9.1]Automated backup Emails

$
0
0
by Ken Task.  

You sure have had issues with autobackups.  Other than moodle version might be a good idea to share some more info about setup ... overall ... any tech that would/could be related to auto issues.  Setup in a VM?  etc.

Don't have an answer ... just suggestions/things to check ... maybe do?

in scheduled task there are 2 related to auto backups (both in 3.7 and 3.9):

One is: Automated backups \core\task\automated_backup_task
But you say you are doing auto backups outside of Moodle.
Your message clip did show 'check logs' ... did you?
IF so, what did logs show/say?

The other:
Clean backup tables and logs \core\task\backup_cleanup_task

There is also:
Delete stale temp files \core\task\file_temp_cleanup_task

As you know scheduled task have their own set ups for frequency/time to run.

There is no task for scheduling notifications related to autobackups.

In addition, you are the Moodle Admin but not maybe the server admin/op.
Servers have other things to do so there are other cron jobs scheduled
to do whatever they do.  Servers also have internal checkers ... example:
checking apache service it sees its not responding so it is set to restart
the service.  Could the server OP have done something to upset auto inadvertently?

Am wondering if there is some conflict that messes with the cron job for auto backups.

One would have to compare *every* auto message received since the site was upgraded from 3.7.x to 3.9.x to see history of this.

Since your site has had a history of issues with auto backups, would think
that immediately after an upgrade that would be the first thing checked.

Had to truncate all the tables related to auto backups once to start over cause in logs/schedules I saw a couple of courses that had next run date a year into the future.

Yes, truncating all the tables means starting over .. but you are backing up
every night anyway.   I hope to a directory outside of the sea or files in
moodledata/filedir/

Maybe you could create a new location for the 1st run after truncating tables and then do a comparison of old location vs new location backups.

'SoS', Ken

Hidden Topic settings not carrying over during Restore

$
0
0
by David Gilder.  

Hello,

I have tried searching through the forums for an answer to this issue but I have had no luck.

I am currently working in a system that uses Moodle 3.5 and I am have some issues with some settings not carrying over following a backup and restore to new course.

I have a course that has a range of hidden topics and within those topics there are activities that have been made "available but not shown on course page". This is because the activities are embedded in other activities that are visible.

However when I backup the course and perform a restore to new course all of those settings disappear.

I have attached a screenshot showing the master course and the new duplicate.

Can anyone advise if there is a way to make these settings carry over?

Thanks

Viewing all 6662 articles
Browse latest View live