How do you delete the files that media sync shows missing from file library?
-
I think these are old files in the DB, had a site failure and had to upload an old database file. Ive tried cleaning out the db but the sync file option in your plugin still shows quite a few files that I dont need. Thanks!
-
If I’m reading you correctly (the confusion is “physical file on disk” or “database entry”), I think you’re asking for something that is outside of what Media Sync can do (which is add media DB entries for disk files that don’t have one).
However, the Media Library itself has two features that I think will do what you need — whether it’s Media DB entries that are not used anywhere (unattached) or media DB entries with no actual file (use the “Filter by missing file” filter). Once you have the list of what should be deleted, use “bulk delete” on it.
As always – especially when doing something like this, which could go badly – backup your database before making the changes/deletions.
Here is the main page:
https://www.dropbox.com/s/q4m4blvdciztlwi/Media%20Sync%201.png?dl=0
It shows a bunch of files missing from the Media Library. Three questions:
1) Why exactly are these files missing from the Media Library?
2) Why do they show up here?
3) If they are deleted does it pose a risk?The other part is that there is NO option on this page to bulk delete. When I go to the Media Cleaner page and run a scan none of these files show up… so no option to delete. Thanks!
I suspect the confusion arises from the word “missing”.
Maybe it should be saying
“Show only files that do not already exist as Media Library entries.”In other words, you are seeing candidates that maybe should be imported by Media Sync —
if that’s what you want to do with them, and there are any actual files in the 3 folders I can see listed in the screenshot.They do not show up in the Media Library because there are no DB entries for them.
In other words, it appears that all is well.
There are quite a few files… I have no idea why they are showing up, what it means, and if I should clear them out… and how to clear them out. When I run the cleaner these files do NOT show up… thanks.
https://www.dropbox.com/s/ecc3xl5fb01bvc9/2022-10-15_14-24-10-387.mp4?dl=0
Im confused. Thank you for your help. So are these files somehow in the DB that were previously uploaded but maybe deleted at some point? What happens if I sync them or fix the issue and those files were not needed? Will they cause a conflict. Thanks again! Trying to figure out how this function works.
Please understand which direction is the “primary” for the two separate things (Media Sync plugin and Media Library component of WordPress).
Media Library looks in it’s DB and for each of the items there, it looks for a matching file. It is NOT looking at ALL files.
Media Sync’s job is to look in the specified file directory(s) and see if there is a matching DB entry for each file. It is looking at all files – even the many non-media (eg. *.css, *.log) files you have in those directories.
P.S. I note that your scan directory name is not showing up in the scan listing header – this makes me think you are running a downlevel version of Media Sync. Current is 1.2.9.
I do have the 1.2.9 version
Ok, so the sync function is looking into the DB for these files and then offering to sync them in the library? It might be outside the bounds of your plugin, but how do I get rid of those files in the db? The reason I ask is that some of those are connected to plugins I no longer have and were deleted. Thanks. So basically how do I get rid of whats NOT syncd as a suggestion in your plugin? Thanks again!I’m sorry I am unable to explain it any clearer than I already have.
Please re-read my two prior explanation replies as to what is happening.Those files are NOT in the Media Library database.
They are ordinary files on your server’s disk.They just happen to be in the same directory as where Media Sync has been told to look.
I can not advise you as to whether they are needed or used by anything else in your WordPress installation.Ok thanks again. I will go through what you described.
One last thought. Can I ask how to get rid of these in the general woocomerce forum, since this is not within the scope of your plugin? Thanks again. I just dont understand why these files are present since most of the files have been deleted or are related to plugins I no longer use or have. ..and if thats the case how to actually clean them out if possible. I have used a few DB cleaners but they dont seem to detect these items….
Sorry for the late reply, I’ll try to explain it in slightly different words maybe. But everything @simonkane said is true – thank you!
In short – this plugin can’t delete those files on your server.
It can scan your “WP uploads folder”, then import them (create new DB records) which will make them available/visible in WP Media Library.
So if those files won’t get mixed up with other files in your Media Library, you could use this plugin to import them (create NEW database records for them), then find newly created items in Media Library and delete them from there.And a few more clarifications:
I think these are old files in the DB
If you’re referring to files from your screenshot/s (when you use “Only files missing from Media Library” filter), that is not the case. It’s the opposite, I mean, they might be old files, but those are NOT in the DB. So “Only files missing from Media Library” means “not in DB” which means “not in Media Library”…
Ive tried cleaning out the db but the sync file option in your plugin still shows quite a few files that I dont need.
Yes, if you delete [only] db records – those files show up in this plugin. Because you delete only db records and not actual files on the server – this is not automatic, and it’s why this plugin is useful.
1) Why exactly are these files missing from the Media Library?
2) Why do they show up here?
3) If they are deleted does it pose a risk?1) Because they exist in the uploads filter but not in DB
2) Same as #1
3) To me, any deleting is a risk, so please be careful and don’t use this plugin in a rushNO option on this page to bulk delete. When I go to the Media Cleaner page and run a scan none of these files show up… so no option to delete.
Yes, this plugin can’t delete files, but if you first import files to Media Library, you can use the bulk delete option in Media Library – which will then delete both DB record and the actual file (you only see with this plugin).
I have used a few DB cleaners but they dont seem to detect these items
These DB cleaners might be causing the problems. If they just delete files from DB but not real files (which you can see with this plugin).
—
Sorry for repeating myself, but I just wanted to cover everything and say it in different words. But if all of this is still confusing (which is totally understandable), you can just ignore those files (that you only see with this plugin). I mean, if you don’t have a problem with disk space on your server.
But this delete option would be interesting and it kind of fits within the core purpose of this plugin. But if I ever find time to add it, it would have to be with some “undo” option, so that files are not actually deleted right away, but maybe after 1 month or something like that. I don’t want people to delete actual files by mistake ??
Hope you find a way to clean it all up.
Erol
And yeah, the meaning of “sync” in this plugin is not some syncing of database records across WP and its various plugins, it’s the sync between database and folder.
Ok, thank you. That clarified things. Ill just ignore for now…
If you need support then per the forum guidelines please start your own topic.
You can do so here.
- The topic ‘How do you delete the files that media sync shows missing from file library?’ is closed to new replies.