This question about Configuration: Answered
Clean delete a topic and/or attachment
I'm setting up Foswiki and I'm not sure if I understand the complexity of cleanly deleting a topic and/or attachment. Does it really involve all the below steps? 1) Select to delete a topic/attachment from the topic's "More Action" to move it to Trash web. 2) For site administrators: To remove a topic permanently move it to the Trash web, then with file-level access, delete the .txt and .txt files manually from data/Trash. 3) For system administrators: To remove an attachment permanently move it to the TrashAttachment
topic, then with file-level access, delete the file attachment and its repository file manually from pub/Trash/TrashAttachment.
I tried it and apparently it's even more complex than that, since: 1) The data/Trash folder contain other files that must remain untouched (deleting these files will mess with the Trash web), so that means when I try to clean the deleted topics/attachments I would have to know which files in the folders to leave alone. As I am not familiar w/ this stuff I basically have to write down all files that exist after a clean install and be careful not to delete them by accident. 2) Even after doing the step above and cleaning out the deleted files, the TrashAttachment
page showed all the attachments I had. I had to manually edit the TrashAttachment
.txt file to remove the entries. Even then the history still remains and I haven't looked at how to clear this.
Please correct me if I was doing anything wrong or misunderstanding the instructions.
Suggestions: 1) If it's impossible to make some kind of "really delete trash" option in the Trash web, would it be possible to put all the files in a folder that contains nothing but trash? This way when I delete the files I know I won't accidentally delete some important files. 2) If it has to be this complicated, can there be a more detailed description in the Trash web's main page?
If you have admin access, you might as well just delete it straight away, instead of moving it and then deleting it. Either way, any links to the deleted topic will be broken, so the extra effort isn't warranted. Also, then you don't have to remove it from the Trash attachment history.
Only three things need to be deleted:
/pub/<web>/topic/ directory of attachments (if there is one), and its contents.
The easiest way to see what a clean Trash web looks like is probably to download Foswiki again and extract it into a working directory. For bonus points, you can use 2- or even 3-way diff tool to highlight your changes: some examples are mentioned in HowDoIUpgradeSafelyACustomizedFoswikiInstallation
- 24 Dec 2009
Thanks for the answer. So I guess there's simply no easier way to do this. At least I don't have to waste time trying to see if I missed something. This is standard Wiki practice? Seems to be a pretty big headache for admins.
- 24 Dec 2009
You could try creating a feature proposal
for a "clean delete", as you've described it above.
- 24 Dec 2009
What I've done at an active site is to set up a cron job to archive and remove the trash topics and attachments. With
you can use the
operand to pass a list of files to be excluded from the archive. Also use the
option to delete the files that are archived. And then because the TrashAttachments placeholder is also removed, recreate it by restoring a saved copy from the original distribution. The cron job could run weekly or on whatever schedule is appropriate for your installation. The list of excluded files was all of the Web* files that are shipped with Foswik (Anything that exists in the Trash web in a new installation, except for the TrashAttachments.txt file.
There are already a couple of feature proposals / development discussions out there on this topic. You are not the first.
There has also been some work done to improve the process, but it needs more. See Tasks.Item5384
Thanks for the additional info and I hope the current proposal will be implemented (I read parts of it). Since I'll be installing this on a Windows box, I plan on just having a simple Ruby script or batfile to delete the entire respective folders and put back a clean copy of them (saved from a fresh install) when I need to clear the trash. I tried it and it seems to work. A scheduler would be good idea too.
- 25 Dec 2009