Is it possible to Backup all courses with in one time?

Is it possible to Backup all courses with in one time?

by Narit B -
Number of replies: 10

Hi!

I'm using Moodle 3.3.4 on QNAP TS-453 Pro


Now i already have 84 courses in 9 categories. In term of Admin may i ask how can i backup all the 84 courses in one time?

How about copy the hold Moodle folder is that the right way? 


Note: i tried to googling and found that have 3 thing to considering are  Database, Moodle data, Moodle code but still not much understand because some need to write the PHP script to backup (Maybe i'm don't know much to do PHP coding)    


Please advise how to backup all courses or entire moodle site in the simple step. 


Thank you for your help in advance

Average of ratings: -
In reply to Narit B

Re: Is it possible to Backup all courses with in one time?

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

I do my backups a little different.  I make a backup of my entire site every night using a shell script. It's a complete site backup, not individual courses backup.  My site has around 33 courses, mostly in one category.

If something went wrong with one of my courses right now, I could then backup/restore from the entire site backup.  Again, this is slightly different than what you seem to be asking.

I'll attach my shell script.  Maybe it will help.  I am running a Linux VPS.


Average of ratings: Useful (2)
In reply to Rick Jerz

Re: Is it possible to Backup all courses with in one time?

by Narit B -

Hi Rick Jerz,

Thank you for your responded my question. 

Yes, that can be help me to backup for the entire moodle site. 

Is that mean backup all: 1. SQL Database 2 Moodledata 3. Moodlecode right?

Note: To be honest i don't know much how to use shell script. Is possible could you have a simple step how to do backup with the shell script as your attached.


Thank you for help in advance.  




 

In reply to Narit B

Re: Is it possible to Backup all courses with in one time?

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Yes, Narit.  This script that I wrote will do a complete backup.  This backup could then be reinstalled on any similar server.  I use my backups to regularly install a copy of my production moodle into my experimental (MAMP) server, on my Mac.

Some parts of this script will need to be modified for your own server.  I am providing mine as a (good) example.  You would certainly need to modify some lines, for example, the line with a password.

I cannot provide a step-by-step instruction of how to modify this script.  You just need to study and learn.

To use this script, it has to be somewhere (in a safe spot) on your server, and then it gets executed with a CRON job.

Appreciate that in these server/moodle systems, there is great flexibility about how the administrator wants to do things, which is why step-by-step instructions are difficult.  How does one get from Chicago to New York City, or from Paris to Rome?  Many many ways.

I should also mention a few more things.  I run this script only once each day (during the early U.S. morning hours.) Some might want to run it more regularly.  Also, this script does a rolling (or moving) seven-day backup.  It assumes that your server has space for these backups.  Some might want to combine this weekly backup scheme with a longer, like monthly, backup scheme.  Also, it is good practice to mirror these backups to a secondary location.  I am not practicing "good practice" yet, but it is on my list of things to do.

Disclaimer: I am not trained as a system administrator.  I am only sharing what I have learned.  It seems to work for me.  Others will provide more help.

Average of ratings: Useful (2)
In reply to Rick Jerz

Re: Is it possible to Backup all courses with in one time?

by Narit B -

Hi Rick Jerz

Thank you once again for explanation about the benefit of backup script. it's should be work fine for me too but i need to study and learn more about how to use this script on my NAS TS-453 Pro. 

I am also not trained as a system administrator. just only learn by myself and especially in this forum i have learned a lot of the moodle knowledge.


Note: May i ask about moodle backup, if i can access to Web folder in the Server.  Can i copy all folders such as Moodle folder, PHPMyAdmin Folder etc. directly?  and Is this can backup all the entire moodle site? 


Thank you in advance.

In reply to Narit B

Re: Is it possible to Backup all courses with in one time?

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Hi Narit,

The answer to your question might be, in theory, yes.  However, I doubt that it would work!  Never worked for me, and there are way too many files and folders, so the process would take forever.  PHPMyAdmin does offer the ability to create a backup.  In my experience, it requires some careful setting of parameters so that it doesn't time-out.  In my own experience, the only trouble-free way is to do the backup in Linux with the mysqldump command.  Just for reference, on my small Moodle, it takes less than five minutes for this complete backup script to run.  My database files is around 1.3GB, and my moodledata backup about 2.7GB.

In reply to Rick Jerz

Re: Is it possible to Backup all courses with in one time?

by Narit B -

Hi Rick Jerz,

Thank you once again for responded. Yes i think so like your mention and also tried that it's didn't work when i copied with it Moodle folder is fine but PHPMyAdmin folder can't copy even i can access to that folder.

However i better to learn more and try to find the way to use your shell script with my NAS QNAP TS-453Pro.


Thank you 

In reply to Narit B

Re: Is it possible to Backup all courses with in one time?

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

I am not a "server" guy, so I don't know what a NAS QNAP TS-453Pro is.  So I won't be able to help about that.  But I think that you are understanding the general concept of running a script to do your complete backup.

In reply to Narit B

Re: Is it possible to Backup all courses with in one time?

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
If you are happy with a https://docs.moodle.org/en/Site_backup it is done outside Moodle, through the operating system.

If you are looking for https://docs.moodle.org/en/Course_backup you can automate it, as described here https://docs.moodle.org/en/Automated_course_backup.

There is also https://docs.moodle.org/en/Site_Backup_for_Low-tech_Users.
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: Is it possible to Backup all courses with in one time?

by Narit B -

Hi Visvanath Ratnaweera

Thank you for your responded and resources. I will learn and explorer more on that.


Thank you