Backup and Restore Command-Line Interface

Administration tool ::: tool_brcli
Maintained by my profile picturePaulo Júnior
BrCLI (Backup & Restore Command-Line Interface) is a plug-in integrated in Moodle that allows administrators to backup and restore courses via a command line interface.
Latest release:
1104 sites
224 downloads
29 fans
Current versions available: 1

BrCLI

BrCLI (Backup & Restore Command-Line Interface) is a command-line plug-in integrated in Moodle that allows administrators to performs bulk backup and restores of all categories, not just a single course.

Features

  • backup all courses of a specific category using a single command.
  • restore a set of courses backup files in a specific category.

How to use

Please type the commands below to know how to use this plugin:

sudo -u www-data /usr/bin/php admin/tool/brcli/backup.php --help

sudo -u www-data /usr/bin/php admin/tool/brcli/restore.php --help

Release notes

  • v1.2 - the description of the plugin was improved.
  • v1.1 - it is mandatory to inform the destination folder.
  • v1.0 - the restore feature is available.
  • v0.2 - allows the admin to backup all courses of a specific category.
  • v0.1 - initial version.

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2

Contributors

my profile picture
Paulo Júnior (Lead maintainer)
Alexandre José de Carvalho Silva: Product Owner
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Matthew Swanson
    Wed, 20 Jan 2021, 1:10 AM
    I think some of them are big and some aren't. I was doing some timing and it took about 15minutes per 300MB which seems pretty slow to me. I started the backup of 1500 courses on Friday evening and it is on 1300/1500 right now, currently around 400GB
  • my profile picture
    Wed, 20 Jan 2021, 1:21 AM
    I understand Matthew. Did you try to back the 300mb course up using the Moodle user interface? Did it take about 15min as well?

    This plugin (brcli) actually uses a Moodle API to backup each course. So, unfortunately I can't help you about the performance issue.

    However, I know someone is working to make category backup and restore available in the Moodle core: https://moodle.org/mod/forum/discuss.php?d=394427
    I encourgae you to visit the website above and check their proposal.

    Best regards. Paulo.
  • Matthew Swanson
    Wed, 20 Jan 2021, 1:36 AM
    Thanks Paulo. We haven't tried that, but since we are almost done it's not a big deal smile We are moving to a new LMS and so we will not be able to utilize the new feature in the core, although that sounds really handy. Thanks for your work on this! Obrigado por seu trabalho!
  • mario gharib
    Fri, 19 Feb 2021, 6:47 PM
    Hey Paulo Junior, thanks a lot for this great tool and I managed to install it correctly and also to perform a backup and restore.

    I need your help since I've reached a point in which I can't restore a course if it has questions in banks and quizzes. this is the error that it's given me when I try to restore it "Unknown setting: questionbank" (see code below).

    Restoring backup of the 4/4 course...
    instantiating restore controller 74a5d2834a969a7efadac492b1523d03
    setting controller status to 100
    loading backup info
    loading controller plan
    setting controller status to 300
    applying restore defaults
    Unknown setting: questionbank

    However, when I tried to manually restore the backup file, It gave me the below three messages:
    * The questions category "Default for 5th year", originally at system/course category context in backup file, will be created at course context by restore
    * The questions category "Synthese 2015-2016", originally at system/course category context in backup file, will be created at course context by restore
    * The questions category "top", originally at system/course category context in backup file, will be created at course context by restore

    Noting that I am trying to restore this course in another category.

    Please advise

    Thanks!
  • Zabelle Motte
    Wed, 24 Feb 2021, 10:49 PM
    Hello,

    This is a very interresting plugin while we plan to have a new Moodle server an bulk import courses.
    But you should give more precisions on datas that are stored in the course backups.
    There seems some user datas are integrated and some are not.
    Could you please explain more precisely wich datas are stored in the kackup mbz ?
    If it is possible to customize the datas backup while tweaking some of the code, please let me know how to do.

    With great thanks for this admin tool plugin.

    Kisses

    Zabelle
  • Rafael Rodriguez
    Thu, 18 Mar 2021, 3:33 PM
    Hi
    Thank you for this very nice plugin!
    2 Questions:
    Is there a possibility to exclude user information from the backup, like uncheck "include enrolled users"?
    Is the use of sudo -u www-data mandatory?
    Best regards!
  • my profile picture
    Thu, 18 Mar 2021, 5:52 PM
    Dear Rafael.

    Someone is working to make category backup and restore available in the Moodle core: https://moodle.org/mod/forum/discuss.php?d=394427
    Hence, we have not added new features in the "brcli" plugin. I encourgae you to visit the website above and check their proposal.

    Best regards. Paulo.
  • Pieter Van der Donck
    Mon, 12 Apr 2021, 5:43 PM
    Hi how do you run this plugin from IIS, i'm quite new and am unable to find the command line interface. This is for our test enverionment.
    On our Production environment i have an interface.

  • JONATHAN CARDOSO
    Wed, 9 June 2021, 8:17 PM
    Bom dia, Paulo Júnior. Existe alguma previsão de atualização desse plugin para a versão 3.10 do moodle?
  • JUAN FALGUERA
    Mon, 9 Aug 2021, 7:31 PM
    Bom dia, Paulo. Primeiramente parabéns e obrigado por manter essa ferramenta.

    Eu realizei o backup da categoria 2 há um mes atras e tudo ocorreu sem problemas. No entanto, agora eu preciso restaurar o backup e estou recebendo o seguinte erro:
    error/cannot_precheck_wrong_status

    Pode me ajudar, por favor?

    Obrigado.
  • rdp buy
    Sun, 10 Apr 2022, 4:35 PM
    Thanks for sharing the information. This site is Very helpful, people can share there information here very easily. Buy RDP and Work Remotely from any where. We are providing Cheap RDP, dedicated server, VPS & hosting at the best price!
  • Alexander Shulman
    Tue, 22 Nov 2022, 11:14 PM
    Hi!
    Will this work with Moodle v4.x? (if not, are there any plans for an update?)
    Thank you!
  • my profile picture
    Wed, 23 Nov 2022, 3:58 AM
    Hi, Alexander. Done! Thank you.
  • Miguel Ángel Sanz
    Tue, 28 Mar 2023, 7:55 PM
    Hi! There is any way using this comands to do a backup from all the categories? Thanks in advance
  • my profile picture
    Wed, 29 Mar 2023, 2:37 AM
    Hi, Miguel. Not in the plugin. However, you can create a shell script, for example, using the commands provided by the plugin.
1 2 3 4
Please login to post comments