Broobles » IMAPSize » Backup and restore your IMAP mail  
Latest News: Version 0.3.7 released (February 19th, 2009)
Incrementally backup your IMAP mail
IMAPSize is a freeware application that includes a powerful tool for performing incremental IMAP backups of your messages. Backed up messages are stored as eml files on your local drive and can be restored either to the original account where they were backed up from, or they can be restored to a different account with automatic folder hierarchy creation.

The backups in IMAPSize are incremental. This means that the messages that have already been backed up will not be backed up (downloaded) again. This preserves your bandwidth and time.






Regular Account Backups

The backup feature in IMAPSize is accessible from the Account / Account Backup menu item. The Account Backup Dialog allows you to select the folders in your account that you wish to backup. This list of folders is saved for your convenience. Once the backup is invoked, any messages that already exist in the local backup will not be downloaded again.


Command line Backups

IMAPSize allows you to perform backups invoked from the command line. This enables you to run IMAP backups from a script. You have to provide the -backup switch and specify the account you wish to backup as the parameter of the -account switch. For example, to backup an account named "test_account", you would invoke it like this:

imapsize -backup -account=test_account

Notes:
  • If you want to backup multiple accounts, you should invoke one command for each account.
  • In order to perform a backup from the command line for a specific account, the list of folders to backup has to be specified. This is done automatically if you have already performed a backup from the IMAPSize UI. Alternatively, you can specify these with the "Save Folders" option in the Account Backup dialog.
  • The log of command line backups is stored as "bak" entries in imapsize.log. You can check them by doing grep "bak " imapsize.log or if you have Unix tools installed, you can monitor the progress of the backup with tail -f imapsize.log | grep "bak "






Restoring Backups

Backups can be restored from the Account/RestoreBackup menu item. You choose the source and destination accounts and select the folders to be restored. If you are restoring to a different account than the original, you will be able to modify the remote mailbox name (you don't have to) by right clicking a folder and selecting "Change New Remote Folder Name" option from the popup menu. When restoring to a different account, IMAPSize will create the folder hierarchy for you, automatically taking care of namespaces.


How are backups stored?

Backups are stored in a folder hierarchy below the root backup folder (defined in the Options dialog, under the Misc tab). The server folder hierarchy is replicated locally and each message is stored in it's own eml file. These are plain text files, so you can easily manipulate them or import into other email applications. The root backup folder contains a file called backup.db. This is a database which contains information about backed up messages. This information is used for performing incremental backups and for restoring messages to IMAP servers.


Backup Filename Format

The format of backup filenames is configurable in the Options/Misc dialog. The following template strings can be used:
  • %DATE - The original date of the email
  • %SUBJECT - The subject of the email
  • %FROM - The sender of the email
  • %CURTIME - Current date and time
  • %MSGNUM - Internal message number

Note that although %CURTIME and %MSGNUM are not strictly required, it is recommended to keep these in the backup filename format since they guarantee filename uniqueness.

Some examples of the backup format:
  • %SUBJECT_%CURTIME_%MSGNUM.eml This is the default filename format
  • %DATE-%SUBJECT-%CURTIME-%MSGNUM.eml
  • %DATE-%SUBJECT-From:_%FROM_%CURTIME-%MSGNUM.eml Note how we added an additional string (From:)


Note: There are no checks of any nature made on the validity of the template. However, if a template can not be expanded, it will remain unchanged in the filaneme. For example, specifying %CURRTIME instead of %CURTIME will mean that %CURRTIME will remain in all the generated filenames. Please ensure that the filenames are generating the filenames you want when you make changes to this setting. You can test this by performing a "Download to eml" on a mailbox or several emails.





Moving Backups

In case you need to move the backups to another location on your drive, please move it by changing the location of the Root Backup Folder in the Options dialog (Misc tab). This will move all the backed up messages together with the backup database to the new location. In case you manually moved the whole backup folder just change the Root Backup Folder setting to point to the new folder.


If you stumble upon any problems feel free to report them on the forum or email to imapsize at broobles dot com
Copyright 2003-2013 Broobles