Skip to content

Mohanrau/ost2pst

Repository files navigation

OST to PST Converter

A comprehensive Python-based solution for converting orphaned OST (Outlook Offline Storage Table) files to PST (Personal Storage Table) format using open-source libraries and custom implementations.

Features

  • Multiple Conversion Methods: Uses specialized libraries when available, falls back to custom implementation
  • Orphaned OST Support: Handles OST files that are no longer connected to Exchange servers
  • Pure Open Source: No proprietary software required
  • Custom AI Implementation: Fallback custom parser when libraries aren't available
  • Cross-Platform: Works on Windows, Linux, and macOS
  • Detailed Logging: Comprehensive logging and error reporting
  • CLI Interface: Easy-to-use command-line interface

Installation

Automated Installation (Windows)

Run the installation script as Administrator:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
.\install.ps1

Manual Installation

  1. Install Python 3.8+

    # Download from https://www.python.org/downloads/
  2. Create virtual environment

    python -m venv ost2pst_env
    
    # Windows
    ost2pst_env\Scripts\activate
    
    # Linux/macOS
    source ost2pst_env/bin/activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Install specialized libraries (optional)

    # For better OST/PST handling (may require compilation)
    pip install pypff pyesedb

Usage

Basic Usage

# Using basic converter
python ost2pst_converter.py input.ost output.pst

# Using enhanced converter (recommended)
python enhanced_ost2pst_converter.py input.ost output.pst

Advanced Usage

# Force specific conversion method
python enhanced_ost2pst_converter.py input.ost output.pst --method pypff

# Analyze OST file only (no conversion)
python enhanced_ost2pst_converter.py input.ost output.pst --analyze-only

# Verbose logging
python enhanced_ost2pst_converter.py input.ost output.pst --verbose

Windows Batch Files

After installation, you can use the created batch files:

  • run_converter.bat: Basic converter with GUI prompts
  • run_enhanced_converter.bat: Enhanced converter
  • activate_env.ps1: PowerShell environment activation

Conversion Methods

The tool uses multiple conversion approaches in order of preference:

1. pypff Library Method

  • Best option when available
  • Uses libpff (libpst) Python bindings
  • Handles complex PST/OST structures properly
  • Preserves folder hierarchy and metadata
# Requires successful compilation of pypff
pip install pypff

2. pyesedb Method

  • Good fallback for ESE database access
  • Treats OST as an ESE (Extensible Storage Engine) database
  • Can extract raw email data from database tables
# Usually easier to install than pypff
pip install pyesedb

3. Custom Implementation

  • Always available fallback method
  • Pure Python implementation
  • Scans file for email patterns and headers
  • Creates basic PST structure

File Structure

OST2PST/
├── ost2pst_converter.py          # Basic custom converter
├── enhanced_ost2pst_converter.py # Enhanced multi-method converter
├── requirements.txt              # Python dependencies
├── install.ps1                   # Windows installation script
├── README.md                     # This file
├── run_converter.bat            # Windows launcher (created by install.ps1)
├── run_enhanced_converter.bat   # Enhanced launcher (created by install.ps1)
├── activate_env.ps1             # PowerShell environment (created by install.ps1)
└── ost2pst_conversion.log       # Conversion log file (created at runtime)

Supported Features

Email Elements

  • ✅ Email headers (From, To, Subject, Date)
  • ✅ Email body content
  • ✅ Basic attachments (with pypff method)
  • ⚠️ Complex formatting (limited)
  • ⚠️ Calendar items (basic support)
  • ⚠️ Contacts (basic support)

File Formats

  • ✅ OST files (all versions)
  • ✅ PST output format
  • ✅ Large files (>2GB)
  • ✅ Corrupted/orphaned OST files

Limitations

  1. Custom Method Limitations:

    • May not preserve complex formatting
    • Folder structure might be simplified
    • Some metadata may be lost
  2. Library Dependencies:

    • pypff may require compilation on some systems
    • Some libraries work better on specific OS versions
  3. OST File Conditions:

    • Severely corrupted files may not be fully recoverable
    • Encrypted OST files require additional handling

Troubleshooting

Common Issues

1. "pypff not found" Error

# Try alternative installation methods
pip install --upgrade pip setuptools wheel
pip install pypff

# Or use conda
conda install -c conda-forge pypff

2. "Access Denied" on OST File

# Ensure OST file is not in use
# Close Outlook completely
# Check file permissions

3. Large Memory Usage

# For very large OST files, use streaming mode
python enhanced_ost2pst_converter.py --method custom input.ost output.pst

4. Incomplete Conversion

# Check log file for details
cat ost2pst_conversion.log

# Try different method
python enhanced_ost2pst_converter.py --method pyesedb input.ost output.pst

Debug Mode

Enable detailed logging:

python enhanced_ost2pst_converter.py input.ost output.pst --verbose

Performance

File Size Method Typical Time Memory Usage
<100MB pypff 1-5 min 200-500MB
<100MB custom 2-10 min 100-300MB
1-5GB pypff 10-60 min 500MB-2GB
1-5GB custom 30-180 min 200-800MB

Contributing

This project uses AI-generated code as a foundation. Contributions welcome:

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add AmazingFeature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is open source. The custom implementations are AI-generated and freely available for use and modification.

Disclaimer

  • Backup your data: Always keep backups of original OST files
  • Test first: Try with a small OST file before processing large files
  • No warranty: This tool is provided as-is without warranty
  • Data integrity: Verify converted PST files before deleting original OST files

Support

For issues and questions:

  1. Check the troubleshooting section
  2. Review log files (ost2pst_conversion.log)
  3. Try different conversion methods
  4. Open an issue with detailed error information

Version History

  • v1.0 (2025-11-11): Initial release
    • Custom OST parser implementation
    • Multiple conversion method support
    • Windows installation automation
    • Comprehensive logging and error handling

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors