Clean up and Compact the Outlook Database File – .pst .ost
Microsoft Outlook is a client for email mailboxes. The Outlook client is simply a conduit for access to your Exchange Online mailbox, but it also can create and store the mailbox database for IMAP and POP mailboxes. No matter which type of mail system you are using Outlook for, in this post we will show you how to clean up and compact the outlook database file
How Outlook Stores Mailbox Databases
When Outlook is the client for Microsoft Exchange or Exchange Online, Outlook creates a local cache of the Exchange mailbox. This cache replicates the data from the online mailbox for better performance and user experience. The type of file for this type of cached mailbox is an Offline Outlook Data File (.ost).
When Outlook connects to a POP or IMAP mailbox, by default, Outlook downloads the data from the mail server for the mailbox. It typically will download the mailbox contents, removing them from the mail server, and then store them locally. The type of file for a POP or IMAP mailbox is an Outlook Data File (.pst).
By default, Outlook’s .pst or .ost file settings are a maximum of 50GB.
POP and IMAP mailbox servers use many different ranging mailbox size limits, and the administrator sets this on a per mailbox basis. The mailbox server database storage has a limit, and mailbox limits are within the storage available to the server. Additionally, the email client downloads POP and IMAP mailbox data, deleting it from the mail server.
Exchange and Exchange Online also have limitations applied to individual mailboxes, but these mailbox systems automatically sets a default size for each mailbox upon mailbox creation. Exchange Online mailboxes are usually either 50GB or 100GB. However, Exchange and Exchange Online mailboxes have additional features that will add to the Outlook default .pst or .ost file size.
Shared mailboxes and Archive mailboxes are examples of these additional features. Although Exchange and Exchange Online mailboxes are individually limited, the more of these types of mailboxes that your account has access to will increase the size of the .ost file that is stored locally.
When Do I Need to Clean Up and Compact the Outlook Database File?
Example #1:
Consider that you have a primary mailbox, an archive mailbox assigned in Exchange, and access to shared mailboxes such as Accounting, Orders, and Sales. Outlook will open these 5 mailboxes as separate accounts in Outlook, but it will cache the data from all of these mailboxes into the single .ost file. If the sum of all the mailboxes is greater than the 50GB local file default, you will get warnings and messages that your mailbox is full. To change what is downloaded to the local cache, there are several methods to alleviate this.
The methods to change what is downloaded to the local cache include:
- Turn off caching of Shared Mailboxes
- Change the amount of time that is cached
- Turn off Exchange Account Offline Settings to use Online mode instead of Cached Exchange Mode
Example #2
Consider that you are using a POP or IMAP account. You recently performed a mailbox cleanup or went through and manually permanently deleted folders and emails that are no longer needed. Outlook will manage the .pst file, but it will only do this when Outlook is idle and left open and running. You received a message that your mailbox was full because of the local .pst file limits. You need to get working soon and don’t have time to wait for Outlook to do this as it’s scheduled to. If you clean up and compact the outlook database file (.pst), this process will complete much quicker.
Example #3
Consider you use Exchange or Exchange Online and receive warnings that your mailbox is full. You either performed one of the methods above to change what is downloaded to the local cache or you emptied folders from Outlook on the Web. You sill continually receive the message that you can no longer send/receive. This is because Outlook is still syncing the local cache with the Exchange mailbox. At this point, you need to clean up and compact the Outlook database file to immediately execute the changes from the cleanup.
Example #4
Your Exchange mailbox was sending you messages that your mailbox is full. You don’t have any items to delete permanently so your administrator creates an Archive mailbox for you. The server has processed your primary mailbox and archived items appropriately, but you still receive the message that your mailbox is full. This is because the server processes and archives items, but the local cache is not yet in sync. Outlook is still syncing the changes from the primary mailbox to the archive mailbox. Since Outlook only does this while Outlook is idle and left open, you need to manually compact the local database.
Whether you use Outlook to connect to an Exchange or Exchange Online mailbox, or you use Outlook to connect to a POP or IMAP mailbox, there are times when the .ost or .pst file needs maintenance. Outlook will typically do this on its own in the background, but it will only do this while Outlook is open and idle.
How to Clean up and Compact the Outlook Database File
To manually reduce the size of the local cached database file for a POP or IMAP account:
- Click File > Account Settings > Account Settings (see images below)
- Click the Data Files tab in the Account Settings window
- Select the Default Data File if more than one, and click Settings
- Click Compact Now – The file will begin compacting
*Note – The amount of data and the drive type, SSD or HDD, affects the time for the compact process. - Once you compact the file, it will take you back to the Outlook Data File window; click OK
- In the Account Settings window, click Close
To manually reduce the size of the local cached database file for an Exchange or Exchange Online account:
- Click File > Account Settings > Account Settings (see images below)
- Click the Data Files tab in the Account Settings window
- Select the Default Data File if more than one, and click Settings
- Click the Advanced tab in the Microsoft Exchange window
- Click Outlook Data File Settings
- Click Compact Now – The file will begin compacting
*Note – The amount of data and the drive type, SSD or HDD, affects the time for the compact process. - Once you compact the file, it will take you back to the Outlook Data File window; click OK
- In the Account Settings window, click Close
*For other versions of Outlook for the above, follow Microsoft’s KB