It would be possible to add a setting to disable document stub pruning. This would allow you to delete the files and just keep the database information about the document.
Seems simple enough at first glance that could be added in the next minor version.
I facing the same issue. So I created a feature to disables the deleting of document shells. It does by adding a binary flag to apps/documents/managers.py that causes it to skip the deleting.
I sent’ this code when @legosiv posted by has not recevied any reply from the Mayan team!
The code as submitted was not usable, was poorly written, did not followed our coding practices, was hard coded, and worked only for a specific use case. Feedback was provided on how to address all aspects but no reply was received.
We have move forward with a different approach and now archiving is more flexible as it can be tuned per document type.
Thank you roberto! I am really excited for it. When are you and the team planning to roll out the feature? The new features will be mentioned in the changelogs? Thank you so much.
Thanks for the request, it helped got things started.
Disabling document stub pruning for the entire installation was too extreme, so we made it more granular by operating at the document type level. Each document type can have different stub pruning settings, either by disabling it or extending the document stub expiration before pruning takes effect.
This is already complete, merged, and will be available in the next minor release, version 4.5.
The original target date for this version was June, but a lot of changes were added to the pipeline and it is now uncertain if we can make the June deadline.
This is how the feature looks, no additional changes are foreseen for now.
I changed the stub expiration date to 2 years! This would help me remove some files right away without mayan deleting the document wouldnt it? What is the maximum duration I can set? maybe 10 years would be ideal.
That will work until you upgrade to the next version.
Since the document stub pruning on version 4.5 is configured in a different way, it will start deleting document stubs.
It would be necessary to run a multi stage upgrade so that the database migrates but the background don’t execute and delete your empty documents. This is a custom upgrade process and not tested.
I recommend holding off manipulating the document stub pruning until after version 4.5.