Pages: 1
RSS
Archiving old emails
 
My message base goes back to 2003, and whilst I don't want to actually vape any messages there seems little point in keeping such old messages in the active message base.

So what I'd like to be able to do is backup all the messages prior to 31/12/2005 then delete these messages, and obviously if necessary restore them to the message base such that the base is in exactly the same state prior to deletion...

But I can't work out a system to easily achieve this, anyone with any ideas?

Niamh
 
The best way to do that would be to move all messages prior to that date into a new folder called 2005, compress that folder with zip or rar and afterwards delete the contents of your 2005 folder, but don't delete the folder itself.
Now when you need the contents of that folder, you uncompress your archive into 2005 and view those messages with TB.
In case you've got your messages in multiple folders, you could use multiple subfolders in your 2005 folder.

The advantage of naming the archive folder something like 2005 is that you can repeat this procedure for different years.
This procedure will work until there's a version of TB that uses a different message base format.


Another option that comes to mind would be synchronize feature.
Execute the first step of the synchronize process:
Tools -> Synchronise -> Step1
Afterwards delete the old messages.
Now when you need your old messages, you simply execute step2 of the synchronize process, that should merge the step1 file with your current message base.
That should work as long as the message base format stays the same and it might even work afterwards (I don't know the technical details of the synchronizing process) Never tested it though, so it could be possible that I overlooked something.


A third option would be to export messages older than date X (though you need to select them) to unix mailbox format, this needs to be done on a per folder base, afterwards delete the messages from your message base and archive your export files with winrar.
Whenever you need to restore some messages, select the right file from your archive, import it to a folder in TB and you're done.
Now that I think about it, it should be possible to create the archive with a filter and the scheduler (even with multiple surce and target folders) Would go a bit far to explain that on the forum, but an experienced user should be able to manage that by himself.
__________________________________
I'm just a user of The Bat! I don't work for Ritlabs.
 
All workable but none exactly elegant.

Perhaps Ritlabs will add the facility to a future version.
 
what Roelof suggested seems both easy and elegant (aren't these synonyms? :).

theBat has everything needed to accomplish what you want. Creating a filter to separate old messages in any form you like is something that takes a couple of minutes. To make a backup of filtered old messages and to eventually restore (parts of) them takes less.

As filtering & backup is a one-time easy job, and restoration is something you'll probably never do, it's illogical to assume developers will do something to further ease this. Just pick one of the suggestions.  
 
Quote
bigg one writes:
Creating a filter to separate old messages in any form you like is something that takes a couple of minutes.

Exactly it's not elegant because it moves the messages away from their original folders, which means that should one need to restore them the restore won't put them back in the original place, and I don't want all the emails for 100+ folders in the same archive folder which means I'd need 100+ archive folders.

Much better would be to have a date range selector on making backups, then one purges on the same selection. That's far more elegant :)
 
Here's a filter that can be used for an action like this:

$$$$ TB! Message Filter $$$$
beginFilter
UID: [B19142A0.01C90A8C.1F0BFE7F.3E75F880]
Name: export\20old\20messages
Filter: {\0D\0A\20`24`0`0`20051231T105820Z\0D\0A}
ExportMessage FmtUnix filename C:\5CMailArchive\5C2005\5C%foldername.mbx filenamerelative %EXEDRIVE%\5CMailArchive\5C2005\5C%foldername.mbx
Delete
IsManual
IsActive
Ignore
endFilter

Import it into your sorting office and look what is does, before doing a test run I'd advise that you delete the 'delete message action'
The filter creates a unix mailbox for every folder that you run it against, provided that you don't use duplicate folder names.
Note that in my testrun I had the directory C:\MailArchive\2005 ready, so I'm not sure whether that would be created properly.

Instead of executing the filter for every folder manually, create a task in the scheduler (don't set it to repeat automatically) with the action to refilter with this filter and select all folders. Then execute the task manually
__________________________________
I'm just a user of The Bat! I don't work for Ritlabs.
 
Quote
Roelof Otten writes:
The filter creates a unix mailbox for every folder that you run it against

Sure, but that isn't quite what I'd hoped to achieve.

The answer is that one can't do what I want simply working on the existing folders.
 
Well, either you didn't formulate correctly what you wanted or you don't understand what the filter and schedule that I proposed do, but they do exactly what you were asking for.
You export old stuff to a unix mailbox that has the name of the folder that the old stuff is in. After that export, the old stuff is deleted.
And when you want to restore the old stuff, you can import it from the unix mailbox and have exactly as before in your message base, you even don't have to restore it in the same folder.
__________________________________
I'm just a user of The Bat! I don't work for Ritlabs.
 
Quote
Roelof Otten writes:
And when you want to restore the old stuff, you can import it from the unix mailbox and have exactly as before in your message base

Ah but there's the key failing, messages don't reimport exactly as they were as flag settings are lost- Export a read message, delete it then import it, it is then an unread message.

So you see your filter doesn't quite achieve what I specified.
 
Flags are lost when you export to unix mailbox.

But do you really care about flags of messages that are several years old ?
After import just mark the folder and press CTRL+M, and all will be marked as read.

If you really need to keep flags, filter messages to separate folder(s) and archive them in theBat's message base format, as suggested in Roelof's first reply.
There is no 100% perfect solution, but there will probably never be. Pick the least imperfect one and use it.

BTW another simple solution could be: rar the entire mail folder, then purge old messages. If you ever need to do something with old messages, close theBat, rename the current mail folder and restore the backed up one. Start theBat and you'll have it in the state as in the day of the backup. Finished with ols stuff - close theBat, delete the mail folder with old stuff, and rename back the current mail folder.

or another one - by simply changing a registry entry, you can start theBat with another active mail folder, where you keep old stuff.
Edited: bigg one - 01 September 2008 23:56:13
 
Quote
bigg one writes:
But do you really care about flags of messages that are several years old ?

Who knows, until one discovers that one does need them to be restored as they were?

However there is a way I think which should obviously be tested out with extreme caution and plenty of safeguards.

Copy the entire messagebase somewhere safe, creaate a filter to delete all mesages after 01/01/2006, backup the resulting messagebase, restore the original messagebase and finally delete all messages prior to31/12/2005.

NB. I have yet to test this, but will when I return to the office.
 
Quote
Roelof Otten writes:
Instead of executing the filter for every folder manually, create a task in the scheduler (don't set it to repeat automatically) with the action to refilter with this filter and select all folders. Then execute the task manually

OK, I've got a filter that does what I want and I can run it manually on a folder with the expected results.

However when I create the task in the scheduler and check every folder in the account when I run the task it only filters the first folder of 2 after filtering the second folder.

Any ideas why the filter isn't being run all checked folders?
Pages: 1