How to Bulk Delete Deleted Documents


How to Bulk Delete the Deleted Documents instead of one by one?

Any button and server script?

Hi @Nitin_Chintamani,

If the user has system manager rights then will do it.

Thank You!

1 Like

Thank you for your reply but if I have more than 60K entries, its a very time consuming task and it also consumes my daily time limit on Frappe Cloud.

In the file
/home/<erpnextUSER>/frappe-bench/apps/frappe/frappe/desk/doctype/bulk_update/ you could temporarily change the limit of 500 to get a longer list but even if you DO know what you’re doing, it would be very dangerous.

Thanks, but deleting one by one is still a big task. There should be something like Delete All in Error Log

If you want to clear things in the error log, you can try this…
mysql -uroot -p -A; #the -A speeds up opening the relevant DB

and then run the delete command something like below (tuned to your requirements[method like ‘%send_mail%’;] and with YOUR DBname[_fhjaeouy1oweyut9c4]. You can look in the table for a specific entry that you want to delete to figure out what the query should contain

use _fhjaeouy1oweyut9c4;
delete from `tabError Log` where method like '%send_mail%';

How safe is it to delete Deleted Documents ?

What about other tables? How safe is it to clear older records from some table like [version-12],

tabRoute History
tabAccess Log
tabData Import 
tabData Import Legacy
tabActivity Log
tabEmail Queue Recipient
tabEmail Queue
tabOAuth Bearer Token

Also, there’s thousands of Data Import Legacy records, with files; as they are successful, if we delete them, shall there be any issue?

and, what’s __global_search this has millions+ records?