Merging Profiles
Sometimes you may have multiple Thunderbird profiles that you want to merge into a single profile. I recently wanted to move one of the accounts from one installation of Thunderbird to another computer. However, this computer already had an active Thunderbird profile with several accounts configured. I only wanted to add the account from the old installation to this newer profile. Doing so requires some manual work to merge the profiles, but is quite doable.
- Read this page for some background. However, I only found it necessary to perform the steps below.
- Identify the locations of the old and new profiles. On my Ubuntu installs they are in
/home/user/.thunderbird
- Identify which account you want to transfer from the old profile. Look in the
Mail
subdirectory of the profile and decide which folder corresponds to the account you wish to move. - Copy this folder, as well as the
prefs.js
file in the profile’s root to the new computer. - Close Thunderbird on the new computer.
- Backup the destination profile in case something goes wrong.
- Copy the mail for the account you are moving into the destination profile on the new computer.
- Open the old and new
prefs.js
files in a text editor. - Look for preferences starting with
mail.account
,mail.accountmanager
,mail.identity
,mail.server
,mail.smtpserver
in the oldprefs.js
. You want to find only the preferences that correspond to the account in question and move those to the destination profile’sprefs.js
file. Take a moment to sort out what you’re looking out. - It helps to go through the old
prefs.js
and delete lines that are not relevant until you’re only left with those relating to the account in question. - Go to the destination
prefs.js
and check to see if any of the keys (things starting withid
,account
,server
, thanks to this post) are in use in the new profile. You don’t want collisions to occur. - Do a find and replace for those keys in the old
prefs.js
that will collide and change them to something unique (I just added a zero to all of them). - Some preferences have a list of all the accounts or servers or such. Manually merge these lines into the new
prefs.js
so all of the keys are represented. - Find any preferences that you are about to copy that reference the old profile location. This will not exist on the destination computer, so change all of them to reflect the new locations.
- Copy the configuration settings to the destination
prefs.js
. I put them with the similar settings that were already there; I’m not sure if it would work out of order. - Save the destination
prefs.js
and start Thunderbird. The account should now appear. - You will be prompted for the account’s password because we did not transfer the saved passwords store.
- I was also using Enigmail on the account I was transferring. Thus I had to export my keys using gpg and then import them into my gpg keyring on the new computer.
A Big List of All Unread Emails
To get a big list of every unread email across all your mail accounts. This can also be used to get a list fo all tagged emails, for example.
Thunderbird No Longer Displays a Certain Email Account
After VirtualBox crashed on me one time, I restarted my VM to realise that Thunderbird no longer displayed my primary email account. Not good.
Luckily the profile directory in ~/.thunderbird
still had the folder for my accounts under the Mail
subfolder. So no actual mail data had been lost.
I then searched the prefs.js
file for the account settings for the lost account to find that they had been replaced with generic data. The following steps allowed me to restore my account in thunderbird with no data loss:
Backup the profile folder.
Open prefs.js
in a suitable text editor.
Search for identifiers such as id*, account*, smtp*, server*
and figure out which of numbers correspond to the missing account.
Then search for each of these identifiers. It helps if you have another working account with similar settings (i.e. on the same server) so you can compare them.
Identify messed up preferences such as:
user_pref("mail.identity.id1.archive_folder", "mailbox://nobody@smart%20mailboxes/Archives");
user_pref("mail.identity.id1.draft_folder", "mailbox://nobody@Local%20Folders/Drafts");
user_pref("mail.identity.id1.fcc_folder", "mailbox://nobody@Local%20Folders/Sent");
user_pref("mail.identity.id1.stationery_folder", "mailbox://nobody@Local%20Folders/Templates");
user_pref("mail.server.server1.directory", "/home/user/.thunderbird/00000000.default/Mail/smart mailboxes");
user_pref("mail.server.server1.directory-rel", "[ProfD]Mail/smart mailboxes");
user_pref("mail.server.server1.hidden", true);
user_pref("mail.server.server1.hostname", "smart mailboxes");
user_pref("mail.server.server1.name", "Unified Folders");
user_pref("mail.server.server1.type", "none");
user_pref("mail.server.server1.userName", "nobody");
Change these to the correct values (you can open the Thunderbird config editor from the preferences dialog and avoid messing with the file directly).
Restart Thunderbird. Hopefully your account is now back.
Try sending mail from the account to see if it works.
For me, fixing these values still left incorrect values for the mailbox server that prevented me from recieving mail. I opened the account settings dialog and manually fixed the settings that were incorrect.
Everything now works! Now to fix those VirtualBox crashes that started this whole thing.