Difference between revisions of "Bulk Import of Email Files"

[unchecked revision][checked revision]
(Created page with "= +++ DRAFT +++ = Beim Archivieren von PST, MBOX, EML und MSG Dateien ermöglicht der MailStore Client das Archivieren von einzelnen Dateien (PST, MBOX) oder von Verzeichniss...")
 
 
(34 intermediate revisions by 5 users not shown)
Line 1: Line 1:
= +++ DRAFT +++ =
+
When archiving email files, MailStore only allows archiving of individual email files (PST, MBOX) or directories which contain email files of one user (EML, MSG).
  
Beim Archivieren von PST, MBOX, EML und MSG Dateien ermöglicht der MailStore Client das Archivieren von einzelnen Dateien (PST, MBOX) oder von Verzeichnissen einzelner Benutzer (EML, MSG).
+
The following describes how to archive all PST-, MBOX-, EML- or MSG-files of all users in a few steps, using a bulk import script written in Python.
  
Mittels [[MailStore Server Management Shell]] ist es möglich, vorhandene Archivierungsprofile vor der Ausführung zu modifizieren. Dadurch ist es möglich mehrere Dateien oder auch ganze Ordner automatisiert zu archivieren.
+
The bulk import script expects the email files in folders that are named after  the corresponding MailStore users. Such a folder structure can easily be created by another script included in the [[Media:Scripts.zip|Python scripting package]].
  
Der Massenimport basiert darauf, dass es im Dateisystem Ordner gibt, die wie MailStore Benutzer heißen. Das Skript liest die Ordnernamen und ändert das Zielarchiv im Archivierungsprofil auf den entsprechenden Benutzer.
+
If you want to archive PST- or MBOX-files of one user only, you can use the bulk import scripts from  the [[Media:Batchscripts.zip|batch scripting package]]; the installation of Python is not required in that case.
  
Die bereitgestellten Skripte sind in Python geschrieben. Python 3.2 oder höher und das [[Media:MailStoreScripts.zip‎|Scripting-Paket]] werden benötigt.
+
== Preparing Python ==
Python kann von der Python Homepage www.python.org bezogen werden.
+
The provided scripts are written in Python. Python 3.6 or newer is required as well as the [[Media:scripts.zip|Python scripting package]].
 +
The [[Python API Wrapper Tutorial|Python API-Wrapper]] has to be installed.
  
== Vorbereitung Ordnerstruktur ==
+
== Preparing the Folder Structure ==
 +
The scripting package contains the <code>create_user_folders_server/spe.py</code> script which prepares the folders by fetching a list of existing MailStore Server users and creating folders with the same names in the filesystem. The actual bulk archiving script uses these folder names to assign the enclosed files to the corresponding users in MailStore.
  
Im Scripting Package befindet sich das Skript ''createUserFolders.py''. Dieses bereitet die Archivierung vor, in dem es die vorhandenen Benutzer ausliest und die Benutzer-Ordner im Dateisystem anlegt.
+
The MailStore Server Administration API must be enabled in the [[MailStore Server Service Configuration]].
  
Die [[MailStore Server Dienst-Konfiguration|MailStore Administrations API]] muss hierzu aktiviert sein.
+
After installing Python, the script can be modified by right-clicking on it, then selecting ''IDLE'', the supplied Python editor. Adapt the values of <code>USER</code>, <code>PASS</code>, <code>HOST</code> and <code>PORT</code> to your installation.
  
Nach der Installation von Python kann das Skript per Rechtsklick in "IDLE", dem mitgelieferten Python Editor, bearbeitet werden. Passen Sie die Werte USER, PASSWORD, HOST und PORT entsprechend Ihrer Installation an.
+
The <code>rootpath</code> variable contains the path where the folders will be created.
  
Die Variable '''rootpath''' enthält den Pfad, in dem die Ordner angelegt werden sollen. Möchten Sie PST Dateien importieren, so muss Outlook auf dem System installiert sein, welches die Archivierung durchführt.
+
Press F5 to run the script. A security question follows.
  
Mit F5 können Sie das Skript ausführen, es folgt eine Sicherheitsabfrage.
+
== Preparing the Archiving Profile ==
 +
Before executing the bulk import script, a new archiving profile that corresponds to the email files (PST, MBOX, EML/MSG) to be archived must be created manually in MailStore Server.
  
== Vorbereitung Archivierungsprofil ==
+
The profile must of the type ''Single User''. The settings in this archiving profile apply to all read files. For instance, if your exclude or include folders or define filters, they will be applied to all files you archive from.
  
Damit das Archivierungs-Skript ein vorhandenes Profil modifizieren kann, müssen Sie ein passendes Profil Erstellen.
+
The path you specify in the profile to the PST or MBOX file, or the folder containing EML/MSG files, is irrelevant, as it gets overwritten by the bulk import script. Additionally, sub folders are recognized when archiving  EML/MSG files, whereas MailStore headers in EML files are always ignored.
  
Das vorgehen ist für die drei Typen (PST, MBOX, EML und MSG) ähnlich. Erstellen Sie ein Profil des entsprechenden Types. Wenn Sie z.B. Ordner Filter setzen, wird dieser Filter auf jede PST Datei angewandt.
+
<p class="msnote">'''Important Notice:''' If you want to archive PST files, Microsoft Outlook must be installed on the machine where the archiving profile is run.</p>
  
Beim der EML, MSG Archivierung werden die Unterordner immer berücksichtigt. Die MailStore Header werden immer ignoriert.
+
Depending on the file type to be archived, the created profiles must be named <code>templateBulkImportEMLMSG</code>, <code>templateBulkImportPST</code> or <code>templateBulkImportMBOX</code>.
  
Die erstellten Profile müssen entweder '''templateBulkImportEMLMSG''', '''templateBulkImportPST''' oder '''templateBulkImportMBOX''' heißen. Dies lässt sich im Nachhinein mittels F2 ändern.
+
== Filling the Folders ==
 +
For each user, put the email files to be archived into the corresponding folders under the <code>rootpath</code>. When archiving PST files, these can be located in subfolders. A simultaneous import of different file types is not supported. If you want to archive PST and MBOX files, a separate run is necessary for each.
  
== Befüllen der Ordner ==
+
== Archiving ==
 +
Archiving is done by the <code>bulk_import.py</code> script. Before running it must be adapted to your MailStore installation by using ''IDLE''. Since this script uses the MailStore Client to connect to the server, rather than connecting to the  MailStore Server Administration API you have to use slightly other values.
  
Nun sammeln Sie in Ihrem Unternehmen die E-Mail Dateien der Mitarbeiter und platzieren Sie in den entsprechenden Ordnern. Beachten Sie bitte, dass Sie die verschiedenen Dateitypen nicht vermischen. Sollten Sie z. B. PST und MBOX Dateien Ihrer Mitarbeiter haben, so müssen Sie diese in unterschiedlichen Durchgängen archivieren.
+
The path to <code>MailStoreCmdSilent.exe</code>, the host name, credentials of an administrator and the <code>rootpath</code> have to be adjusted.
  
== Archivierung ==
+
When importing into MailStore Server the <code>HOST</code> has to be in the format <code>computer:port</code>. When importing into a MailStore SPE instance the format has to be <code><nowiki>https://computer:port/instanceid</nowiki></code>.
  
Die Archivierung wird vom Skript ''bulkImport.py'' durchgeführt. Dies muss vor der Ausführung ebenfalls modifiziert werden. Da dieses Skript nicht auf die Administrations API zugreift, sondern auf den lokal installierten MailStore Client, müssen hier etwas andere Werte angegeben werden.
+
Similar to the <code>create_user_folders_server/spe.py</code> script, <code>rootpath</code> points to the folder that contains the actual user folders.
 +
The <code>filetype</code> variable can have one of the following values according to the file type to archive: <code>pst</code>, <code>mbox</code> or <code>emlmsg</code>.
  
Um an die Werte für Ihre Installation zu gelangen, öffnen Sie entweder einen vorhandenen "Geplanten Task" eines MailStore Archivierungsprofils über den MailStore Client und kopieren die Zeile "Ausführen" in einen Editor Ihrer Wahl, oder Sie erstellen einen neuen Zeitplan für ein beliebiges Archiverungsprofil in dem Sie auf "Zeitgesteuert..." und anschließend auf "Cmd kopieren" klicken. Wenn Sie die Zwischenablage nun in einen Editor kopieren, sehen Sie die benötigten Werte. Das Erstellen des Zeitplans können Sie abbrechen, dieser wird nicht benötigt.
+
In ''IDLE'', press the F5 key to run the script.
 
 
Sie können anstatt MailStoreCmd.exe auch MailStoreCmdSilent.exe verwenden, dies verhindert das Aufpoppen leerer Kommandozeilenfenster während der Archivierung.
 
 
 
In diesem Skript wird die verschlüsselte Variante des Passworts benötigt, dies entspricht dem Wert hinter "--pc=".
 
 
 
Die Variable '''rootpath''' zeigt auf den gleichen Ordner, wie im vorherigen Skript.
 
Die Variable '''filetype''' hat einen der Werte '''pst''', '''mbox''' oder '''emlmsg'''.
 
 
 
Ein beherzter Druck auf F5 startet das Skript
 
  
 
== Logging ==
 
== Logging ==
 +
While the archiving process runs, its progress can be monitored in the status window. The message ''exitcode: 0'' means that the file or folder has been archived successfully. A different output would show the error. The task logs of the procedures are stored in the <code>rootpath</code> folder and are named as follows:
  
Das Skript schreibt Log Dateien in den Ordner, der die Benutzerordner enthält. Diese haben das Format
+
  Date-Time-User-File.log (PST,MBOX)
 
 
Datum-Zeit-Benutzer-Datei.log (PST, MBOX)
 
  
bzw.
+
or
  
Datum-Zeit-Benutzer.log (EML und MSG)
+
  Date-Time-User.log (EML/MSG)
  
Über die "Letzten Ergebnisse" im MailStore Client kann eine Übersicht gewonnen werden. Die Modifikationen werden hier nicht angezeigt, die Startzeit kann jedoch verwendet werden um fehlerhafte Vorgänge zu identifizieren. Die Namen der Log-Dateien auf der Festplatte beginnen mit der Startzeit.
+
The table ''Recent Results'' in MailStore Client gives you an overview of all run archiving profiles. Failed runs can by easily identified by their start time as the file names of the log files begin with the same value.
  
 
[[de:Massenimport von E-Mail-Dateien]]
 
[[de:Massenimport von E-Mail-Dateien]]
 +
[[en:Bulk Import of Email Files]]

Latest revision as of 15:35, 10 April 2024

When archiving email files, MailStore only allows archiving of individual email files (PST, MBOX) or directories which contain email files of one user (EML, MSG).

The following describes how to archive all PST-, MBOX-, EML- or MSG-files of all users in a few steps, using a bulk import script written in Python.

The bulk import script expects the email files in folders that are named after the corresponding MailStore users. Such a folder structure can easily be created by another script included in the Python scripting package.

If you want to archive PST- or MBOX-files of one user only, you can use the bulk import scripts from the batch scripting package; the installation of Python is not required in that case.

Preparing Python

The provided scripts are written in Python. Python 3.6 or newer is required as well as the Python scripting package. The Python API-Wrapper has to be installed.

Preparing the Folder Structure

The scripting package contains the create_user_folders_server/spe.py script which prepares the folders by fetching a list of existing MailStore Server users and creating folders with the same names in the filesystem. The actual bulk archiving script uses these folder names to assign the enclosed files to the corresponding users in MailStore.

The MailStore Server Administration API must be enabled in the MailStore Server Service Configuration.

After installing Python, the script can be modified by right-clicking on it, then selecting IDLE, the supplied Python editor. Adapt the values of USER, PASS, HOST and PORT to your installation.

The rootpath variable contains the path where the folders will be created.

Press F5 to run the script. A security question follows.

Preparing the Archiving Profile

Before executing the bulk import script, a new archiving profile that corresponds to the email files (PST, MBOX, EML/MSG) to be archived must be created manually in MailStore Server.

The profile must of the type Single User. The settings in this archiving profile apply to all read files. For instance, if your exclude or include folders or define filters, they will be applied to all files you archive from.

The path you specify in the profile to the PST or MBOX file, or the folder containing EML/MSG files, is irrelevant, as it gets overwritten by the bulk import script. Additionally, sub folders are recognized when archiving EML/MSG files, whereas MailStore headers in EML files are always ignored.

Important Notice: If you want to archive PST files, Microsoft Outlook must be installed on the machine where the archiving profile is run.

Depending on the file type to be archived, the created profiles must be named templateBulkImportEMLMSG, templateBulkImportPST or templateBulkImportMBOX.

Filling the Folders

For each user, put the email files to be archived into the corresponding folders under the rootpath. When archiving PST files, these can be located in subfolders. A simultaneous import of different file types is not supported. If you want to archive PST and MBOX files, a separate run is necessary for each.

Archiving

Archiving is done by the bulk_import.py script. Before running it must be adapted to your MailStore installation by using IDLE. Since this script uses the MailStore Client to connect to the server, rather than connecting to the MailStore Server Administration API you have to use slightly other values.

The path to MailStoreCmdSilent.exe, the host name, credentials of an administrator and the rootpath have to be adjusted.

When importing into MailStore Server the HOST has to be in the format computer:port. When importing into a MailStore SPE instance the format has to be https://computer:port/instanceid.

Similar to the create_user_folders_server/spe.py script, rootpath points to the folder that contains the actual user folders. The filetype variable can have one of the following values according to the file type to archive: pst, mbox or emlmsg.

In IDLE, press the F5 key to run the script.

Logging

While the archiving process runs, its progress can be monitored in the status window. The message exitcode: 0 means that the file or folder has been archived successfully. A different output would show the error. The task logs of the procedures are stored in the rootpath folder and are named as follows:

 Date-Time-User-File.log (PST,MBOX)

or

 Date-Time-User.log (EML/MSG)

The table Recent Results in MailStore Client gives you an overview of all run archiving profiles. Failed runs can by easily identified by their start time as the file names of the log files begin with the same value.