tl;dr "Buy Office 365 Cloud - Cloud Backup" - So I created my own alternative
I received a phone call from another business who tried to sell me on a Office 365 Cloud - Cloud Backup solution. I work at a relatively small company so our email is managed on Office 365. I havn't heard of any Office 365 Backup Solutions so I played along and tried to get the details out. Unfortunately, after a quick Google search, there were only paid, enterprise solutions and nothing open source. So here's the workaround.To set this system up, a few components are required
- Outlook 2016 Desktop App on Windows
- Block-Level Deduplicating Backup
- BTRFS
- urBackup + BTRFS/ ZFS
- rsync
- borgBackup
- Duplicati
- Or just a backup service in general.
!! DISCLAIMER
You will have to download your entire Outlook Database. Make sure you have the bandwidth and time to leave it running. (Overnight works too)
- Navigate to File
- Go to the Info tab and click on Account Settings
- Click on the E-mail tab and make sure your account is selected. Click on the change button
- Under Offline Settings, Enable
Cached Exchange Mode
and move the slider "Mail to keep offline" to All. - Go to the Data Files Tab and you should see the location of the Offline cache.
Point your backup solution at %LocalAppData%/Microsoft/Outlook/*.ost
borg create \
/path/to/repo::'{hostname}-{now}' \
-- verbose \
-- stats \
/mnt/c/users/$username/AppData/Local/Microsoft/Outlook/
- Mount your VSS Shadow with mklink.
mklink /D /C:\ShadowVolume \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\
- To unmount the VSS Shadow - cmd:
rmdir C:\ShadowVolume
- PowerShell:cmd /c rmdir C:\ShadowVolume
- Copy the folder however you would like, just append
C:\ShadowVolume
to the path
copy C:\ShadowVolume\%LocalAppData%/Microsoft/Outlook/{email@domain.com}.ost C:\Backups\Outlook\{email@domain.com}_%d-%m-%Y.ost
SET AWS_ACCESS_KEY=awsaccesskey
SET AWS_SECRET_ACCESS_KEY=mysupersecretaccesskey
SET RESTIC_PASSWORD=supersecurebackupkey
restic -r s3:https://repository.domain.tld/restic backup c:/users/$username/AppData/Local/Microsoft/Outlook