Forums | Mahara Community
Support
/
Inherited a broken Mahara
17 January 2018, 15:11
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.
thanks
Mark
17 January 2018, 16:52
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.id, a.artefacttype, a.title, aff.fileid FROM artefact a JOIN artefact_file_files aff ON aff.artefact = a.id;
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
Cheers
Robert