Engineering Illustrated: The Thunderbird Migration

A lot of people think that an engineer solves a problem in one go. This is a myth.

During the years, I gathered a big number of tricks in my bag and a lot of endurance.

The problem

Last year my home PC crashed. As a free time system administrator, I had the honourable task to fix the problem. The biggest work load was to install the programs and restore the related files. For email, I use Thunderbird, a free mail client.

Solving the problem

First install

The first step was to install Thunderbird. Then I started the program and was asked to enter information about my mail account. That was the moment to close the program.

The program worked as expected. I also knew that a subdirectory with an empty mail file was created. The only thing I had to do was to find the right spot.

Second locate

This was not the first time I had to move my mail to a new PC. I opened the Windows Explorer. Then I went to my subdirectory. It looked something like C:\Users\Mindful Tester\AppData. Alas, I could not find this subdirectory.

I had to change a setting. I went to the options and went to the right tab. Then I had to browse whole list of checkboxes. I clicked on the Show hidden files checkbox and saved the change,

Now my subdirectory was shown in the Windows Explorer. I clicked a few times and ended up in a subdirectory with a name looking like C:\Users\Mindful Tester\AppData\Roaming\Thunderbird\Profiles. It was time for Find and replace.

The old-fashioned way

In the subdirectory I found only one mail file. I made the subdirectory Old and moved the mail file to this place. Then I placed my old mail files to this subdirectory.

It was time for a simple test. I opened Thunderbird and the program was not usable. I restored the old situation and got the known request to set the settings for the email account.

My old trick to dump my files failed. This was not a simple case of Dump and Mail.

Worth note taking

After a few attempts, I opened my word processor and wrote down, what I had done. There were some questions bugging me. What did I do? Did I miss something?

Obviously, because I had the wrong information.

As I read

There was still a thing called search engine. I entered some keywords like Thunderbird and migration and ended up at a web page of Mozilla. This was the organisation which makes and maintains this mail client,

 I dutifully followed the instructions to no avail. It was the same subdirectory, so I was looking at the proper spot. After a few attempts, I had to use another trick to solve the problem.

Pair administrating

For the next trick, I needed an extra pair of eyes. This time I repeated the steps, while one of my kids looked at my attempts. It was like pair programming or pair testing. I talked aloud while following the instructions.

Once again, there was no flaw in my actions. But I could still not see my mail.

Trust the course, Luke.

Educated system administrator guess

A few weeks later I noticed the file profiles.ini in the subdirectory which looked like C:\Users\Mindful Tester\AppData\Roaming\Thunderbird. As a tester, I like to use Exploratory Testing. It is about finding new information and using it for my own advantage.

A file with the extension ini is an initialisation file. During the first startup of the application the file is read and used. It contains configuration information. The operating system Windows let me open this file in a text editor. The contents looked like:

[Install45F216JC4C4E8]
Default=Profiles/fjer6fh3.default

[Profile0]
Name=default
IsRelative=1
Path=Profiles/fjer6fh3.default
Default=1

[General]
StartWithLastProfile=1
Version=2

The structure of the file looked familiar to me. There was a link to the file fjer6fh3.default. This file was automatically created during the first start-up of Thunderbird. If I would change fjer6fh3.default to the file name of my default mail file, then it might work.

The result was that only 1 of my email boxes was shown: the default one. I also wanted to see the other 2 mail boxes. There was a nagging need for another trick.

No smart feelings

My recurring subject about the mail client was noticed by my wife. Maybe it was time to hire someone to do this job.

And I really wanted to solve it myself.

This is not the trick you are looking for. TODO quote.

Educated developer guess

Sometime later, I thought about my experiences about adding information categories. Suppose that the product owner wanted to add the country name to customer data. Then a developer had to add an entry field for the country to several forms. Also, the data structure had to be updated. The added country had to be stored somewhere.

In a lot of cases, there is already a lot of customer data coupled to the application. This data has to be converted to the new data structure. When the application is updated, then a piece of code is used for this specific update.

I removed Thunderbird from my home PC and use the old installation program of Thunderbird, Then I dropped my files in the subdirectory with a name looking like C:\Users\Mindful Tester\AppData\Roaming\Thunderbird\Profiles. And I saw all my 3 mail boxes as expected.

A trick to update programs is to look at the version of the program. I went to Help and clicked on About Thunderbird. An update button was available. I pressed on it and a newer version of the program was announced next to the update button. So, I pressed several time on the Update button, until I got a message that Thunderbird was up-to-date.

And it worked for all my 3 mail boxes. This felt so good.

This is the day

It is personal

Joyfully, I tried to open the mail of my wife, but I got that annoying request to enter the mail settings. So, I removed Thunderbird, installed the old version of Thunderbird and the old mail files, and upgraded the program. Then I could open the mail of my wife.

Now this trick had to be used for every account on my home PC.

Hot fix

A refactored solution

There are some readers who are more interested in a set of instructions instead of a long story. This section contains all the steps needed to migrate Thunderbird files.  I used refactoring to remove redundant steps.

  1. Use the old installation program for Thunderbird for the installation.
  2. Start and close Thunderbird.
  3. Make hidden files visible in Windows Explorer.
    • (Windows 10) Go to View menu.
    • Select Options in this menu.
    • Go to the View tab in the Folder Options dialog.
    • Go to the Advanced settings, a list of checkboxes.
    • Click on the checkbox with the description “Show hidden files, folders, and drives.”
    • Click on the OK button to save the changes,
  4. Go to the Profile subdirectory which looks like C:\Users\Mindful Tester\AppData\Roaming\Thunderbird\Profiles.
  5. Remove the default mail folder.
  6. Move the old mail files to this subdirectory.
  7. Start Thunderbird and the old mails should be visible.
  8. Update Thunderbird.
    • Open the Help menu.
    • Select the About Thunderbird option.
    • Press on the Update button, until a message is shown Thunderbird is up-to-date.

All mail accounts should be still be available.

If there are more users on the PC using Thunderbird, then

  1. Remove Thunderbird.
  2. Repeat these steps for every user account on the PC.

A more detailed solution

There is an important thing missing in the instructions. It is the problem I was trying to solve.

The solution might be very difficult to handle for several people. Some people might need to know more about t the mail files and the right installation program for Thunderbird.

Reading the steps, I noticed that the steps to make hidden files visible should be executed once. Another refactoring is needed.

Problem:

  • In the past, I could just copy my Thunderbird mail files to the proper subdirectory. This trick does not work for the latest version of Thunderbird. I needed to take some extra steps for migrating my mail.

Preparation:

  1. Use a system administrator account.
  2. Make hidden files visible in Windows Explorer.
    • (Windows 10) Go to View menu.
    • Select Options in this menu.
    • Go to the View tab in the Folder Options dialog.
    • Go to the Advanced settings, a list of checkboxes.
    • Click on the checkbox with the description “Show hidden files, folders, and drives.”
    • Click on the OK button to save the changes,
  3. Find the mail files which have to be migrated.
  4. Go to the Profile subdirectory which looks like C:\Users\Mindful Tester\AppData\Roaming\Thunderbird\Profiles.
    For every mail account, there is a subdirectory containing information like login and the mails. It has a strange name like Profiles/fjer6fh3.default
  5. Find the old installation program of Thunderbird on the hard disk.
    An alternative is to download the 50 version using the Thunderbird release page.

Then the updated steps look like:

  1. Use the old installation program for Thunderbird for the installation.
  2. Start and close Thunderbird.
  3. Go to the Profile subdirectory which looks like C:\Users\Mindful Tester\AppData\Roaming\Thunderbird\Profiles.
  4. Remove the default mail folder.
  5. Move the old mail files to this subdirectory.
  6. Start Thunderbird and the old mails should be visible.
  7. Update Thunderbird.
    • Open the Help menu.
    • Select the About Thunderbird option.
    • Press on the Update button, until a message is shown Thunderbird is up-to-date.

Another migration

A few months later I did another Thunderbird migration. To my astonishment I discovered another file. Install.ini next to the profiles.ini. It looked like this:

[8216C80C92C4E828]Default=Profiles/fjer6fh3.default

Problem:

I carefully reconstructed what had happened. After the installation of the latest version, two configuration files were created with the name of a new profile containing no mails and mail configuration, So, the update solution as described before was not applicable.

This time I only needed to change the name of the profile in the files Profiles.ini and Install.ini.

Preparation:

  1. Use a system
    administrator account.
  2. Make hidden
    files visible in Windows Explorer.
    • (Windows 10)
      Go to View menu.
    • Select Options
      in this menu.
    • Go to the
      View tab in the Folder Options dialog.
    • Go to the Advanced settings, a list of checkboxes. Click on the checkbox with the
      description “Show hidden files, folders, and drives.
    • Click on the OK button to save the changes.
  3. Install a text editor which does not change the file extension during saving. My
    favourite editor for this purpose is Notepad ++. A work around it to use the
    standard Notepad to edit the file and change the file extension.

Steps to be be taken:

  1. Find the mail files which have to be migrated.
  2. Go to the Profile subdirectory which looks like C:\Users\Mindful Tester\AppData\Roaming\Thunderbird\Profiles.
    For every mail account, there is a subdirectory containing information
    like login and the mails. It has a strange name like Profiles/fjer6fh3.default
  3. Determine whether the files install.ini and profiles.ini are present. If this is not the case use other solution. Otherwise continue with the following step.
  4. Download the latest version of Thunderbird using the Thunderbird release page. TODO link. https://archive.mozilla.org/pub/thunderbird/releases/
  5. Start and close Thunderbird.
  6. Go to the Profile subdirectory which looks like C:\Users\Mindful Tester\AppData\Roaming\Thunderbird\Profiles.
  7. Remove the default mail folder.
  8. Move the old mail files to this subdirectory.
  9. Replace the name of the profile with the name of Profile to be migrated in the files profiles,ini and install.ini,