contents
Personal Backup


TbBackup Backup and Restore of Thunderbird mail data

This program will help the less experienced Thunderbird user to backup and restore his/her mail data. It is part of the Personal Backup program package. Because the location of the mail data is a rather confusing and by default not visible to the user, problems can occasionally arise. In particular, a restore of mail data frequently fails.
Using the TbBackup program provided, backing up and restoring of Thunderbird user data becomes child's play. On first start, the program will automatically search for Thunderbird user profiles. If there is only one, which is usually the case, this is selected, otherwise a list of profiles is displayed so that the user can select the one to be backed up. Then the directory to which the backup is to be made must be selected. After that, a single click on the Start Backup button is sufficient to perform a backup of the mail data. Further settings are unnecessary since these are taken care of by the program. All important files in the root directory of the user's profile will be backed up automatically. Among these are besides the actual mail data the Thunderbird preferences and address books as well as all installed extensions. Files created by Thunderbird automatically if missing, like sqlite databases, will not be backed up.
The calendar data (events and tasks) are located in an own subdirectory and can be optionally included in backup (default setting: selected). Other Subdirectories containing Thunderbird's temporary files must not be backed up and are automatically excluded from backup. The actual backup or restore is performed in the background by Personal Backup.
If present, multiple Thunderbird profiles (more information). are supported. In such cases the desired profile must be selected prior to starting the backup.

Important note: The program can only be used if all mail data is located at the original location or was moved by the user manually in conjunction with an adjustment of the file profiles.ini (see this description). If you instead changed the paths of the mail folders in the account settings of Thunderbird, TbBackup can not be used. In this case the Backup must be performed using a manually created task in Personal Backup. The same applies to a Restore.

Function overview


TbBackup

Desktop window

The following functions are provided (see above screenshot):

Basic settings

After starting the program for the first time, the user will be prompted to perform the basic settings:

Edit settings

Mail profile

Select profile If Thunderbird is being used with multiple profiles, the desired profile can be selected by clicking this button. Otherwise the profile of the default user will always be used automatically.

Backup directory

Select directory

The backup directory should preferably be located on an external drive. Click the button to select a directory.

see here).

Inserts placeholders e.g. for date and time into the destination directory (see here).


Backup mail data

Start backup By clicking this button, the backup will be started. For this purpose, a Personal Backup task with all required settings will be created and started automatically. A progress window will be displayed on the screen.
If the option Include calendar data is selected (default setting), all events and tasks from the Thunderbird calendar Lightning will be included in the backup.

Additional functions

Desktop shortcut Create a desktop shortcut: A new shortcut for starting the mail backup will be created on the desktop. Double-clicking this icon will immediately run the backup.

Command line Automatic backup using the Windows Task Scheduler: Clicking this button will create a new task in the Windows Task Scheduler to backup your mail data. The task name will be generated automatically using the name of the mail profile for later identification. The other settings are similar to those for general backups (see more).
If the task has already been registered, clicking this button will either run the task immediately or will open a dialog to change the settings.

View log Show backup log file: Clicking this button will display the log of the last mail backup.

Settings

Settings

Options

Options

Status window

Status display

You can adjust if and how the status (progress and result) during backup will be displayed. There are the same choices as for automatic backups. If one of the options is selected that will close the status window automatically, additionally the waiting time can be set. Furthermore you can select whether the status window should be displayed always on top (see here).

Selections

As described above, not all files in the mail directory must be saved. By default, these files are excluded from backup. Optionally, you can change this. The selection can be done separately for filenames and file types.


Restore mail data

Restore If your mail data was backed up using TbBackup as described above, a Restore is very easy, because all information required to restore the selected profile will have been stored together with the backup. The user will only be prompted for confirmation before Personal Backup is started to perform the Restore (more information).

Restore from another backup

If the mail data was backed up using a conventional Personal Backup task or by simply by copying the files, the information about the mail profile mentioned above will not be available. However, a Restore of the selected profile can still be performed but in this case the backup directory of the profile must be selected manually, whereupon the program will check that the selected directory is a valid backup of Thunderbird data.

Restore to another computer

If you want to move your mail data to a new computer, follow these steps:

  1. Backup: First of all, run a backup on the old computer. The destination should be a subdirectory (such as G:\Mail-Backup) on an external drive (e.g. connected via USB).
  2. Initialize Thunderbird: On the new computer start Thunderbird once to create a new mail profile. Do not create any new accounts as these will be taken from the old computer in step 3. Close Thunderbird.
  3. Restore: Connect the external drive to the new computer. Then run TbBackup, select the backup directory mentioned above and start the restore. Because until now there is only an empty mail profile, you can overwrite it without hesitation. All backed-up mail data will be copied to the new profile. After a new start of Thunderbird, all accounts and mails should be available as before.

Additional notes

Before starting a Restore, the user can choose to delete all current mail files (even those not backed up). This is useful when for example indexing issues are present in the mail directory. When Thunderbird is next started, all required files will automatically be rewritten.

Before starting a Restore, the program will check that the mail directory to be restored is assigned to the selected profile and actually exist. Usually the remedy for this is to install Thunderbird anew before trying Restore again.
A running Thunderbird application must be closed prior to a Restore. If not already done, the user will be prompted to do this.


Move mail data

Move profile Using this function, it possible to move the mail data on the same computer to another location. To copy mail data to another computer, you must use a Restore as described above.
By default all Thunderbird mail data is located within the user's Application Data. This is an area of the file system that is usually not visible to the user in Windows Explorer. In my opinion, this choice is less than optimal and a directory within the user's Documents would be more appropriate. Users who share this view can move all the mail data assigned to the selected profile to another location by clicking this button. The Thunderbird settings will be adjusted automatically.
Important: before undertaking this action, backing up the mail data is strongly recommended.


Command line options

Calling the program via a desktop shortcut, a batch script or invoking it from another program (e.g. Windows Task Scheduler), you can control it by using the following command line options.

Calling the program

"%ProgramFiles%\Personal Backup 6\TbBackup.exe" [Profile] [Options]

Overview of options

Note: all options can be abbreviated but must be distinct: e.g. /force = /f = /for

/backupdir /exclude /force /ini /lang
/log /logdir /prompt /taskdir /wait
 

Description

no argument:
The program will start with its normal desktop window.
 
[Profile]
The program window will be opened for the specified mail profile [Profile].
 
/force
The backup of the specified mail profile (see above) will start immediately. If no mail profile specified, the default mail profile from the Thunderbird settings will be retrieved (see more). The program window will not be opened. All global settings will be used as long as the command line options do not specify something else (see below).
 
/exclude:[Directories]
In addition to the subdirectories excluded by default, this option specifies other subdirectories to be excluded from the backup. You can use the syntax known from file filters. Multiple filters must be separated by commas
 
/taskdir:[Directory]
Directory specifies a special path to the task files. This replaces the default path in My Documents. When starting the program from a USB stick, for example, you should use this option together with /ini:.. to save the task files by default on the stick. The filename may contain a placeholder.
Example: TbBackup.exe /i:%progpath%\tb1-1.ini /t:%progpath%
Important: The user needs write permission for this directory.
 
/backupdir:[Directory]
If Directory is a full path (e.g. G:\Backup), it will be used instead of the destination path defined in the task.
If it is a relative path (e.g. Test\Diff), an additional subdirectory will be created beneath the destination folder defined in the task, hence it is possible to configure backup schedules using Windows Task Scheduler. This option is used by the program addon PbPlaner.
Important: The user needs write permission for this directory.
 
/logmode:[n]
This setting overrides the log file settings from the task. The value [n] specifies the log type (more information).
 
/logdir:[Directory]
Directory specifies a special directory for the backup logs. If full path is not specified, a new subdirectory Directory will be created relative to the task directory (default location for log files see below).
 
/prompt:[Option]
Defines how dialog and status windows are displayed during backup.
wait Wait for user prompt.
delay Close status window after a short delay (default).
error User prompt will be required on errors. Otherwise the window will be closed after a delay.
quiet Display no progress and status windows.
silent Display no progress window, status window only on errors.
 
/wait:[n]
If the option /prompt:... selects delay or error, this option will specify the time the status window is displayed after backup. By default, the time is defined in the Personal Backup preferences.
 
/ini:[Filename] oder /ini:[Directory]
The user configuration is saved in the file TbBackup.ini. This file is located by default in the Application Data directory of the user: Using this option you can select an alternative configuration file in the default directory (e.g. /ini:tb.ini ) or at any other location. For this, a full path must be specified (e.g. E:\MyBackupConfiguration\TbBackup.ini). If only a directory is given, the default name TbBackup-1.ini will be added automatically.
If not specified otherwise using the option /logdir:.. )see above), the log files are located in the same directory (using the second example: E:\MyBackupConfiguration\TbBackup-1.log). Filename may contain a placeholder.
 
/lang:[xx]
Select the user language. The command line option overrides the setting from the Personal Backup control panel menu (Language).
xx = de German   xx = it Italian   xx = nl Dutch   xx = ru Russian
xx = en English   xx = es Spanish   xx = hu Hungarian
xx = fr French   xx = pt Portuguese   xx = pl Polish

Important note: If a directory name contains spaces, the whole option must be enclosed by quotation marks as for example "/exclude:cache*,My mails".

Example:

To perform mail data backup on a server for each connected user, a batch file is provided on a server share (e.g. \\server\mail-backup). To do this, at first all program files of Personal Backup are copied to the directory \\server\mail-backup\pb (as for portable version). Then a batch file is created in \\server\mail-backup containing these lines:
set BuDir=\\server\mail-backup\%username%
\\server\mail-backup\pb\TbBackup.exe /force /taskdir:%BuDir% /logdir:%BuDir% /log:2 /backupdir:%BuDir%


Background information

Thunderbird settings

By default Thunderbird stores its mail data within the User's Application Data:

Usually this area is hidden to the user. To make it visible, change the Windows Explorer setting via Tools ⇒ Folder Options ⇒ View ⇒ Show hidden files and folders. However, this is not necessary for backups made using TbBackup.

In the directory mentioned above you will find a profiles.ini file in which the assignments of the mail directories to the Thunderbird profiles are saved. More information about this:
 Thunderbird - user profiles,  Thunderbird - profile folder,  Thunderbird - profile file.

TbBackup will read the profile information from this file. If there are several profiles specified, the user must select the one whose data he wants to backup. A single profile (usually named default) will be used automatically.

TbBackup will create a file bu-profiles.ini in the destination directory that contains the required information for restores.

How TbBackup works

TbBackup uses Personal Backup for backup and restore. It will automatically create a backup task for each selected mail profile called tb-<profilename>.buj (e.g. tb-default.buj) with all required settings. The backup will always use the method Backup into separate files with zip compression. Note that only those files that contain user settings and actual mail data will be selected. There are many files created by Thunderbird only for administrative purposes or temporary that do not need be backed up. Thunderbird will recreate these files automatically if necessary.
You can open this task in Personal Backup to make additional settings and to start the backup directly from there.
The same applies to a restore. In this case TbBackup will create a restore task called tb-<profilename>.rsj (e.g. tb-default.rsj) to be executed by Personal Backup.


J. Rathlev, 24222 Schwentinental, Germany, April 2024