Restore courses from remote Moodles

Blocks ::: block_my_external_backup_restore_courses
Maintained by Céline Perves
block my_external_backup_courses : Restore courses from remote moodle platforms my_external_backup_restore_courses is a Moodle block that enable a user to restore courses from external moodles this block must be installed in each moodle course clients and course servers involved
Latest release:
122 sites
138 downloads
17 fans
Current versions available: 5

block my_external_backup_courses : Restore courses from remote moodle platforms

my_external_backup_restore_courses is a Moodle block that enable a user to restore courses from external moodles this block must be installed in each moodle course clients and course servers involved

Features

  • enable a user to program course restoration, where courses comes from external moodles
  • depending of his role capabilities he can restore courses with user datas
  • possibility to find the original category based on unique category identifier threw plugin settings on database relation (user must hace moodle/course:create in the category context)
  • restore cours in a default category (user must hace moodle/course:create in that context)
  • a scheduled task will launch remote backups and restorations of these courses
  • Log and messaging include to notify of success or failure
  • possibilily to restrict to only one restoration by course
  • admin tool to see list of backup/restore tasks
  • admin tool to restore a course for a user

Security warning

  • This plugin use a capability block/my_external_backup_restore_courses:can_retrieve_courses that enable webservice account to donload backup files of other users
  • To improve security it is strongly recommended to generate token with IPrestriction on server side IPs

mnet warning usage

this plugin may not work in MNet environments fully because the username in that conditions username is not unique

Download

from moodle plugin repository

Installation

Block installation

Install block on blocks directory in course clients moodles and in each course servers moodle you need to connect to

webservice settings

On moodles that serves courses

install by cli or manually

install with cli command

  • execute cli, that will install webservice, rôle and user
  • you will only need to generate token (see after)
generate token
  • Under Site administration -> Plugins -> Web Services -> Manage Tokens
    • create a new token, restricted on your php server(s) for the custom external sservice previously created
      • by cli user is named block_my_external_backup_restore_courses_user
    • This token will be one to be entered in the block parameters of block_my_external_backup_restore_courses on client moodles.
    • for more security restrict webservice usage on IP

Block setting

Essential settings

On moodles that serve courses (moodle servers) and client moodles

  • Under Plugins -> Blocks -> Restore courses from remote Moodles For each moodles you need to fill the following setting parameters 
  • in my_external_backup_course | search_roles enter roles to include in course search simple quote delimited text shortname separated by commas
  • in my_external_backup_course | restorecourseinoriginalcategory activate the mode that enable to try to search the original category of a remote course 
  • in my_external_backup_course | categorytable the database table name where to find unique identifier information in order to search/find category, common for both client and server moodles
  •  in my_external_backup_course | categorytable_foreignkey the database foreign key for categorytable
  • in my_external_backup_course | categorytable_categoryfield the database field in categorytable unique for a category and common for both client and server moodles 

Cli install version for moodle version 4.0 and above 

  •  the following commands are the ones for traditional moodles

On course clients moodles
  • in my_external_backup_course | defaultcategory the categoryid where the course will be restored by default, users that restore must have capability to moodle/course:create
  • in my_external_backup_course | externalmoodles formatted list of course servers moodles formatted as moodle_url1,token_compte_webservice_moodle_externe1;moodle_url2,token_compte_webservice_moodle_externe2;… 

Cli install version

  • for moodle version 4.0 and above
Cron setting

On Site administration -> Server -> Scheduled tasks * Edit “Restore course from remote Moodles” task to determine when restore process is launched

capability

  • in order to use this block in dashboard a capability block/my_external_backup_restore_courses:view is provided and by default allowed for coursecreator and manager profile
  • This enable to control block visibility in dashboard
  • course restore and backup is virtually proceed with an admin account so the resquester user does not need special capabilities anymore
    • except course:create in category if checkrequestercapascoursecreate setting is checked

Optional interesting settings

Messaging

  • Site administration / ► Plugins / ► Message outputs / ► Default message outputs
  • 2 message outputs :
    • Notify that an external course as failed to restore
    • Notify that an external course is successfully restored
  • by default allowed and permitted for mails

role

  • In Site administration -> Plugins -> Blocks -> Restore courses from remote Moodles
  • block_my_external_backup_restore_courses | search_roles : enable to change/add moodle role used to search remote courses to restore

Restriction

  • In Site administration -> Plugins -> Blocks -> Restore courses from remote Moodles
  • block_my_external_backup_restore_courses | onlyoneremoteinstance : Only one restoration is authorized by course
  • block_my_external_backup_restore_courses | enrollrole :
    • define the role that the requester will have in the restored course
    • define the role in which the user will be re enrolled to course through the given button in the backup external course button

Contributions

Contributions of any form are welcome. Github pull requests are preferred. Fill any bugs, improvements, or feature requiests in our [issue tracker][issues].

License

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4
Screenshot #5
Screenshot #6
Screenshot #7
Screenshot #8
Screenshot #9

Contributors

Céline Perves (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Comments

  • Jacques Barzic
    Thu, 18 Jan 2018, 11:27 PM
    Hi Céline,
    Thanks for your reply.
    The two Moodles' version is 3.0.10 (Build : 20170508).
    For the token : the toked created on server is set in client in "external moodle list to connect to" with the server's URL.
    In the notification the error is "file retrieve : no files in zip".

    For the parameters, you can see sreanshoots here : https://de2729.ispfr.net/download/remote_restore_course_test.pdf

    Thanks for your help.

    Jacques.
  • Jean-François PETIT
    Thu, 8 Mar 2018, 11:14 PM
    I follow this plug in and some erreur with the Cron
    Execute scheduled task: tâche du plugin restaurer vos cours depuis des Moodle distants (block_my_external_backup_restore_courses\task\backup_restore_task)
    ... started 15:56:39. Current memory use 9.9Mo.
    ... used 37 dbqueries
    ... used 3.9998121261597 seconds
    Scheduled task failed: tâche du plugin restaurer vos cours depuis des Moodle distants (block_my_external_backup_restore_courses\task\backup_restore_task),error/setting_by_name_not_found
    Backtrace:
    * line 97 of /backup/util/plan/base_task.class.php: call to base_plan->get_setting()
    * line 439 of /blocks/my_external_backup_restore_courses/locallib.php: call to base_task->get_setting()
    * line 322 of /blocks/my_external_backup_restore_courses/locallib.php: call to block_my_external_backup_restore_courses_task->restore_course_from_backup_file()
    * line 25 of /blocks/my_external_backup_restore_courses/classes/task/backup_restore_task.php: call to block_my_external_backup_restore_courses_task_helper::run_automated_backup_restore()
    * line 104 of /lib/cronlib.php: call to block_my_external_backup_restore_courses\task\backup_restore_task->execute()
    * line 292 of /lib/cronlib.php: call to cron_run_inner_scheduled_task()
    * line 91 of /admin/tool/task/schedule_task.php: call to cron_run_single_task()
  • Azmat Ullah
    Thu, 9 May 2019, 5:37 PM
    Hi Celline,

    I'm also facing same problem as Jacques mentioned above.

    I'm using Moodle3.5.2 as client and Moodle3.6 as server.

    Thanks,
    Azmat
  • Céline Perves
    Mon, 13 May 2019, 3:23 PM
    Hello, I am migrating this plugin into 3.5 version and will publish it as soon as possible
    But you mus'nt use this plugin with 2 different version of moodle
  • Carlos E. Mansilla G.
    Sun, 22 Mar 2020, 5:14 AM
    Hi, how about a version for Moodle 3.5??.. i really need to used right now.. and.. is there a chance to use in Moodle 2.5??
  • Céline Perves
    Mon, 23 Mar 2020, 11:58 PM
    Hello, the 3.5 version is ready but I did'nt have time to update it and push to moodle.org
    In the current context I have mission to finish before doing it
    I'm going to contact you directly
  • Carlos E. Mansilla G.
    Tue, 24 Mar 2020, 2:00 AM
    thnx Celine, that will be great
  • Céline Perves
    Tue, 24 Mar 2020, 4:12 PM
    Working on code correction to pass moodle robots and publish last version
  • Ángeles - Aulamoodle - https://www.sagoweb.es
    Wed, 18 Nov 2020, 8:34 PM
    Is it valid for moodle 3.9? Thank you
  • Céline Perves
    Thu, 19 Nov 2020, 2:40 PM
    Hello, I have a version in progress for 3.9 not already released/ validated but I can share with you through github
  • Ángeles - Aulamoodle - https://www.sagoweb.es
    Thu, 19 Nov 2020, 5:03 PM
    Would be great. Thank you !
  • P S
    Fri, 8 Jan 2021, 11:48 AM
    Hi, Is the plugin compatible with 3.8. We have been unsuccessful in installing the plugin?
  • Céline Perves
    Fri, 8 Jan 2021, 2:55 PM
    Hello,
    I don't kwow if it works with 3.8 version
    I, at the moment, working in our moodle migration to 3.9 and will then publish a 3.9 version of the plugin
    For the moment you can try the plugin with your 3.8, in case of trouble contact me through github repo and i'll correct all the necessary things
  • Wolfgang Stettler
    Wed, 14 Apr 2021, 10:21 PM
    We are transitioning to 3.10, but I will test if the Version for 3.9 is working.
  • Céline Perves
    Fri, 16 Apr 2021, 4:59 PM
    have a first version fir 3.9 moodle version , I can put it on github if you are interested
Please login to post comments