I have been copying files back and forth from my computer to the server. I realised this copies some images in the media folder that are not actually use
You might want to take a look at the Umbraco Pro product - Concierge which is capable of showing dependencies on files so you can tell if it's safe to delete a file or not.
Thanks Matt. Would you know how to do it manually? I'm a developer, I'd like to know the database. Or is there some kind of documentation for the database?
SELECT contentNodeId, alias, dataNvarchar AS umbracoFilename FROM cmsPropertyData INNER JOIN cmsPropertyType ON cmsPropertyData.propertytypeid = cmsPropertyType.id WHERE cmsPropertyType.dataTypeId = -90
Now I know, to clean up unused files, you scan for all files under the media folder that are not found in the result above. :)
This extension looks good, but using 7.10.2 I can't get it to complete a scan without timing out -- admittedly I'm attempting to clean-up almost 6000 media items. Can you extend the timeout period?
Hello,
exactly. MediaCleaner gets all the XML of all the nodes, and search for the media item in the content.
If the content is not present the media is marked as unused.
Pay attention that if you use a particular media only in static files (for example you use the media hardcoded in the templates), MediaCleaner will report it as unused.
How to find unused files under the media folder?
I have been copying files back and forth from my computer to the server. I realised this copies some images in the media folder that are not actually use
Hi Hardi,
You might want to take a look at the Umbraco Pro product - Concierge which is capable of showing dependencies on files so you can tell if it's safe to delete a file or not.
Cheers
Matt
Thanks Matt. Would you know how to do it manually? I'm a developer, I'd like to know the database. Or is there some kind of documentation for the database?
I found it! http://blog.hendyracher.co.uk/umbraco-database-part-1/
To find all the files that are being used:
Now I know, to clean up unused files, you scan for all files under the media folder that are not found in the result above. :)
Hello, I've made a script with Visual Studio to check for unregistered media files. Hope it helps.
http://our.umbraco.org/forum/using/ui-questions/36656-Delete-unused-media-items?p=0#comment152733
Hello, take a look at this: https://our.umbraco.org/projects/backoffice-extensions/mediacleaner/
it is compatible with all the database types and integrated in the Umbraco Backoffice.
Thanks, Michele
Hi Michele,
This extension looks good, but using 7.10.2 I can't get it to complete a scan without timing out -- admittedly I'm attempting to clean-up almost 6000 media items. Can you extend the timeout period?
Cheers,
Tim
Does MediaCleaner look for unused media ?
i.e. media objects that have not been linked to in content
Regards
Nick
Hello, exactly. MediaCleaner gets all the XML of all the nodes, and search for the media item in the content. If the content is not present the media is marked as unused. Pay attention that if you use a particular media only in static files (for example you use the media hardcoded in the templates), MediaCleaner will report it as unused.
WBR, Michele
Hi Michele,
Thanks for your response.
We added a media item, linked to it in content, then removed the link
But it didn't report it as orphaned …
We tried clearing cache, starting / stopping the site …
But still not reported as orphaned
Is their any sequence of tasks, that we should do to get media cleaner to report the latest orphaned files ?
Regards
Nick
is working on a reply...