Archiving org-mode files
If you have been using a specific org-file a lot and added many tasks over the last months or years, then it might be useful to archive some of the tasks.
The benefits ov archiving your tasks are mainly two-fold.
Firstly, the file gets a bit less cluttered. Maybe many old tasks you have already done are less relevant in your day to day work so it would be nive to hide them somehow.
Secondly, when the number of tasks are several hundreds or even thousands, then there is more for the system to process and different operations might slow down a bit. For this reason it might also be interesting to archive some older items.
Internal archiving works by moving tasks from their original place in the file to a location below a specific archive header. This means that the tasks stay in the same file, but are stoved away below the archive header. The archive header is just like any other header except for that it must have a special tag called ARCHIVE (
:ARCHIVE:). Without this tag, the header will not be treated as an archive header.
Tasks below an archive header will not be taken into consideration and will not be included in the Agenda views, Preview or table views or any other statistics calculations.
The benefit of using internal archiving instead of moving the tasks to another file or simple deleting them is that you still have all the past information readily available in your org-file where it belongs. You can also still search it suing the editor or the built-in filesystem/ripgrep search or any other search tool you might have installed on your system.
Moving tasks to Archive.
You can archive tasks by selecting from the menu
Agenda -> Archive Tasks.
A modal window opens which allows you to select to which heading you want to move the archived tasks to. Make sure the selected heading does have an :ARCHIVE: tag.
It also allows you to define a cutoff date for which tasks to move. Tasks which have a CLOSED timestamp before the curoff date will be moved to the archive.
If no date is selected then all DONE tasks will be moved to the archive.
You can see in the Archive modal window how many tasks will be move based on your current settings.
In case you want to undo the last archive operation you can always undo the operation from the editor (Ctrl/CMD+Z or from the menu Edit -> Undo).