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

Re: Restore creates empty topics

$
0
0
by Séverin Terrier.  

Hi,

As Mary wrote, when Moodle restores some activities, it restores them in the same section number they where in the course when the backup was done.

That generates empty sections for you, but at the opposite, if you want to add things to an existing course with all sections already filled, it creates doubles in the sections. See MDL-61100 about that. It could also be made to answer your problem, if sections are created just when no sections are used in the destination course.

What you could try (not sure of the result) is to move the sections you want to copy in the first sections of your original course before doing the backup, and then try to restore to a new course.

Séverin


Re: Backups all courses in a course categorie?

$
0
0
by Dario Roig Garcia.  

Hi, I've been working with course's backup/restore in moodle.

You can try to make backups con cli or moosh:

Example \$sudo -u www-data /usr/bin/php admin/cli/backup.php --courseid=2 --destination=/moodle/backup/

In "General backup defaults" settings not check "Include user completion information"

Both take into account the configuration of moodle.

To restore courses in another site I'm using https://github.com/tmas0/moodle-tool_autorestore, this plugin has has its own configuration

moosh not works for me:

 Default exception handler: error/setting_by_name_not_found Debug: 

Error code: setting_by_name_not_found

$a contents: enrol_migratetomanual

other Plugins related:

https://moodle.org/plugins/block_my_external_backup_restore_courses

https://moodle.org/plugins/local_remote_backup_provider

I've tested that in moodle 3.3.

Regards


Re: Automated backups (cli) long backuping time/higher server load

$
0
0
by Marius S.  

Hello Severin,


could you let me know what is the size of your mdl_logstore_standard_log table?

Ours is 100gb and 192,000,000+ records.

We are thinking maybe this table is an issue of slow backup time because it needs to extract all logs from this table.


Thanks,
Marius.

Re: Automated backups (cli) long backuping time/higher server load

$
0
0
by Séverin Terrier.  

Hi Marius,

My mdl_logstore_standard_log.ibd file is 12 GB, for 57,500,000 records.

But i think you must know several things about the log table :

  • information about deleted courses still exists in the table
  • when resetting a course, it does not delete previous logs for this course!

Information is deletted only based on the loglifetime variable (mine is configured for 2 years / 730 days).

So, depending on the way you use your Moodle, and the number of years you used it, log table perhaps still stores a big number of totally unneeded information.

You can manually delete information about deleted courses and reseted course (before the start date) with appropriate queries if you want.

HTH,
Séverin

Re: Automated backups (cli) long backuping time/higher server load

$
0
0
by Marius S.  

Hello Severin,

Thank you for information. It seems that our logs are too big...

We are facing this issue: https://tracker.moodle.org/browse/MDL-56223

If I go to random old course with assignments, with no students, and go to Report > Logs, I see that "Calendar event updated" is running everyday, multiple times per day, so it generates ton of logs and stores in mdl_logstore_standard_log table.

Would it be safe to run sql query in phpmyadmin and delete "Calendar event update" records from mdl_logstore_standard_log table?


This issue is still unresolved. I will try to post about this issue in forums, maybe someone faced this issue and has a solution.

Marius.

Re: Automated backups (cli) long backuping time/higher server load

$
0
0
by Séverin Terrier.  

Hi Marius,

The log table is mainly used to track details of what has been done, and be able to browse (or search) it. It can also be used to generate statistics (if enable). So, no problem to delete things in it !

Moreover deleting "abusive" information isn't a problem but better cleaning unwanted things.

I think, seeing people facing this problem, and knowing problems generated (big logs, big backups, too much time and disk needed...), that it's worth doing things to have it resolved (soon).

Séverin

Course access when rolling over an academic year

$
0
0
by catalina vieru.  

Hello! 

Managing a Moodle platform for a university. We need to rollover the academic year during the summer, but we want them to have access to the courses they took this year. However, they will be enrolled in other courses (for their next academic year), so I am not sure if I can back up and archive the course - will they still be able to access it by logging in, although their new year will not be the same?

And how do I do that, if possible? 


Thank you! 


Course backup: Error writing to database

$
0
0
by Aviwe Foji.  

Hi, 


I am currently on Moodle 3.1 and 2 of my courses are giving me the "Error writing to database"error. every time I try to backup the courses.   




Is there a way in which I can back this up or create a copy of the courses from the back end? 


I would highly appreciate your assistance. 


Regards 


Re: Course backup: Error writing to database

$
0
0
by Séverin Terrier.  

Hi,

You should try different things, and provide much more details, such as :

  • backup without logs
  • backup without non standard plugins
  • Do you use non standard plugins on your Moodle (and in these courses)?
  • Do you use big ressources (videos)?
  • Do you have lots of users, with lots of activities?
  • When does this error message occurs (at the beginning, after a certain time...)?
  • if they previously backuped well, what changed recently on these courses?
  • Where is your Moodle hosted?
  • did something change recently on you Moodle (hosts)?
  • What are the limits of execution time?

HTH,
Séverin

Re: cannot_finish_ui_if_not_setting_ui

$
0
0
by Wilder Ferney Quintero Vanegas.  

Hello 


i have the same error. Please i need your help, with a course lees than 1gb work well but if is more than 1Gb aprox apears this error

server: Linux centox

Moodle: 3.2.2

var max:Allow_pocket: 536000010

max_execution_time: 1000

Warning: Error while sending QUERY packet. PID=10658 in /home/****/public_html/lib/dml/mysqli_native_moodle_database.phpon line 1174

Error al leer de la base de datos

Más información sobre este error

Debug info: MySQL server has gone away
SELECT count(r.repositoryid)
FROM mdl_files f
LEFT JOIN mdl_files_reference r
ON r.id = f.referencefileid
JOIN mdl_backup_ids_temp bi
ON f.id = bi.itemid
WHERE bi.backupid = ?
AND bi.itemname = 'filefinal'
[array (
0 => 'fa039f76d89dc6152d9ba2ef521edaa8',
)]
Error code: dmlreadexception
Stack trace:
  • line 479 of /lib/dml/moodle_database.php: dml_read_exception thrown
  • line 1175 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 1551 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
  • line 1624 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
  • line 1834 of /lib/dml/moodle_database.php: call to moodle_database->get_field_sql()
  • line 522 of /backup/util/dbops/backup_controller_dbops.class.php: call to moodle_database->count_records_sql()
  • line 1981 of /backup/moodle2/backup_stepslib.php: call to backup_controller_dbops::backup_includes_file_references()
  • line 34 of /backup/util/plan/backup_execution_step.class.php: call to backup_store_backup_file->define_execution()
  • line 181 of /backup/util/plan/base_task.class.php: call to backup_execution_step->execute()
  • line 177 of /backup/util/plan/base_plan.class.php: call to base_task->execute()
  • line 120 of /backup/util/plan/backup_plan.class.php: call to base_plan->execute()
  • line 322 of /backup/controller/backup_controller.class.php: call to backup_plan->execute()
  • line 136 of /backup/util/ui/backup_ui.class.php: call to backup_controller->execute_plan()
  • line 131 of /backup/backup.php: call to backup_ui->execute()
Fatal error: Uncaught exception 'ddl_change_structure_exception' with message 'Error de ejecución DDL sql' in /home/***/public_html/lib/dml/moodle_database.php:485 Stack trace: #0 /home/***/public_html/lib/dml/mysqli_native_moodle_database.php(1000): moodle_database->query_end(false) #1 /home***/public_html/lib/ddl/database_manager.php(77): mysqli_native_moodle_database->change_database_structure(Array, Array) #2 /home/****/public_html/lib/ddl/database_manager.php(332): database_manager->execute_sql_arr(Array, Array) #3 /home/****/public_html/lib/dml/moodle_temptables.php(140): database_manager->drop_table(Object(xmldb_table)) #4 /home/*****/public_html/lib/dml/moodle_database.php(398): moodle_temptables->dispose() #5 /home/*****/public_html/lib/dml/mysqli_native_moodle_database.php(565): moodle_database->dispose() #6 /home/****/public_html/lib/dml/moodle_database.php(157): mysqli_native_moodle_database->dispose() #7 [intern in /home/*****/public_html/lib/dml/moodle_database.php on line 485

Re: cannot_finish_ui_if_not_setting_ui

$
0
0
by Ken Task.  

@Wilder Ferney Quintero Vanegas

Might have the same error, but for different reasons ...

MySQL server has gone away
and repository are clues for you.

See /home/x/public_html in the paths which could indicate a shared server with shared DB servers.

Are you on shared hosting?

Typically, those on shared hosting cannot make tweaks to shared DB server.
Even if you have attempted to increase values, system is setup to ignore going over your account maxes.

Gone away is related to MySQL server and I see you have shared:
var max:Allow_pocket: 536000010
Is that from your my.cnf file or some interface you have for the DB for your Moodle?

Default value for MySQL is 16M
https://dev.mysql.com/doc/refman/5.6/en/program-variables.html

Using the mysql client on your moodle server or whatever tool you have to work with DB's, what does the following query show:

mysql> show variables like 'max_allowed_packet';

Fact that you've noticed 1G or below ok but anything over 1G no go - wondering how you know a course backup is over 1G?

In the error it shows repository ...

Make the backup deselecting any link you have in course that goes to
a file from a repository.   Those could be videos ... large files.
See what happens.

At this stage ... it's a guessing game.

'spirit of sharing', Ken


Re: cannot_finish_ui_if_not_setting_ui

$
0
0
by Wilder Ferney Quintero Vanegas.  

hello ken

thanks a lot
It is not a shared server, it is a dedicated server.
Is that from your my.cnf file or from an interface that you have for your Moodle database?
is the value that I assign in the global variables of the mysql.

only happens with some courses, this has 5 modules, if I make individual copies or of two modules, the backup is generated without problems, that is,
Module 1 200 ---- M
Module 2 300M
module 3 200M
Module 4 400M
Module 5 300M

mosulo 1 -2 600 M
Module 3-4 800M
Module 1-3 ... 700M
approximate values

all generate good, but if I generate the full backup it generates the error

Re: cannot_finish_ui_if_not_setting_ui

$
0
0
by Ken Task.  

'public_html' even on a dedicated server is in a 'user jail' ... trust me when I say that!

So you do have ssh into server and can call up the mysql client app on the server.

So again;

mysql> show variables like 'max_allowed_packet';

what does the above show. 

Assigning globals via command last only as long as the DB server runs that session.  When/if DB server is rebooted or restarted, that global setting is lost.  To be permanent, has to be in config file on start up of DB server.

You could also do a full backup of that course from the command line ... takes apache out of the loop leaving only php and mysql server then.

cd /path/to/your/moodle/code/admin/cli/

php backup.php --courseid=[idnumberofcourse] --destination=/path/to/where/you'd/like/to/save/it

Let's try that to see if it errors or finishes ... but only after making sure max_allowed_packet is set the way you think it is.

If it does error, the command line backup.php execution should show errors ... come back here an post the text of that error.

'spirit of sharing', Ken

Re: cannot_finish_ui_if_not_setting_ui

$
0
0
by Wilder Ferney Quintero Vanegas.  

Hello  Ken


I verified and  like i told you

Server Load0.279297 (8 CPUs)
Memory Used7.79% (2,550,792 of 32,752,996)

mysql> show variables like 'max_allowed_packet';
+--------------------+-----------+
| Variable_name      | Value     |
+--------------------+-----------+
| max_allowed_packet | 535999488 |
+--------------------+-----------+
1 row in set (0,00 sec)

i tried to do backup to this course but do not work

root@server [/home/pruebaseducacion/public_html/admin/cli]# php backup.php --courseid=141 --destination=/home/pruebaseducacion/prueba_backup/
== Performing backup... ==
!!! Error al leer de la base de datos !!!


i did a test with other courseid end worked well

root@server [/home/pruebaseducacion/public_html/admin/cli]# php backup.php --courseid=260 --destination=/home/pruebaseducacion/prueba_backup/
== Performing backup... == 

Writing /home/pruebaseducacion/prueba_backup/copia_de_seguridad-moodle2-course-260-prueba1-20190221-1228.mbz
Backup completed.

root@server [/home/pruebaseducacion/public_html/admin/cli]# php backup.php --courseid=24 --destination=/home/pruebaseducacion/prueba_backup/  
== Performing backup... ==
Writing /home/pruebaseducacion/prueba_backup/copia_de_seguridad-moodle2-course-24-codificacionexternos-20190221-1229.mbz
Backup completed.




Re: cannot_finish_ui_if_not_setting_ui

$
0
0
by Ken Task.  

Install moosh

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

It's not really a moodle plugin but a command line utility for moodle.

Once it's installed and checked, let's see what's in course ID 141

From inside the moodle code directory anywhere, issue:

moosh -n course-info 141

The -n allows root user to execute rather than web service user.

You'll see something like this (my example done on course ID 10 in a Moodle):

Course ID: 10
No of contexts: 16
Context by level:
    CONTEXT_MODULE (70):    16
Context by module:
    assign (1):    2
    lti (14):    1
    page (15):    3
    resource (17):    10
Number of role capability overwrites: 0
Role capability overwrites by context:
Number of local role assignments: 0
Locally assigned roles by context:
Number of enrolled users: 0
Users enrolled by role:
Number of groups: 0
Group statistics:
    Min number of members in a group:    0
    Max number of members in a group:    0
    Avg number of members in a group:    0
Course modinfo size: 33733
Number of sections: 2
Section statistics:
    Sections visible:    2
    Sections hidden:    0
    Min number of modules in a section:    0
    Max number of modules in a section:    16
    Avg number of modules in a section:    8
Number of grades: 0
Number of log entries: 65
Number of files: 10
Total file size: 8833144
Cache build time: 0.078015089035034

Dunno what we might see for your 141.

Also run:

moosh file-list course=141
Let's attempt see what's in it.

Still the error is DB related ... I wonder ...

How about also installing MySQLTuner.pl and run it.

https://github.com/major/MySQLTuner-perl

We might find some suggestions to tuning the DB that will help with the backup of this one course.

'spirit of sharing', Ken




Re: cannot_finish_ui_if_not_setting_ui

$
0
0
by Wilder Ferney Quintero Vanegas.  

Hello,

first thanks a lot for your help


moosh -n course-info 141
Course ID: 141
No of contexts: 38
Context by level:
       CONTEXT_MODULE (70):    38
Context by module:
       label (12):     4
       resource (17):  15
       scorm (18):     18
       certificate (23):       1
Number of role capability overwrites: 0
Role capability overwrites by context:
Number of local role assignments: 0
Locally assigned roles by context:
Number of enrolled users: 22
Users enrolled by role:
       student (5):    22
Number of groups: 0
Group statistics:
       Min number of members in a group:       0
       Max number of members in a group:       0
       Avg number of members in a group:       0
Course modinfo size: 73833
Number of sections: 6
Section statistics:
       Sections visible:       6
       Sections hidden:        0
       Min number of modules in a section:     0
       Max number of modules in a section:     11
       Avg number of modules in a section:     6
Number of grades: 418
Number of log entries: 8092
Number of files: 1851
Total file size: 1252162926
Cache build time: 0.071723937988281

moosh -n file-list course=141
!!! Error al leer de la base de datos !!!
it is the same issue 



Re: cannot_finish_ui_if_not_setting_ui

$
0
0
by Ken Task.  

I see some things in course info worthy of note:

 scorm (18):     18

SCORM installs usually had one upload a zip and unzip then link to the manifest.xml.  Those SCORM's could have been uploaded to a file system repo and then from some reason, course creator, check the box for 'alias'.  Have seen courses with SCORMs in courses that have a lot more files than the next bit of info.

Number of files: 1851

Total file size: 1252162926 - which indicates a backup would be around 1.2 Gig - probably higher.  SCORM's with videos (mp4's) could be very large.

moosh wasn't gonna fix anything ... just tell us where we might need to look.

And it sure did tell us with the command to check files in the course ... there was an issue ... hmmmm, same one Error writing to the DB.

In the backup process, there are temp tables created which are erased when the session finishes ... sucessfully or in failure.

So when the command to list files error'd about how long in time did it take to error.  Almost right away?

In moodledata/temp/backup/ there might be some clues in .log files that are larger then 0 bytes.   If there are directories in there by a contenthash name, check them out also.  A failed backup won't have a moodle_backup.xml file in there ... nor an .mbz file.

Do logs still say mysql has gone away?   Might need to increase max packets even larger ... and look at increasing default value for number of open files.

And mysqltuner said?  What recommendations did it make?

What if you made a backup but deselected a SCORM or two when backing up?

'spirit of sharing', Ken


unzipping .mbz backups

$
0
0
by Ryan McKinnie.  

Hi everyone,


I have backed up a course into the .mbz file format and want to unzip and explore the files and folder structure. When I extract with RAR, I get unreadable files. I have Googled this problem and found a Python script that will use the .xml files inside the compressed .mbz to parse information and return a mirror image of the file structure from the original moodle structure. I am stuck now trying to run the Python code and get an output. Has anyone else encountered this issue? Any other workarounds?

Re: unzipping .mbz backups

$
0
0
by Colin Fraser.  

Gee, haven't done this for a while.... but what used to work was 

1. Rename the file to a [finename].zip 

2. Unzip using 7Zip, or Winzip or any zipping program.

3. Edit the files but unless there was a reason to, leave the .xml file alone. Have done it and it worked but not really what I wanted to do. 

4. Zip the file up again

5. Rename to an .mbz file. 

6. Upload the file as a restore a backup to my test site first, then to the production site . 

Just had a quick run through and seemed to work... but, to be honest that was not on a recent backup. 


Re: cannot_finish_ui_if_not_setting_ui

$
0
0
by Wilder Ferney Quintero Vanegas.  


Good afternoon: 

 the error "error reading in the database" is in a matter of 2 seconds if I make a backup of 3 of the modules it is generated correctly, and if I then backup the module 4 it is also generated without problems. In the backup / temp / folder there are no log files higher than 0k allusive to that backup.

 the variable I increased to 1073741824, however I see something strange in the backup folder and it is that a folder is generated 207978a8a7bccca6fb8b29c172f3f303 where you have the content of the course support, including the file moodle_backup.xml and a .mbz of 1.9Gb but both in the course and with moosf the error continues.


thanks a lot for your help

Viewing all 6625 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>