Import PST (email, contacts and calendar) to WebTop 5

Before using scripts you have to install this package:
yum install libpst -y

Note:
Verify the Date Timezone of php with:
config show php|grep DateTimezone

If it does not match that set on your system, edit it before proceeding:
Example for Europe/Rome:

config setprop php DateTimezone Europe/Rome
signal-event nethserver-php-update

Download the zip file from here:
wget https://www.dropbox.com/s/3586eaga9k6t7bi/pst2webtop5.zip

Unzip the attached zip and copy all files into /usr/share/webtop/doc/ :
unzip -d /usr/share/webtop/doc/ pst2webtop5.zip

Make the files executable:
chmod +x /usr/share/webtop/doc/pst2webtop* /usr/share/webtop/doc/mb2md.pl

Then run:
/usr/share/webtop/doc/pst2webtop.sh <filename.pst> <user>

for example:
/usr/share/webtop/doc/pst2webtop.sh Outlook.pst luca.gasparini

  • you will be prompted to confirm whether you want to proceed with importing mail or if you want to bypass and proceed only with calendars or headers

Example:

./pst2webtop.sh test.pst luca.gasparini
Do you wish to import email? [Y]es/[N]o:
  • when finished, it’s showed, both on video and in a log file, how to proceeding to import the calendars and titles extracted from the PST

Example:

Events Folder found: File di dati di Outlook/Calendario/calendar
    Import to webtop:
./pst2webtop_cal.php luca.gasparini '/tmp/tmp.Szorhi5nUJ/File di dati di Outlook/Calendario/calendar' <foldername>

Contacts Folder found: File di dati di Outlook/Contatti/{06967759-274D-40B2-A3EB-D7F9E73727D7}/contacts
    Import to webtop:
./pst2webtop_card.php luca.gasparini '/tmp/tmp.Szorhi5nUJ/File di dati di Outlook/Contatti/{06967759-274D-40B2-A3EB-D7F9E73727D7}/contacts' <foldername>

Contacts Folder found: File di dati di Outlook/Contatti/contacts
    Import to webtop:
./pst2webtop_card.php luca.gasparini '/tmp/tmp.Szorhi5nUJ/File di dati di Outlook/Contatti/contacts' <foldername>

Contacts Folder found: File di dati di Outlook/Posta eliminata/Contatti suggeriti/contacts
    Import to webtop:
./pst2webtop_card.php luca.gasparini '/tmp/tmp.Szorhi5nUJ/File di dati di Outlook/Posta eliminata/Contatti suggeriti/contacts' <foldername>

log created: /tmp/pst2webtop14271.log

For convenience, you can see the contents of the log file at any time so that you can start importing the necessary files later:

Example:

cat /tmp/pst2webtop14271.log

./pst2webtop_cal.php luca.gasparini '/tmp/tmp.Szorhi5nUJ/File di dati di Outlook/Calendario/calendar' <foldername>
./pst2webtop_card.php luca.gasparini '/tmp/tmp.Szorhi5nUJ/File di dati di Outlook/Contatti/{06967759-274D-40B2-A3EB-D7F9E73727D7}/contacts' <foldername>
./pst2webtop_card.php luca.gasparini '/tmp/tmp.Szorhi5nUJ/File di dati di Outlook/Contatti/contacts' <foldername>
./pst2webtop_card.php luca.gasparini '/tmp/tmp.Szorhi5nUJ/File di dati di Outlook/Posta eliminata/Contatti suggeriti/contacts' <foldername>
  • for importing calendars:
    /usr/share/webtop/doc/pst2nethtop_cal.php <user> <file_to_import> <foldername>

Example:
./pst2webtop_cal.php luca.gasparini '/tmp/tmp.Szorhi5nUJ/File di dati di Outlook/Calendario/calendar' Calendario_importato

  • for importing contacts:
    /usr/share/webtop/pst2nethtop_card.php <user> <file_to_import> <foldername>

Example:
./pst2webtop_card.php luca.gasparini '/tmp/tmp.Szorhi5nUJ/File di dati di Outlook/Contatti/contacts' Imported_Address_Book

  • As “foldername” you can indicate both the default (WebTop) and a separate new folder (recommended choice).

  • When importing both contacts and events is asked whether to proceed with a [T] est or with the actual import

Example:
./pst2webtop_card.php luca.gasparini '/tmp/tmp.Szorhi5nUJ/File di dati di Outlook/Contatti/contacts' Imported_Address_Book

User: luca.gasparini
File: /tmp/tmp.Szorhi5nUJ/File di dati di Outlook/Contatti/contacts
Folder: Imported_Address_Book

Confirm? [Y]es/[N]o/[T]est:

Note:
Currently, the calendar event import script has these two limitations:

  1. Does not matter the reminders set on Outlook
  2. “Recurring Events” are not supported (for each recurring message of the .PST are generated ‘n’ events until 2038)
9 Likes

Great shot mate! It’s going to be really helpful. Hope some people will help you to test the scripts :slight_smile:

Excellent work!
What about adding the code to nethserver-webtop5 repository and proceed with related issue?
Do you mind to open a PR or should I do it for you?

2 Likes

If you can think of it to open the PR you make me a favor :wink:
Thank you Giacomo :blush:

Pull request open:

The package containing all the scripts is already in testing:

yum --enablerepo=nethserver-testing install nethserver-webtop5
2 Likes

2 questions please:

  1. Will this support PST from latest Outlook version? (2019)

  2. It imports the folder structure as is?

2 bonus questions:

  1. Will it “recognize” localized folders (for example an inbox not called inbox but “Εισερχόμενα”)?

  2. Any chance to also import mail filter rules to Sieve?

if you have ost files
https://www.stellarinfo.com/convert-ost-to-pst.php

1 Like

@lucag is there no way to do the import directly from ost files.
there are no free or open source tools to convert ost to pst

Hi @oneitonitram
unfortunately we have nothing for the direct import of the OST archives.
To date there has never been this need.

I’m not very expert in Exchange servers but I knew that it was possible to extract archives in PST format also from an Exchange server, perhaps only using Outlook?

I think on the net or in this community you can find someone to help with this :wink:

if you have ost files,
microsoft outlook can be used to export the converted data fro you.

this is a nice article here, showing that. https://www.nucleustechnologies.com/blog/free-methods-convert-ost-to-pst-file/

will post after testing

1 Like

Outlook itself will not let you attach an OST file… What you can do however, is configure Outlook under a separate profile with the user in question’s connection (to build the proper authentication certificates). Build it making sure to check the box for Offline use.

Once it is connected, force outlook into offline mode (I usually pull the network connection as well just in case). With outlook forced to offline mode, close outlook. You can now delete the OST file that was just created and replace it with the OST file that you wish to recover from. (NOTE: there is a process from task manager you will have to close that monitors the OST file to not let you delete it, I don’t remember off the top of my head what it is, but i remember the name being fairly obvious.)

Start Outlook back up (it should still be in forced offline mode. It will take a few minutes as it builds all the data from the Recovered OST file. Once it is up and running, move EVERYTHING over to a PST file, and you will be good to go.

2 Likes

Only for mails maybe Exchange and the new mailserver could be connected to a standard email client and use IMAP for copying messages.

1 Like

i tried connecting ith client, it gave me headaches. i just converetd to pst and used the import instructions here

1 Like