Hello, I have a question regarding the Purge deleted uploads grace period days setting. The setting implies that in 30 days the upload (still in the post) which was deleted would be automatically and permanently deleted from the system after 30 days, so when you go back to that deleted topic as a staff member the image would not show up as it’s entirely gone.
I’ve gone back through our deleted posts, some last year way past the 30 day mark and yet the deleted posts still have working images in them. I’m not sure if the purge deleted uploads grace period days setting works at all and that you need to first remove the upload entirely from the post so it’s not referenced even if the post is deleted, and then after 48 hours the orphan setting should remove it for you permanently. I didn’t experiment with this yet though.
The purge_deleted_uploads_grace_period_days setting determines how long (in days) deleted uploads should remain in the system before being permanently erased. This process relies on uploads being considered “orphaned” to be eligible for deletion.
To fully remove an upload from Discourse, you’ll have to do one of the following:
Force the upload to become orphaned by removing any reference to the upload. This can be done by editing the upload link out of the post that it’s in, or any other places the upload may be referenced.
Delete any and all topics/posts containing the upload, causing the upload to be considered as “deleted”. Note that you need to remove the image from the post before deleting the post to orphan it.
All orphaned unreferenced uploads and deleted uploads will then be removed from storage (after a grace period set by the purge deleted uploads grace period days setting) once the clean up uploads job runs.
If you’re having trouble with deleted posts not being purged as expected here are a couple things you could check:
Verify that the clean_orphan_uploads_grace_period_hours setting is also set appropriately. This controls when unused (orphaned) uploads are deleted.
Make sure the deleted uploads are no longer referenced in the respective posts. If a post with a deleted upload still references it, the system may not consider the upload to be “orphaned.”
For reference, we also have a guide about Cleaning up uploads and purging uploads from S3 that has more information about how orphaned and deleted uploads are automatically purged from a Discourse site.