I have a long term client that is running 5.6.4.0 (OK I know, its very old) but the system is big and complex and for the most part functions very well. I have been asked if its possible to clean out orphaned files from the file versioned system. First off is this possible? How can it be done? Any reasonable ideas welcome.
Thanks, we need to remove the files from the file store that are no longer required, The system has been alive since 2012 so has collected a good deal of files that can now be deleted.
My Extreme Clean addon removes old files, file versions etc. But its v9.
You would need to adapt the code in the relevant cleaners to work with 5.6.
Extreme clean works with a dashboard ajax bump-along or in a v9 task, both of which would be difficult to port back to 5.6. (Having said that, the original 5.6 extreme clean was a just a queueable job to clean old page versions)
You could use the code of the relevant cleaners as a starting point for building one or more 5.6. cli commands or simple jobs to run through the cli. I don’t think the data structures for files/versions have changed significantly. You would also need to clean up file attributes.
It won’t be easy, but could be quicker than starting from scratch. This is not a project I could provide any addon ‘support’ for
You could use a similar database query to get the paths of the files to be deleted before deleting the references, like this:
SELECT CONCAT('rm files/', SUBSTR(fvPrefix,1,4), '/', SUBSTR(fvPrefix,5,4), '/', SUBSTR(fvPrefix,9,4), '/', fvFilename) AS 'delete command' FROM FileVersions WHERE fvIsApproved = 0 AND fID is NOT NULL;
The result is a set of rm commands you would execute working in the application directory.
HI Thanks for the ideas, finally the client decided to add another 250GB of storage configured with a smaller Inode allocation size, I then symlinked the Files folder onto the new filestore. This has given us plenty of growth