Create a back up

Create a back up

by bala chandra -
Number of replies: 6

Hello,

Currently, I am using Moodle default Back UI / CLI script to back up courses. 

When I have to do lot of back up, I have to definitely us the CLI script for the back up. 

But, there is a issue I am facing here, user.xml file is being included in the course backup, this is not required for me, How can I modify the CLI script so as to avoid this inclusion of user.xml file???

thanks in advance...

regards  

Average of ratings: -
In reply to bala chandra

Re: Create a back up

by Ken Task -
Picture of Particularly helpful Moodlers

Check Backup Default settings.  Users are included by default.

Site administration -> Courses -> Backups -> General backup defaults

Turn that off.

The CLI backup script reads/uses that config and cannot override via CLI switch of any kind.

'SoS', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: Create a back up

by bala chandra -

Thank you very much sir.. That was really very helpful... smile

And any way to give custom name to the backup file???


Thanks again

In reply to bala chandra

Re: Create a back up

by Ken Task -
Picture of Particularly helpful Moodlers

Explain ... 'custom name'.

There are options in same setup of defaults for backups --- include course ID ... include short name, etc.

'SoS', Ken

In reply to Ken Task

Re: Create a back up

by bala chandra -
Like currently when I run the backup script it gets named like "backup-moodle2-course-32-term_es1-20190704-1446.mbz"
Where I just want it to be named "backup-moodle2-course-32-20190704-1446.mbz"

I checked in the general backup defaults again, I could not find any such options to include course id, short name..

Kindly guide me through
In reply to bala chandra

Re: Create a back up

by Ken Task -
Picture of Particularly helpful Moodlers

Hmmm ... guess my memory is faulty. :\  So just checked a 3.7.highest moodle.   That option is in autobackups config.   Sorry 'bout that!

In the GUI backup, 3rd step in one is presented with a confirmation/review page.  The filename ... like ... backup-moodle2-course-136-mdlsampler-20190924-1108.mbz ...
could be renamed there.

CLI:
[root@server cli]# php backup.php
Perform backup of the given course.

Options:
--courseid=INTEGER          Course ID for backup.
--courseshortname=STRING    Course shortname for backup.

Anything else, guess one could hack core code .... not advised, BTW ... and can't help ya there!

'SoS', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: Create a back up

by bala chandra -

Well, Thank you very much for the help..

I shall check it out

Thanks again for your time smile