Understand path for automated backups in relation to folders that I can access via ftp

Understand path for automated backups in relation to folders that I can access via ftp

by Ferran Hj -
Number of replies: 14

Hello,

I am trying to specify a directory for automated course backups in Moodle 3.8.3, installed on a Debian machine by a host provider. Due to my being a newbie, I don't run anything manually using a terminal. I can acess some server settings and the database of the Moodle via a Plesk. I access files via ftp, and in there the first directory contains something like this:

  • /httpdocs/
  • /mymoodle/
  • /logs/
I cannot access the folders that precede these; or at least I don't know why.

Now, I am confused about the composition of directories for the backups (Automated backup setup), and how it relates to my folders in the server (such as /mymoodle/moodledata/ and other folders).

I have read a few threads around this forum, such as this, but I fail to understand how to compose a path that would place the .mbz files into a folder such as /mymoodle/mybackups or httpdocs/mybackups.

I found an example by Ken Task in a reply, for a Linux case: /home/mybackups/, but how would I then access this folder?

Could someone explain in a simple way for a neophyte like me?


Thank you!

Average of ratings: -
In reply to Ferran Hj

Re: Understand path for automated backups in relation to folders that I can access via ftp

by Ken Task -
Picture of Particularly helpful Moodlers

Before venturing any advice, how much space do you have left to use?

Reason ... size of automated course backups (which is an unknown) could be really more than you have space.   And ... the very last thing one wants is to run out of space.

BTW, reason you saw advice given about /home/mybackups is generally on most linux systems but not always /home/ is the largest partition.

Also ... have been into only one OVH system to assist someone ... can say beyond a doubt they border on 'paranoid' thus making it very picky about stuff ... like this.

Do strongly advise you study up on use of Plesk on OVH.  Google that! smile

'SoS', Ken



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

Re: Understand path for automated backups in relation to folders that I can access via ftp

by Ferran Hj -
Thank you for the quick reply.

I will ask my provider regarding a possible setup with Google Drive. Until then, my plan was to host the backups on the server, and move them out of there once a month. With a generous margin, I expect a total of 5 GB to be used for that max. (In the future, I would try to learn to prepare and run a script to download and remove the backups).

For now I cannot afford the time to move the website to a different provider or cloud service. I want to try to sort this out with my current tools so that I can download all the courses once a month without having to enter each course. I understand that it might not be possible. In any case, I will keep a note of it and look into it in the future.
In reply to Ferran Hj

Re: Understand path for automated backups in relation to folders that I can access via ftp

by Ken Task -
Picture of Particularly helpful Moodlers

Repeat:

Before venturing any advice, how much space do you have left to use?

From what I can re-call, In your OVH panel, look for a column to the right ... it had information about things like space - how much was used ... and how much free space was available.

A guess by me (or anyone) could put you in dire straights ... no space left means no space for your DB as well and that is very bad news.   Could loose your entire site.

So once again:

Before venturing any advice, how much space do you have left to use?

'SoS', Ken

Average of ratings: Useful (1)
In reply to Ferran Hj

Re: Understand path for automated backups in relation to folders that I can access via ftp

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
If you have "Automated backup storage" (backup_auto_storage) set to "Course backup filearea" the automated backups will go to mymoodle/moodledata/filedir, where all the user uploaded files are. Not the best place if you need to find them manually (using the Shell or FTP).

For that you need to set "Automated backup storage" (backup_auto_storage) to "Specified directory for automated backups" and enter the path under "Save to" (backup_auto_destination). This could be anything where the web server has write permissions. Obviously you want it it also be in a place where you have FTP access.
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: Understand path for automated backups in relation to folders that I can access via ftp

by Ken Task -
Picture of Particularly helpful Moodlers

Believe it or not ... my only experience with someone hosted with OVH shared hosting and transferring to OVH VPS ... the OVH shared didn't have enough space to make a full site backup ... let alone automated backups of what was discovered later as large course backups.

So if this OP doesn't check space and goes forward with automated backups and runs out of space????????

On OVH shared system I was working on DB server and DB's for Moodle site were on same server.  DB running out of space corrupted DB tables - not all - but some.    Soooooooo ... train wreck!!!!

That's all I know! smile

'SoS', Ken


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

Re: Understand path for automated backups in relation to folders that I can access via ftp

by Ferran Hj -
Thank you both!

I checked on Plesk's statistics and found that the website that includes the Moodle has used "8723.4 MB out of Unlimited". Of those 8 GB, the database is about 3 GB. I am not concerned about lack of space. Last time I manually checked the courses, the largest backup was of about 120 MB, though the median size is about 5 MB.

@Visvanath Ratnaweera: thank you. This is exactly what I want to do. So, if I introduce /mybackups/ in the "Save to" field, would that folder be created inside /mymoodle/mybackups/ or directly at /mybackups/, or somewhere else? I understand that I should first create such folder and change the permissions, before Moodle is allowed to write any files there.

Sorry for the elementary questions. I would usually go by try and error, but I struggle to run the automated backups at will by just changing the scheduled day and time and see the outcome.

Thank you for your help and patience!
In reply to Ferran Hj

Re: Understand path for automated backups in relation to folders that I can access via ftp

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
In Unix when one indicates a directory as /some/path/directory/, it is an absolute path, i.e. starting from the root node of the computer's file system. So in a shared environment /mymoodle/mybackups/ is highly suspicious, or can not be taken literally. These paths usually look like /volXXX/dYYY/userfoo/home/moodle.

Whatever, you need to put an absolute path in to "Save to" (backup_auto_destination). Please read the docs https://docs.moodle.org/38/en/Automated_course_backup.
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: Understand path for automated backups in relation to folders that I can access via ftp

by Ferran Hj -
Thank you for your reply. Understanding these paths is where I struggle, as I have no experience with what each of the usual folders is for, where are the different parts of a website and a moodle placed in, etc.

Looking around the Plesk, I have understood that /mymoodle/ is actually in /var/wwwv/hosts/mydomain/mymoodle

Additionally, Plesk allows me to access at the level of /var/wwwv/hosts/mydomain/ via ftp.

I checked the /home/ folder that is at the same level as /var/, and it seems to be empty. I am also not sure how to access that via an ftp connection.

Therefore, does it make sense to set up the following in "Save to" for the backups: /var/wwwv/hosts/mydomain/mybackups/

Would this be bad practice for any reason?
In reply to Ferran Hj

Re: Understand path for automated backups in relation to folders that I can access via ftp

by Ken Task -
Picture of Particularly helpful Moodlers

If the directory to which you save autobackups is in same folder as moodledata (where one sees filedir) your site backups will increase in size.

Where to store automated backups is always an adventure.  Not sure there is a 'best practice' ... dependent upon systems.   I, for one, like to save those to attached storage location.  Yes, attached storage cost.  Why?  If main server file system is lost for some reason, attached storage can be mounted by another server instance and if site backups of moodle (code/DB/data dir) are there can restore.

Good providers do customer space backups .... your entire server ... but they might have them on a monthly schedule.  If having to rely on that, could mean you loose whatever was done from the time of that site backup to the date/time server crashed.

Don't forget you have a Plesk File Browser and can download files using it as well.

Some notes from my month long experience with OVH and Plesk ... Debian system .... for what they are worth:

Your system might be different.

Following has to do with location of the directory you must manually create
(moodle will not create it for you) for the automated backups.  Link not specific to Moodle but still applies to a directory you create for automated backups if outside directories you can see in FTP:

https://support.plesk.com/hc/en-us/articles/115000278993-A-website-hosted-in-Plesk-is-not-accessible-open-basedir-restriction-in-effect-File-is-not-within-the-allowed-path-s-

Plesk itself uses the same DB as Moodle - MariaDB on systems I was on.
Tweaks to config for MariaDB apply to DB's for Plesk.
Version of MariaDB on system I had access to was 10.0.x - an out of date version.

Plesk from command line ... has it's own commands ... not that OP is gonna
do CLI, but ...  had commands specific to DB's.

In one of them ... did see 'unlimited space' but a tar ball of data directory for moodle could not be made from command line.

That's all I know .... good luck!

'SoS', Ken

Average of ratings: Useful (1)
In reply to Ferran Hj

Re: Understand path for automated backups in relation to folders that I can access via ftp

by Ken Task -
Picture of Particularly helpful Moodlers

'I will ask my provider regarding a possible setup with Google Drive'

Could do that only on a VPS - you are only customer.  Requires installation of a 'Google File System' to the operating system.  And then set up via a Google system account to access/mount.  If provider does that for you, you'd have to share sensitive info about that Google account.

If going that route, Google does offer a Google Bucket - starts at 1 Pentabyte.  Cheaper than OVH attached storage.   Therefore, wonder if techs at OVH/Plesk would actually help/do - although change might be forthcoming with OVH ... like Sitegrounds move to Google infrastructure.

There is also Google Sync.   Installed on local machine makes access to autobackups on a Google Drive accessible to local machine.  Significance ... don't have to xfer files ... just mount.

'SoS', Ken


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

Re: Understand path for automated backups in relation to folders that I can access via ftp

by Ken Task -
Picture of Particularly helpful Moodlers

Follow up ... something else you might want to check into ... yes, commercial but didn't think that expensive considering what one could do with it.  Time is $?

https://www.expandrive.com/

'SoS', Ken

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

Re: Understand path for automated backups in relation to folders that I can access via ftp

by Ferran Hj -

Thank you! I will have to re-read these answers a couple of times. As soon as the current semester is over I will carefully look into the options you mentioned.

Could you clarify this: "If the directory to which you save autobackups is in same folder as moodledata (where one sees filedir) your site backups will increase in size."

If the backups are course-level backups, and the backups are placed in a folder outside of /moodledata/ (or outside of /mycampus/ altogether), why would these new files in the system have an effect on the size of subsequent backups?

In reply to Ferran Hj

Re: Understand path for automated backups in relation to folders that I can access via ftp

by Ken Task -
Picture of Particularly helpful Moodlers

Devils are always in the details ...

If autobackups are saved to a folder in moodledata/ the ***site*** backups .. which are usually code + moodledata will be larger.

Obviously, if autobackups of courses goes to some other directory, above is not true.  Those backup sizes only increase when something is added to a course.

May not make a diff to you ... but ... as an example:

moodledata of a busy K12 site is 688G on a 2T attached device ... and easier/faster to use rsync now rather than make a tar ball of it - when archiving to network storage.

On same device, course backups are in a clibackups and is 232G in size.

Is it better to put all your eggs in one basket? (for thought not response)

'SoS', Ken


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

Re: Understand path for automated backups in relation to folders that I can access via ftp

by Ferran Hj -
Understood! Thank you, Ken!