Delete Orphaned Assets

We have a folder that contained a few custom assets that we built. Since then, we have removed that asset type from our system, but never deleted those unused assets from the asset map. I can no longer expand the tree to see those assets, as it says that asset type is not installed. I don't need the folder, or the files. How can I remove these? Seems like I might have to do it on a database level.


Thanks!

Matrix would still have the entries in the link tree and asset tables for those particular assets. I'm not personally familiar with the setup of your system, but is it possible to 're-install' the asset type, delete the instances of the assets, purge trash and remove it again? That would be the only way I could see doing it without custom sql commands run on the database to remove references to the unwanted asset type. There may also be issues with that approach if you have rollback turned on and attempt to roll your system back to a point in time where that asset type existed.


I'm sure the dev's have come across this before so I'll leave them to suggest a more bullet proof approach.

I generally try to make them into whatever the parent asset type was. So if they used to extend page, to something like this:
UPDATE sq_ast SET type_code = 'page_standard' WHERE type_code = 'my_custom_page';



Then see if you can at least view them and move them to trash.

Hi Nic,
I would have suggested you the script remove_assets_of_type.php to do the trick, but since the asset type is no longer installed on the system, the answer is yes, it will need to be dealt with on db level. Also while deleting asset directly from db, stuffs like treeid, asset links and schemas will need to be taken care of (if applied) will need to be taken care of. deleteAssetlink() in asset_manager.inc and the script i mentioned would surely help you construct the proper query.



Regards,

Ash


[quote]

We have a folder that contained a few custom assets that we built. Since then, we have removed that asset type from our system, but never deleted those unused assets from the asset map. I can no longer expand the tree to see those assets, as it says that asset type is not installed. I don't need the folder, or the files. How can I remove these? Seems like I might have to do it on a database level.



Thanks!

[/quote]

[quote]
I generally try to make them into whatever the parent asset type was. So if they used to extend page, to something like this:

UPDATE sq_ast SET type_code = 'page_standard' WHERE type_code = 'my_custom_page';



Then see if you can at least view them and move them to trash.

[/quote]



Thanks Greg, I will go this route.