Site Backup - moodledata directories

Site Backup - moodledata directories

by Richard Trout -
Number of replies: 5

Hope this is in the right forum.

Am using Amazon S3 to backup/sync moodledata. Am wondering if it is necessary to backup all folders, as some seem to be session related and unlikely to be used in the event it is necessary to restore, eg.:

moodledata
   /cache
   /localcache
   /lock
   /sessions
   /temp
   /trashdir

Am I ok to exclude these folders from site backups of moodledata?

Using Moodle 3.1 on linux, using aws cli.

I am of course also performing backup for database and moodle code.

Thanks, Richard.

Average of ratings: -
In reply to Richard Trout

Re: Site Backup - moodledata directories

by Ken Task -
Picture of Particularly helpful Moodlers

Think I'd include the localcache directory in the backup ... the only reason for that is theme.   Some folks have reported issues after updating/upgrading with rendering of the site (YUI combo loading).  On a heavily used site: 7.9M    ./localcache ... which isn't much but site isn't loaded up with a bunch of non-core themes either.

'spirit of sharing', Ken

In reply to Ken Task

Re: Site Backup - moodledata directories

by Richard Trout -

Thanks for the reply Ken.

What's the difference between the localcache and cache directory contents?

In reply to Richard Trout

Re: Site Backup - moodledata directories

by Ken Task -
Picture of Particularly helpful Moodlers

Since you do have cli access you could do an ls -lR to see everything in there.   Do know that the 'purge cache' links in moodle admin UI are supposed to work with those files in the cache.

an ls -1 shows:

cachestore_file
core_component.php
editor_tinymce
repository

on the site I used for example.

Your's might have some differences.

Most is found in cache/cachestore_file/default_application/

and contain the following:

availability_grade_items
availability_grade_scores
core_calendar_subscriptions
core_capabilities
core_completion
core_config
core_coursecattree
core_coursecontacts
core_coursemodinfo
core_databasemeta
core_eventinvalidation
core_externalbadges
core_groupdata
core_htmlpurifier
core_langmenu
core_observers
core_plugin_functions
core_plugin_manager
core_questiondata
core_string
core_yuimodules
mod_glossary_concepts
tool_monitor_eventsubscriptions

Not going to claim I know how the files contained therein actually work, but by looking at them from time to time in trouble shooting issues one can kinda figure out what they are related to:

Example:

/cache/cachestore_file/default_application/core_config/f5a-cache/ - which is one directory of many at that location has this file:

f5ab898cc28513f1f7efb04b87e02024c612e4ad.cache

which contains a one liner:

a:2:{s:8:"lastcron";s:10:"1480000202";s:7:"version";s:10:"2015111600";}

and in just looking at what ... last cron + the epoch time stamp + what looks to be a build/version variable I'll guess it has something to do with cron ... when it was last run, etc..

'spirit of sharing', Ken


In reply to Ken Task

Re: Site Backup - moodledata directories

by Richard Trout -

Thanks for your reply again Ken.

However I'm having trouble understanding whether the cache and localcache directories are holding anything that is important to the state of the moodle system. Do these folders contain what Moodle can simply recreate if they're not present?

I guess what I'm trying to clarify is whether the following directories need backup:

* cache - is this for performance and created as required?

* localcache - as for cache

* temp - used during transactions and then no longer required

* sessions - for current web sessions

* lock - file locks for transaction in progress

* trashdir - Moodle's recycling bin - cleaned up by Scheduled Tasks

These are my ASSUMPTIONS. Since the move to Moodle 2, I haven't seen much detail on Moodledata and what is necessary to backup (other than, ALL of it). My thinking was that if something is not essential, why back it up? And so my question about what I should ensure is included.


In reply to Richard Trout

Re: Site Backup - moodledata directories

by Ken Task -
Picture of Particularly helpful Moodlers

cache directory will rebuild as users login - click around - admin does stuff.

localcache is supposed to do the same thing.   The only reason I said any thing about maybe including the localcache is what it contains .... theme stuff.   Recent postings have indicated that some users have had issues with the site rendering *after* the upgrade.   That's theme - issues with YUI (Yahoo Libraries) combo loading, etc..   Since localcache isn't that large so that's why I suggested one might include that directory.   Have read in here somewhere Moodle is moving a way from YUI libraries (Yahoo has already said they are no longer updating/improving, I've read.   So that's a wise move ... just that moving away evidently has to be done gradually.)

4.4M    ./localcache isn't a lot.

Don't think you'll find any 'official moodle docs' on what's minimal backup of moodledata - cept the emphasis on filedir ... which everyone should know by now needs to match what one has in the DB for the site.   Filedir *cannot* be rebuilt from the meta data in the DB.

How fast/accurate can a cache be built?   Dunno ... at first the site will appear to be slower ... until cache builds up.

Of course you are free to do as you think appropriate (we are all in the boat!!!!) ... and I'm certainly NOT the last word on the topic. ;)

'spirit of sharing', Ken


Average of ratings: Useful (1)