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

Should Cache Files Be Backed Up?

$
0
0
by Natassia Stelmaszek.  

I have to believe that this has been covered somewhere but I haven't been able to find it in my searches.  When doing a system backup the documentation seems to recommend backing up the "moodledata" directory.  That directory contains cache files and session files that seem to change regularly (frequently) and on our system they take a huge amount of time/space to back up. 

Is it necessary to keep these files backed up or are they just things that will be created as needed when the site is in use?

Example: moodledata/cache/casestore_file/default_application/core_htmlpurifier/ (subdirectories numbered from 001 through FFF!)


Thanks

Tasha


Re: Should Cache Files Be Backed Up?

$
0
0
by Tim Hunt.  

There are two sorts of cache files:

One, small set of files stores the cache configuration in the folder called 'muc'. You want to back those up.

But you don't need to store all the cached data, stored in a folder called 'cache'. It can be re-constructed from the data in the Moodle database.

You can also skip backing up 'localcache', 'temp' and 'trashdir'.

Re: Should Cache Files Be Backed Up?

$
0
0
by Natassia Stelmaszek.  

Thank you, that'll save me a lot of time!

Tasha


Is there a graceful way to shutdown automated backups while they are running?

$
0
0
by Paul L.  

We are looking to implement automated backups but have concerns it will adversely affect overall performance. We have hundreds of courses and the backup process will likely run a long time.

Is there a recommended approach to killing a running automated backup process if we notice its adversely affecting performance? I use Windows server and IIS,

While the automated backups are running a CLI process shows up Task Manager, I could end the process but was concerned it may have adverse unintentional consequences, perhaps the CLI is even the regular cron job and I'm ending the wrong process too.

Is there a more graceful and safer way to shutdown automated backups while they are running?

If I alter the front end settings to exclude the day the backups are currently running on could that gracefully end the automated backups?

Thanks

====

environment moodle 2.7, windows server/IIS

Re: Is there a graceful way to shutdown automated backups while they are running?

$
0
0
by Ken Task.  

Could do this ... install course size report ... run it.  Determine which are the larger courses - which are the smallest courses.

From command line, use the moodlecode/admin/cli/ backup.php script that is in a script and loops through a listing of courses to backup.  List might include 2 large course and small courses.   Two of three of these list.  Run them under an operating system cron.

It's a work around, but ....

'spirit of sharing', Ken

Re: Course backups not automatically being removed.

$
0
0
by Paul L.  

My backups are not being deleted either, even though settings are set to only keep 1 copy.

4 of my courses have over 20 backups and are increasing 1 every day. To further complicate things I cannot understand why these 4 backups are occurring to begin with, as they are not being updated.

I'm using moodle 2.7, windows 2008/IIS. The course backups folder has Full Control permissions for the SYSTEM and IUSR user names so I didnt think it was a permissions issue.

Does moodle not recognize the previous backups existence because the date is included in the name, so it appears different each day?
ie backup-moodle2-course-4488-2016wi_busi_3324_01_16_18-20160124-1017
ie backup-moodle2-course-4488-2016wi_busi_3324_01_16_18-20160123-1017
Notice the 23 and 24 for the day of month.

Any suggestions on troubleshooting this, are there some logs I should be reviewing?

Re: Course backups not automatically being removed.

$
0
0
by Paul L.  

I forgot to add to the post above, I use 'specified directory for automated backup'.
Its on the same disk drive as moodle but in a seperate folder location.
moodle version 2.7.8

Re: Course backups not automatically being removed.

$
0
0
by Paul L.  

I just checked site admin-reports-backups. those 4 courses have Warnings on the main page, when viewing the detailed logs for each course the first line indicates Status OK but further down there's a common error like the following:

Missing file in pool: /ZZZZZ.pdf (context 286117 'File: ZZZZZ', component mod_resource, filearea content, itemid 0) [E:\moodledata\YYYYY/filedir/5b/50/5b5090bb837289dea6a23101b7de34920e772c48]

When I view the course and click the link for the file i get a file not found error and see in the moodledata folder that the file is not there.

Is this a bug with moodle? A missing file causes automated backups to continue daily even when they are unchanged and settings indicate they should only backup when changed. More importantly, these backups are not deleted even when the setting is to only retain 1, this can have disastrous consequences as it will quickly fill up our hard drive and manually monitoring for this problem is not feasible.

Re: Is there a graceful way to shutdown automated backups while they are running?

$
0
0
by Ken Task.  

After re-reading, realized that response didn't really answer the question ... so ... am sticking my neck out cause I don't run windows, but ... on the linux platform, I've never found a 'graceful' way of ending a process.  kill -9 pid does the job, but if the process was involved in building a backup, the process never reached the part in code that 'cleaned up', thus manual clean up was necessary, unless there is a scheduled clean up.  2.7 now has scheduled task that one could run manually but didn't see in the listing of task the clean up of moodledata/temp/backup/ files and diretories (folders).   There is one to clean up backup tables, however.

If you haven't implemented auto backups yet, then sounds like one is anticipating issues.  The first run autobackups will be perhaps the most intensive.   There is no info in the tables that Moodle could use as to when the courses were backed up last, etc..

There is a way to kinda tippytoe into auto backups, however.   Install course size report.  Run it.   Get the course ID's of the top 5 courses in size .... let's say it shows 5,234,65,31,and 1014.

Use the backup.php script in moodlecode/admin/cli/.   that script takes two parameters ... course ID and the destination for the backups.

In one shell script (I've heard Windows now has "powershell" so you might be able to use that), create the backup command for each course on a separate line:

php /moodlecode/admin/cli/backup.php --courseid=5 --destination=C:\whereever

php /moodlecode/admin/cli/backup.php --courseid=234 --destination=C:\whereever

php /moodlecode/admin/cli/backup.php --courseid=65 --destination=C:\whereever

php /moodlecode/admin/cli/backup.php --courseid=31 --destination=C:\whereever

php /moodlecode/admin/cli/backup.php --courseid=1014 --destination=C:\whereever

Once the script is created, pull out a timer, and start your timer the same time you start the script.

You'll get a better idea of how long the largest courses will take.

Thus, might be able to make a more educated guess as to the scheduling of automated backups in the Moodle UI - would think non-prime time for users in courses - wee hours of AM ... say 2-4 AM.

It's been years since have been in Windows and I assume one can cancel execution of such with keyboard strokes [ctrl][c].   To see what will happen (find out what will be needed to clean up) run the above script and during the first course backup try to cancel it.   Then go check moodledata/backup/temp/ and see what's there.   Also check the systems C:\temp or C:\tmp directories.

That command line script would only  involve PHP executing queries and then executing some action to build backup files, as well as talking to MySQL (eventually) to update tables related to status of last backup, date of last backup, etc..   Killing the script shouldn't affect persons in Moodle using.  Remember, there is a scheduled task that cleans up DB so one might not need to do anything DB wise.

'spirit of sharing', Ken


Re: Course backups not automatically being removed.

$
0
0
by Ken Task.  

Will backups work *IF* one removes the errant link to  the non-existent file in the course?   Moodle code only doing what it's been told to do ... backup, and include links to resource files (that's taken from meta data in the DB) and place those files in the backup.  

Remove the errant link to non-existent file, then run the backup manually.  Complete without error?

Question might remain, however, why/how was the file removed?  Thought IF there was one course (hidden or active) that linked to a file resource, the file would never been removed.

'spirit of sharing', Ken

Re: Course backups not automatically being removed.

$
0
0
by Paul L.  

I removed the errant link from one course and added a file to the expected file location for another course, both solutions appear to be working.

Makes me nervous knowing a simple missing file can result in a drive space filling up unless I manually monitor it?

Re: Is there a graceful way to shutdown automated backups while they are running?

$
0
0
by Paul L.  

re: Use the backup.php script in moodlecode/admin/cli/.   that script takes two parameters ... course ID and the destination for the backups.

Thanks for the tip, I'll keep it in mind.  I already have a rough idea of the numbers of large backups and total backups, about 20% are 100-500mb the rest of the 500 courses are under 100mb. I don't anticipate the large courses causing the backups to crap out the server (although I am trying to convince people to reduce the size) but the sheer number will likely run a long time (wild guess 4-12hr).

I don't think our server could handle it during the regular business hours without impacting performance, which we've noticed when manually doing a big course now and then throughout the day. We are considering starting a backup at 10pm and praying it ends by 9am, otherwise we'ld need to end this process if regular users are negatively impacted (disable automated backups and kill the process in windows server and hope that stops the backup?)

Re: Determining the number of course backup files and their total size

$
0
0
by Mark Chaney.  

Hi Ken, 

Thanks for clarifying the position of the database files and providing some handy SQL

Do you know if the filesize is in bytes?

Mark

Restoring 2.9 backups to 2.5 - only works 'via' 2.6

$
0
0
by Tony Delahunty.  

An observation rather than a question - but perhaps somebody can enlighten me with an explanation or improved workaround. 

I have Moodle 2.9 courses that I wish to recreate elsewhere in Moodle 2.5 (or lower) instances. If I restore the backups directly into a Moodle 2.5, it fails with that once-familar old error:  error/moodle/tmp backup directory not found

However, I can restore the 2.9 backups into a Moodle 2.6 instance, then backup that course within the 2.6 instance, then use that 2.6 backup to restore the course into my 2.5 instance; and this all works OK in the sense of creating the course, maintaining all the content, and avoiding the above error.

So I can restore down from 2.9 to 2.5, by using 2.6 as an interim stage; but it's a lot of work, and duplication that way. Any  better alternative? 

Re: Restoring 2.9 backups to 2.5 - only works 'via' 2.6

$
0
0
by Ken Task.  

Don't think there is any util, etc. The way you are doing really might be the only/best way.  However, depends upon if the bug required a lot a little.   So keeping that in mind think I'd investigate ...

Downoad a 2.5 backup (which used zipping to archive)

Downoad a 2.9 backup (which uses tar.gz ).

Decompress them both in different directories.

Inspect the moodle_backup.xml file as well as other .xml's related to files ... in other words, compare the moodle_backup.xml file from a 2.5 backup to the moodle_backup.xml file of a 2.9 backup for differences.

One might be able to 'doctor' the 2.9 moodle_backup.xml file to make it compat with 2.5 restore.

When re-compressing the doctored 2.9 backup, use zip.   2.5 talked only zip.   2.6 was the first version to introduce the new compression ... gzip (tar.gz).

Actually, that might be all you need ... download backup of 2.9, uncompress, recompress using zip restore to 2.5.

'spirit of sharing', Ken


No Backup Logs - Automated Backup Setup

$
0
0
by Theo Yianni.  

Moodle 3 - WMAP


I have set up automated backups (see attached). Weeks later and go to restore a course and there is no backups!


Any clue?


Thanks.

Re: No Backup Logs - Automated Backup Setup

$
0
0
by Emma Richardson.  

Have you set up cron?  That is needed to run automated backups as well as a host of other things on the site.

Backup, how it works

$
0
0
by Derek Chirnside.  

Just checking.  

Below: Is this the correct concept of how automatic backups work?

In other words, one file multiply linked appears in the backup for each course.  

So if you do certain things, your backups folder can get huge very quick.

-Derek


Re: No Backup Logs - Automated Backup Setup

$
0
0
by Theo Yianni.  

Is there a guide on this? I haven't heard of this before.

Re: No Backup Logs - Automated Backup Setup

Viewing all 6639 articles
Browse latest View live


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