MoodleCloud storage

MoodleCloud storage

by Yvonne Berg -
Number of replies: 4
We currently use the self-hosted version of Moodle on our server but are considering moving onto the MoodleCloud platform. How do I determine how much storage space I will need on MoodleCloud based on the current size of my Moodle installation? Is there a place on my installation that can tell me what size it currently is?
Average of ratings: -
In reply to Yvonne Berg

Re: MoodleCloud storage

by Cameron 👨‍🦲🟥⚡️ -
Picture of Core developers Picture of Peer reviewers Picture of Testers
Hi Yvonne,

There's not an easy way to see how "big" your moodle site is. I can give you the SQL query we use to calculate disk quota:

SELECT SUM(f.filesize) FROM ( SELECT DISTINCT contenthash, filesize FROM mdl_files WHERE filearea <> 'draft' AND referencefileid IS NULL AND component <> 'tool_recyclebin' AND (component <> 'backup' OR mimetype <> 'application/vnd.moodle.backup') AND component <> 'assignfeedback_editpdf' AND component <> 'core_h5p' AND component <> 'contentbank' UNION SELECT contenthash, filesize from mdl_files WHERE (component = 'core_h5p' AND filearea = 'content'> GROUP BY filesize, contenthash ) AS f");

This should return the number of bytes used by your site. Divide it by 1073741824 to get the value in gigabytes.

Cheers,

Cam
Average of ratings: Useful (1)
In reply to Cameron 👨‍🦲🟥⚡️

Re: MoodleCloud storage

by Yvonne Berg -
Thank you Cam, I appreciate your assistance, however running an SQL query is beyond my knowledge and comfort zone. We don't currently have a qualified administrator for our installation which is why we are wanting to move to the cloud. I was hoping there was a way to see the size in the Moodle admin or even in the directory as I have access and can use FTP to access the files.
In reply to Yvonne Berg

Re: MoodleCloud storage

by Cameron 👨‍🦲🟥⚡️ -
Picture of Core developers Picture of Peer reviewers Picture of Testers

Hi Yvonne,

Since you have FTP access I've written a small PHP script to query the DB for you:

<?php

require_once('config.php');
global $DB;

$bytes = $DB->get_field_sql("
            SELECT SUM(f.filesize)
              FROM (
                    SELECT DISTINCT
                                    contenthash,
                                    filesize
                               FROM {files}
                              WHERE filearea <> 'draft' AND
                                     referencefileid IS NULL AND
                                     component <> 'tool_recyclebin' AND
                                     (component <> 'backup' OR mimetype <> 'application/vnd.moodle.backup') AND
                                     component <> 'assignfeedback_editpdf' AND
                                     component <> 'core_h5p' AND
                                     component <> 'contentbank'
                                     UNION SELECT contenthash, filesize from {files} WHERE (component = 'core_h5p' AND filearea = 'content' AND filesize > 0)
                           GROUP BY filesize, contenthash
              ) AS f");

$index = floor(log($bytes, 1024));
echo round($bytes/1024**$index, 2) . ' ' . ['B', 'KB', 'MB', 'GB'][$index];

Save that in a file called "size.php" and upload it to the root of your moodle installation. Then browse to http://yourselfhostedmoodle.com/size.php

It should tell you how "big" MoodleCloud considers your site.

Cheers,

Cam

Average of ratings: Useful (1)
In reply to Yvonne Berg

Re: MoodleCloud storage

by Tennille Nicolette -
If you store your course files on another network, you can see the storage size there, and it would be roughly equivalent... except SCORM files. Double the size of every SCORM package, because Moodle unzips your SCORM package, but also saves the ZIP. So a 10 MB SCORM course will use 20 MB of Moodle file storage.
Average of ratings: Useful (1)