How to migrate from Outlook 2000 to Evolution

From Nick Jenkins
Revision as of 10:01, 9 April 2009 by Nickj (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

How to migrate from Outlook 2000 to Evolution. See also the blog post giving some background and explanation about this.

On Windows[edit]

  • Backup your PST files, so that you have a safe copy somewhere.
  • Set up Outlook (if you have not already done so), and open your PST files.
  • Move your all Tasks and Notes to be under the main PST (under "Outlook Today"), if they are not already there.
  • Empty the "deleted items" folders in all your files.
  • Right click on each PST file, go Properties -> Advanced -> click "Compact Now".
  • Close Outlook, then restart Outlook.

Running O2M to export your mail, calendar, and contacts[edit]

  • Buy O2M, and install it on Windows. Yes, it costs $10. You can try the free options first, but if they don't work then O2M might save you a LOT of time and wasted effort trying things that don't work. Try the trial O2M version if you're unsure.
  • Open O2M:
    • next
    • select output directory (the default is usually fine)
    • next
    • hold down the down arrow key until every mail folder is selected
    • next
    • (default) convert all of my email
    • next
    • don't skip large file attachments, convert everything
    • remove every type from the file type exclusion list (i.e. we want everything)
    • next
    • select all contacts folders
    • next
    • (default) apple address book
    • next
    • work
    • next
    • yes move calendar appointments
    • next
    • Apple iCal
    • next
    • all appointments
    • next
    • only look up email addresses if an invite is addressed to fewer than 10 invitees
    • next
    • start

The actual conversion process can take a long time - mine took around 8 to 12 hours. I had to check it fairly often (see below), and regularly click "Yes" or "Ok" to help keep the export moving forward.

Problems with O2M[edit]

Although O2M is good, it's not perfect, and there are two major problems with it:

  1. O2M kept prompting during conversion with a very annoying dialog box: "One of your emails had an invalid 'Sent' date. This can happen if a date doesn't have a valid timestamp, or if the date isn't properly formatted. Mail won't import into Mac programs properly without valid dates. O2M can try to fix your dates for you. If O2M can't fix a date, the date can be set to today's date as a last resort so at least the email will import properly on your Max. If you choose not to have O2M fix your dates, mail with bad dates will be skipped. Would you like O2M to fix bad or missing Sent dates for you? Yes/No". Now, I must have clicked "Yes" nearly 1000 times to this damn dialog box. Literally every 3 minutes I would check if it got stuck at this dialog box, and click the "yes" button. This went only for literally 8 or more hours, checking every 3 minutes if it got stuck. It would be REALLY REALLY nice to have a "Yes to all" button, so that I could click this once, and never ever be prompted about this ever again.
  2. O2M collapsed the nested email folder hierarchy that I had, into a flat hierarchy, with a list of files in a single directory, with the mangled folder names as part of the file name (the names O2M uses are made up of the folders path with spaces and punctuation removed, and underscores for each level, and it adds ".mbox" to the end of the file name). I actually ended up writing a PHP script (see below) to recreate the folder hierarchy that I originally had (with "Inbox.sbd" folders, and "Inbox" mbox files, with no extension). It would be REALLY REALLY nice to have an option somewhere in O2M to keep the folder hierarchy completely intact, and to name the folders and mailboxes using the same naming system that Thunderbird and Evolution use, so that these files can be moved straight into those applications.

Running Outport to export your Notes and Tasks[edit]

  • Look for any Notes with slashes - '/' or '\' - in their names, and if there are any rename these to remove the slashes.
  • Download Outport, and with run it whilst Outlook is running too.
  • Tick your notes, and export these as "text files".
  • Tick your tasks, and export these as "Evolution tasks".
  • Save these into a directory (you can use the same directory as O2M).

On the Linux machine[edit]

  • Copy the exported data from O2M and the exported data from Outport onto your Linux workstation.

Importing your Email into Evolution[edit]

  • Copy all of *.mbox files into ~/.evolution/mail/local/Inbox.sbd/
  • You need to remove the .mbox extension from all of these files. If you don't care about your folder hierarchy, then you are done.
  • You can optionally try and recreate your folder hierarchy you had in Outlook. I had the folder hierarchy that Thunderbird had created, with a list of file names in a text file called 'linux-dir-list.txt' (i.e. I had what it should look like) so I was able to use that to try and move the O2M files I had into the correct locations (i.e. I knew what I wanted and wrote a script to move and rename O2M's mbox files to where I wanted them to be). The script I used is:
<?php

error_reporting( E_ALL | E_STRICT );

function O2M_mangle_path( $path, $is_dir ) {
	if( $is_dir ) $path = preg_replace( '/\.sbd$/m', '', $path );
	return str_replace( array( ' ', '-', "'", '(', ')' ), '', $path );
}

// input : "./Work.sbd/Product.sbd/CP web requests for info.sbd/2005-07 Random University"
// output: "Work_Product_CPwebrequestsforinfo_200507RandomUniversity"
function move_O2M_mbox_to_correct_location( $path ) {

	$path_parts = explode( '/', $path );
	array_shift( $path_parts ); // remove the current dir ("."), as it's useless.
	

	$filename = array_pop( $path_parts );
	$dir = implode( '/', $path_parts );
	if( !is_dir( $dir ) && !empty( $dir ) ) {
             mkdir( $dir, 0777, true );
	}
	
	$source = '';
	foreach( $path_parts as $path_part ) {
		$source .= O2M_mangle_path( $path_part, true ) . '_';
	}

	$source .= O2M_mangle_path( $filename, false ) . '.mbox';

	if( !is_file( $source ) ) {
		print "Warning: Could not find file to do: rename $source $path\n";
	}
	rename( $source, $path );
}

// Takes the destination location, works out where the file will be currently, and moves 
// it to that location.
$input = file_get_contents( 'linux-dir-list.txt' );
foreach( explode( "\n", $input ) as $dest_file ) {
	if( preg_match( '/\.sbd$/m', $dest_file ) ) continue; // skip directories.
	move_O2M_mbox_to_correct_location( $dest_file );
}
  • If you don't have this, then you can either create this hierarchy manually, or you can hassle/beg the O2M developers to add an option to do this automatically, or you can put up with losing your folder hierarchy.
  • Two useful commands to run in the ~/.evolution/mail/local/Inbox.sbd/ directory, to check that you haven't stuff the folder hierarchy up were:
    • Checking that there are no empty directories (there should not be any) : find -depth -type d -empty
    • Checking that there are no mbox files (there should not be any) : find . | grep -inr "mbox"
  • You should now have your Outlook Email imported into Evolution.

Importing your Tasks into Evolution[edit]

  • In Evolution, create as many "Tasks Lists" as you need for the number of Task Folders you had in Outlook, by going Tasks, then New -> Task List.
  • In Evolution, go: File -> Import -> forward -> Import a single file -> Import -> Point to "tasks.ics" file created by Outport in the appropriate folder -> set type to "iCalendar files (.ics)" -> Forward -> select "tasks", location is "on this computer", and select the relevant Task List -> Forward -> Import.
  • Repeat the above for each Task List or Task Folder.
  • You should now have your Outlook Tasks imported into Evolution.

Importing your Notes into Evolution[edit]

  • At this point, you have a folder hierarchy of plain text files, with each folder full of files with names like note23.txt
  • Now, you might think you can just import these files into Evolution, or even just drag-and-drop these files (which are just plain text files) into the "Memos" section of Evolution. Unfortunately, you can't. Feature request for adding importing memos to Evolution.
  • Instead what you have to do is this:
    • You need to remove the first "date modified" line added to the first line each note's text file. We don't care when something was modified.
    • You need to rename the file to be called what we want the note to be called, instead of note23.txt.
  • To do this, I used this short shell script, which I ran in each directory that I wanted to port. This is the script:
for mFile in note*.txt
do
  # Replace Ctrl-M characters in this file.
  perl -pi -e 's%\r\n%\n%; s%\032%% if eof' $mFile
  # Remove the first line of the file
  perl -ni -e 'print unless 1..1' $mFile
  # Get the first line of this file
  mFirstLine=`head -1 $mFile`.txt
  # Now rename the file
  mv $mFile "$mFirstLine"
done
  • Then in Evolution, click on "Memos", and go New -> Memo List, and create a new Memo list for each of your Note folders that you had in Outlook.
  • Then we install an extremely useful (but still under heavy development) synchronisation application, called conduit. Either use the version that comes with your distro, or download a later one from conduit's getdeb page and double-click on it in Nautilus to install it.
  • Then go Applications -> Accessories -> Conduit Sychronizer.
  • For each Memo List or Notes folder, we do this:
    • In Conduit, drag and drop a new one-way schronisation channel, from "Files and Folders" -> Files, to "Office" -> "Evolution Memos".
    • You should then have a one way arrow from "Files" to "Evolution Memos".
    • Right-click on "Files" and go "Configure Item", then go "Add Folder", select a folder with Notes in them.
    • Right-click on "Evolution Memos" and go "Configure Item", and select the Memo List that you want these notes to be imported into.
    • When you're happy, right click on the one-way arrow, and go "Synchronize Group".
    • Repeat for each other Memo List or Notes folder.
  • You should now have your Outlook notes imported into Evolution.

Importing your Calendar into Evolution[edit]

  • In Evolution, go: Calendars -> File -> Import -> Forward -> "import a single file" -> Forward -> Select the "calendar.ics" exported from O2M -> set file type to "iCalendar (.ics)" -> Forward -> Forward -> Import.
  • You should now have your Outlook Calendar items imported into Evolution. If you have multiple calendars, you probably have to repeat this for each calendar.

Importing your Contacts into Evolution[edit]

  • In Evolution, create as many "Contact Lists" as you need for the number of Contact Folders you had in Outlook, by going Contacts, then New -> Contact Lists.
  • Then in evolution, go: File -> Import -> Forward -> "import a single file" -> forward -> select the "contacts.vcf" exported from 02M for this contact folder -> set file type to "vCard (.vcf, .grcd)" -> Forward -> Import.
  • Repeat the above for each Contact Folder, importing into the appropriate Contact List in Evolution.
  • You should now have your Outlook Contacts imported into Evolution.

Conclusion[edit]

The above steps should hopefully help you migrate from Outlook to Evolution, and give you an idea of what to expect. As you can see, it's not easy, but hopefully it will become easier with time. Also there are still some problems with Evolution that you may encounter, but I am hopeful that some of the above will be resolved with time. Personally, I would very much like to see Evolution succeed, and become everything that was good about Outlook, and much much more. Ciao!