Moving Outlook .PST emails to Thunderbird on Ubuntu Linux


How to Convert Outlook PST to Thunderbird

During a recent disagreement between Windows 7 64-bit and my internal hard drive, I made a change. First, Windows 7 lost and the hard drive kept its life.

The change I made was to once again go down the road of running Linux as my primary operating system. This time it was Ubuntu 11.04 64-bit. However this article is not about the operating system, it is about the process I used to get my backed up local .PST files created by Microsoft Outlook to give up those precious emails so I could refer to them in my new email client, Mozilla Thunderbird.

There are plenty of articles you can Google that talk about the best process to make this happen. It tends to be along the lines of installing Thunderbird on a Windows machine that also has Microsoft Outlook installed along with your .pst files. In this setup, you can supposedly use the built-in Thunderbird import feature which makes calls to Outlook to get at your emails. In my case, I didn’t want to have to try and go through that time consuming process.

Instead I ended up using a Linux package to extract the emails, renamed all the files and imported them all using a Thunderbird plugin. So, let’s get to the details.

Step 1 – Get your email out of the .pst files.

Install the readpst package.

Now create the directory where you will want the extract email files to be placed.

Next execute the readpst command against a .pst file.

UPDATE: Ian Major commented on a simpler solution. “Works great, after reviewing the options for readpst I changed the command line to be ‘readpst -M -b -e -o pst-export archive.pst’ which doesn’t import deleted messages, and outputs with the eml extension, which means the rename isn’t required.”

Step 2 – Rename exported files

The readpst command will export all your emails into a folder hierarchy that matches the previous folder hierarchy in Outlook. The only problem is that every email is exported as a numeric filename. The text document are .eml files but don’t have the .eml extension. Therefore, we need to recursively rename all the email files to add the .eml extension. Lots of other articles will have you create bash, python, perl or other scripts to do this. I actually found the easiest to be a single command line.

What we are doing is finding all items that are files and do not already have a .eml extension. When we find these, we rename the file by adding the .eml extension.

NOTE: Depending on how many emails you have to rename, this is not the fastest approach and may run quite a while.

Step 3 – Import .eml files into Thunderbird

It’s now time to import all those email files into Thunderbird to make them useful. I found that what worked best for me was to install the ImportExportTools plugin for Thunderbird and use it to bring everything in.

Once you have installed the plugin it is time to use the tool. Inside Thunderbird, create a temporary local folder that we will use to house this mass of emails that you can later do what you please to get them where you want for their final location in Thunderbird.

Right click the folder in Thunderbird and choose the following menu path

import/export –> import all eml files from a directory –> also from its subdirectories

Then choose the folder you exported all the .pst emails tools (pst-export). Now sit back and wait while all your lovely emails you missed so much are made an active part of your new Thunderbird installation. Go get another cup of coffee and maybe a snack as this too will take a little bit to complete and you’re done.


About Tom

Tom genuinely loves tech. Not just gadgets but game changing stuff. Oh yeah, he hates to talk about himself in the 3rd person. So, I really enjoy involvement in sharing big tech in the #nptech (nonprofit technology) arena. The need to be entrepreneurial drives me to learn and dive into projects, but without the financial acumen to go it alone. Visit me in the afternoon and you'll see Google Chrome packed with my tab hoarding tendencies and you might even catch me practicing my fake british, over the top, accent. Christ follower, husband, father and technology enthusiast. Attempting to live life out as a light in this world and stumbling at times in this fallen world.


39 thoughts on “Moving Outlook .PST emails to Thunderbird on Ubuntu Linux

  • Hein

    Thank you very much for the clear describtion.
    With your clear instructions, it was simple to import all emails.

    Thanks !

  • Eric

    Thank you Tom!!! This saved me. I moved off windows / outlook to ubuntu 12.04.4 / thunderbird and tried everything I could find on the www to get my pst file imported, your directions proved to be the only solution that I found. THANK YOU SIR.

    Eric

  • Tom Post author

    Thanks Merel. I don’t pretend this is necessarily the easiest or best method but more what worked for us at the time. Please, if you find a better method, share it here. We’d love to learn. – Cheers!

  • scan pst

    How we can convert .PST emails to Thunderbird on Ubuntu Linux..I was not aware at all about it before..Its a nice oppurtunity for me to visit your content..Keep sharing it.

  • Niranjan

    I believed there is nothing that Ubuntu can’t do. You helped me in proving it once again.
    Thanks.

  • Benny

    Many thanks!
    But I’m not sure the -M is needed if -e is used…

    Thanx again! I’m now “Microsoft free” (a personnal victory of mine) :-)

  • Clayton

    Absolutely superb ! I’m a linux newbie and your solution was by far the best one !

    Worked first time.

    Many thanks,

    Clayton

  • Tom Post author

    Ashis,

    The error is telling you that archive.pst or pst-export does not exist in the current working directory (the one you are in now).

    Be sure that you are running this command while in the directory that has your archive.pst file and contains the pst-export directory. If the path to the pst-export directory or archive.pst is different than the current directory, you’ll need to include the full path in the command line.

    Hope that helps.

    Tom

  • Ashis

    Hi Tom,

    I am a beginner & I tried with the above method.
    I am getting error in last step of Step 1 : readpst -M -b -e -o pst-export archive.pst..

    It says No file or directory exists.

    Can you please help.

    I have copied the orginal archive.pst file to the created pst-export folder.

    Please help.

    Thanks

  • Tom Post author

    Only suggestion I can offer at the moment is to bring you Exchange emails into a local .pst then go from there. Alternatively, move the Exchange emails from local to the server and then connect Thunderbird via IMAP and do as you please from there.

  • Till

    Brilliant! You really rescued me. Thank you so much!
    All the other ways described in various threads just did not work or they had some serious trade-offs.
    However something that may be obvious to an experienced user, but that initially threw me off as a complete linux-novice were 2 details which you did not mention:
    Given your syntax described above…
    1. the pst-export directory has to be created inside the directory that contains all the *.pst-files for exporting.
    2. Inside the Terminal one has to change the path to the same directory as the one that contains the *.pst-files before executing the readpst-package (enter ‘cd ` in the terminal). This is just for information for the other novices out there…

  • altamira01

    Good article. thanks so much.

    I tried with my personal folder and it worked well. But when I Tried with my Exchange account (local folder) it didn’t work, import/export option only created me the folder but didn’t import the emails.
    any suggestion?

  • Ian Major

    Works great, after reviewing the options for readpst I changed the command line to be ‘readpst -M -b -e -o pst-export archive.pst’ which doesn’t import deleted messages, and outputs with the eml extension, which means the rename isn’t required.

  • Daniel

    Thanks for this, I’m glad I don’t have to use the Windows technique. But like Dhaval says, I would change that command line argument to target the pst-export directory. People are just going to run it without knowing what it does and it’s going to change all their non-extension files in their home directory. Thanks again for the guide.

  • Dhaval Kolhapure

    Suggestion:

    The suggested Command:
    ______________________________

    find . -type f ! -iname ‘*.eml’ -exec rename ‘s/([0-9]+)$/$1.eml/’ {} \;

    ______________________________

    changed all the “non extension” files, mp3 files and mp4 files into eml files.

    To get restore them back I had to cut-paste the pst-export folder to a flash drive, detach the flash drive from the system, find all the eml files by running a .eml search, then install and run a extension renaming GUI software, KRename, to get back the mp3 and mp4 files, and then paste back the pst-export folder to Home Directory.

    It was worth the time and effort; however, I was wondering it were possible to find all the files that do not have an eml extension only in the pst-export folder and then renaming (giving an eml extension) those files?

  • Erik

    you’re great!! Thanks a lot. A perfect documentation of what to do and when to do! Never read such a good, short and still working ‘manual’ :)

Comments are closed.