Forums | Mahara Community

Support /
Inherited a broken Mahara

Mark Ward's profile picture
Posts: 5

17 January 2018, 3:11 PM

Hi folks.

I've inherited a broken Mahara (seems it was upgraded, failed, some components restored and then got going again around 8 months ago).

Symptom I have is artefact files are missing from the actual files mahara directory. I have located old copies of the maharadata folders.

What I'm trying to do is query the artefacts table and locate missing physical files so I can try and locate them and restore them. I have done a couple 'manually' and this has resolved the missing files.

I'm unclear on what the 'path' field on the artefact table refers to. e.g.

| title              | path        |
| FullSizeRender.jpg | /6104       |
| FullSizeRender.jpg | /9418/9130  |
| FullSizeRender.jpg | /5538/17999 |
| FullSizeRender.jpg | /20404      |
| FullSizeRender.jpg | /24434      |

In order to use this to query the filesystem.




Robert Lyon's profile picture
Posts: 444

17 January 2018, 4:52 PM

Hi Mark

To find out how files in the dataroot match up to info in the database you need to do the sql query

 SELECT, a.artefacttype, a.title, aff.fileid FROM artefact a JOIN artefact_file_files aff ON aff.artefact =;

And it is the artefacttype +  fileid that we need to use to do the check.

The way we store the files is they all get stored in artefact/file/originals/ except for profileicons they get stored in artefact/file/profileicons/originals/

To find a file we need to know what sub directory it is in so we take the fileid number and find it's modulo by 256 , eg if the fileid number = 2000 then 2000 % 256 = 208 so the file would live at  artefact/file/originals/208/2000

Hope that helps



2 results