Migrating from MailArchiva#
This documentation applies to Piler enterprise edition 2.1.0
Revision #1
Publication date: 2025-DEC-12
Overview#
MailArchiva provides a built-in volume export feature that outputs emails in EML or MBOX format. This guide walks you through the self-service export process and importing into Piler.
Prerequisites#
- MailArchiva administrator access
- Sufficient disk space for export (roughly equal to your archive size)
- Network or USB storage for transferring data to Piler server
Step 1: Export from MailArchiva#
Access the Admin Interface#
- Log into the MailArchiva web interface
- Use an administrator account
Navigate to Export#
- Go to Configuration in the main menu
- Click Volumes
- Select the volume(s) you want to export
- Click Export Data
Configure Export Settings#
- Format: Select EML (RFC 2822)
- EML is the standard format Piler accepts
-
MBOX is also supported if preferred
-
Date Range (if available):
- Select full range for complete migration
-
Or filter by date for partial migration
-
Destination: Choose export location
- Network share for large archives
-
Local storage if transferring via USB
-
Click Export to begin
Monitor Export Progress#
- MailArchiva displays progress during export
- Large archives may take several hours
- Ensure sufficient disk space throughout the process
Step 2: Transfer to Piler Server#
Option A: Network Share#
If Piler server can access the export location:
# Mount network share
mount -t cifs //server/mailarchiva-export /mnt/import -o username=user,password=pass
# Or NFS
mount -t nfs server:/export/mailarchiva /mnt/import
Option B: rsync (Remote transfer)#
# Transfer with resume support
rsync -avz --progress /path/to/mailarchiva-export/ piler-server:/var/piler/import/
# Resume interrupted transfer
rsync -avz --progress --partial /path/to/mailarchiva-export/ piler-server:/var/piler/import/
Option C: Physical Media#
For large archives, USB drives are often fastest:
- Copy export to USB drive
- Connect to Piler server
- Mount and import directly
Step 3: Import into Piler#
Set Permissions#
chown -R piler:piler /var/piler/import/
Import EML Files#
pilerimport -dir /var/piler/import/mailarchiva-export \
-tenantid fictive \
-workers 8 \
-progress
Import MBOX File (if exported as MBOX)#
pilerimport -mbox /var/piler/import/mailarchiva-export.mbox \
-tenantid fictive \
-workers 8 \
-progress
For Large Archives#
Increase worker count for better throughput:
pilerimport -dir /var/piler/import/mailarchiva-export \
-tenantid fictive \
-workers 16 \
-progress
With Automatic Cleanup#
pilerimport -dir /var/piler/import/mailarchiva-export \
-tenantid fictive \
-workers 8 \
-progress \
-remove
Step 4: Verify Migration#
Review Import Statistics#
After import completes:
Import completed:
Processed: 850,000
Success: 830,000
Duplicates: 18,000
Failed: 2,000
Verify in Piler UI#
- Log into Piler web interface
- Search for emails across different date ranges
- Verify attachments are accessible
- Confirm all expected mailboxes appear in search results
Investigate Failures#
If files failed to import:
- Check for corrupted EML files
- Review file permissions
- Check Piler logs:
docker logs piler 2>&1 | grep -i error
or
journalctl -xeu piler | grep -i error
Troubleshooting#
Export option not visible#
- Ensure you have administrator privileges
- Check MailArchiva license includes export feature
- Contact MailArchiva support if export is disabled
"Permission denied" during import#
chown -R piler:piler /var/piler/import/
chmod -R 644 /var/piler/import/*.eml
Slow import performance#
- Increase workers:
-workers 16 - Use SSD storage for import directory
- Ensure database server has adequate resources
High duplicate count#
Normal behavior - MailArchiva may have stored the same email multiple times (e.g., sent to multiple recipients). Piler deduplicates automatically without using extra storage.
Encoding issues with filenames#
If EML files have special characters in names:
# Rename files to safe names
cd /var/piler/import/mailarchiva-export
find . -name "*.eml" -exec rename 's/[^a-zA-Z0-9._-]/_/g' {} \;
MBOX import fails#
If MBOX file is corrupted or malformed:
- Try splitting into smaller files
- Convert to individual EML files using a tool like
mb2md - Import the EML files instead
Cleanup#
After verifying successful migration:
# Remove imported files
rm -rf /var/piler/import/mailarchiva-export/
# Unmount network share if used
umount /mnt/import