0

I have a hosting that has a disk size limit of 50GB. Right now the moodledata folder on the server is 40GB in size. I have other hosting with bigger ssd size. Question: Is it possible to transfer moodledata to another server and have the files uploaded directly to the external server

I looked in the direction of connecting the FTP of an external server, but I have no idea how to authenticate in the config.php. I do not consider options with S3, google, onedrive. The moodledata folder must be located on a different server and the interaction with the files must be on a different server. But the moodle itself is on the main server

Wockeez
  • 396
  • 1
  • 4
  • 11

1 Answers1

1

40gb sounds a lot for a Moodle data folder

Maybe investigate why its so big, I'm guessing its course backup files

This will list the files in descending file size

SELECT *
FROM mdl_files
ORDER BY filesize DESC
LIMIT 100

If they are mostly backups, then there is a tool here from Catalyst that will allow you to manage them

https://moodle.org/plugins/report_allbackups

You could download the course backup files and store them elsewhere before deleting them. Or maybe contact the user/teacher who created them and ask them to store them off line.

Russell England
  • 9,436
  • 1
  • 27
  • 41
  • The large size of the moodledata folder is due to the fact that there are a lot of loaded documents in Moodle. All backups are disabled). There was an idea to somehow clear the old documents, but I don’t understand how these documents are linked in the database. (For example, filter all uploaded documents older than 6 months and delete from the server and from the database) – Wockeez Dec 12 '22 at 09:08
  • The file location is stored in `mdl_files` - you should be able to work out from component+area+filename which ones are documents. There's also a timecreated and timemodified for the 6 months. The file path is basically filedir / first 2 characters of the contenthash / 3 and 4th characters of contenthash / contenthash - but deleting these manually will break Moodle when trying to display a file that doesn't exist any more. – Russell England Dec 12 '22 at 10:27
  • You could write some code to create a report, have a look at the Catalyst plugin above, or see the documentation here https://moodledev.io/docs/apis/subsystems/files and have a look through the functions in `lib/filestorage/file_storage.php` – Russell England Dec 12 '22 at 10:28
  • You could also use a repository for external storage of uploaded files - there are a few options here https://docs.moodle.org/401/en/Repositories – Russell England Dec 12 '22 at 10:31
  • Thanks Russell, I will investigate this issue further. – Wockeez Dec 16 '22 at 12:09