Aspose.Email makes it possible to convert an OST file to PST with a single line of code. Similarly, OST file can be created from PST file using the same line of code with the FileFormat enumerator. At present, the API supports converting OST formats to PST except OST 2013/2016. The following code snippet shows you how to Convert OST to PST.
For complete examples and data files, please go to https://github.com/aspose-email/aspose-email-python-dotnet
pst = PersonalStorage.from_file(dataDir + "PersonalStorageFile.ost")
Get the format of the file
pst.save_as(dataDir + "ConvertOSTToPst_out.pst", FileFormat.PST)
view rawExamples-WorkingWithOutlookStorageFiles-ConvertingOSTToPST-ConvertingOSTToPST.py hosted with ❤ by GitHub
For performing other operations with OST files, please refer to the following pages:
Read Outlook PST File and Get Folder and Subfolder Information
Get Messages Information from an Outlook PST File
Extract Messages from Outlook PST File and Save to Disk or Stream in MSG Format
Access Contact Information from Outlook PST File and Save to Disk in MSG Format