Read time: 6 minutes
There can be several mailboxes in a single Exchange database, consisting of an inbox, outbox, contacts, calendar, and other folders for each account. At the same time, by the addition of information in these mailboxes, the size of the database increases. But when the user deletes some content from mailboxes, it does not create free space for new data. If you want visible changes in the EDB file size, you have to remove white space also. But what is this white space?
Let’s say that you remove 4GB of data from the 30GB Exchange database; the expected size of the database should be 26GB. But, after removing the data, you will notice that the size remains the same, which is 30 GB. However, there would still be 4 GB of space available to add new data. This ‘Available new mailbox size’ is commonly known as White Space.
How to Find & Remove White Space in Exchange Database
White Space is the free space area in Exchange databases, which is created after the deletion of an item or object (like a mailbox). White Space, also known as free database pages or AvailableNewMailboxSpace, provides space to store new mailboxes or databases. The Exchange database reuses the White Space to store new items and objects. However, it will not be visible, as said above.
If you’re familiar with Exchange management shell and PowerShell commands, then there are three ways to find the white space in Exchange Database. You can use the below commands to find white space.
- To check white spaces on a mailbox database, use:
Get-MailboxDatabase < DB Name > -status | Select-Object Server,Name,AvailableNewMailboxSpace
- To check white spaces on all mailbox databases on one server, use:
Get-MailboxDatabase –Status –Server < servername > | Select-Object Server,Name,AvailableNewMailboxSpace
- To check white spaces on all mailbox database on all server, use:.
Get-MailboxDatabase -status | Select-Object Server,Name,AvailableNewMailboxSpace
Remove White Space in Exchange Database Manually
There are two manual methods available to safely delete white space from the EDB file and get back the free space. You can either move the mailboxes or do defragmentation.
Method 1: Move Mailbox to New Database
In this approach, we will create a new database in Exchange Server. Then move the complete data from old database to the new database.
Step 1: Create a new mailbox database
Follow these steps for creating a new database:
- Open Exchange admin center.
- On the windowpane, go to servers>databases.
- Select + to launch a fresh mailbox database.
- Name your database.
- Tap Browse to select the server where you’ll create the database and then click OK after selecting the server.
- Re-define the Database File Path and Log Folder Path. Click on the Save button.
- This will show a warning message asking to restart the Microsoft Exchange Information Store Service. Click OK, and this will create and mount a new database.
- Open Windows Services, then go to Microsoft Exchange Information Store>Restart the service > Microsoft Exchange Information Store>Restart the service.
At the end, verify the configured database and log folder.
Step 2: Move the mailbox from one database to another
Use the command below to move mailboxes from the source database to the target database.
This new database will now contain all your old mailboxes data without any white space. You can check and verify the existence of white space with the commands you used before.
Step 3: Delete old database
After moving the data, you should delete the old database file to free up the space. Follow the steps given below to delete old database file.
- Open Exchange admin center (EAC) on your browser.
- Go to servers>databases
- Select Dismount in the list view to dismount the old database.
- It will show you a warning message asking for confirmation to dismount the selected database.
- Click Yes
- Once you dismount the database, select the database you want to delete. Click the delete option (icon) to delete the desired database.
- You’ll again see a warning message asking for your confirmation to delete the mailbox.
- Click Yes to continue.
- There is a warning message on your screen again suggesting to removing database as well as log files. Copy the given location and select OK.
- Go to the file explorer and paste the given location. Delete the available files and you’re good to go.
Method 2: Database Defragmentation
There is only one way to remove white space from the Exchange database, which is by using Defragmentation. Now, this process can be carried out online and offline. Below, we have covered both methods in detail.
- Online defragmentation: The online database defragmentation process is entirely automatic. You do not need to initiate it; Exchange will automatically run it every night. However, online defragmentation does not reduce the size of the database – it remains the same. It removes the expired messages. It also cleans up deleted mailboxes on the mailbox store. If you want to To reduce the size of the database, you should go for Offline defragmentation.
- Offline defragmentation: Offline database defragmentation helps reduce the size of Exchange database. Using this process, you can compact the size of the database by eliminating unused storage space. This process creates a new database having no empty pages (it replaces the older ones with the new ones or deletes the older ones). You can perform defragmentation by use Eseutil facility. This process improves the efficiency of the Exchange database. But you can do this only when you have a large amount of free space.
Remove white space in exchange database with the simple steps given below:
- Check how much white space is available in Exchange database by running the below command in Exchange Management Shell.
Get-MailboxDatabase < Database name > -Status | Format-List Name, DatabaseSize, AvailableNewMailboxSpace
- Now, after checking, you have to dismount your Exchange database.
Dismount-Database < database name >
- Once you have dismounted the Exchange database, defragment the database
Eseutil /d < database_name >
- Now mount the defragged database.
Mount-Database < database name >
- After all the steps, check the white space available in your database after defragmentation.
Get-MailboxDatabase < Database name > -Status | Format-List Name, DatabaseSize, AvailableNewMailboxSpace
Drawbacks of Manually Removing White Space
Defragmenting a database is generally considered a risky job. It involves high downtime, and the whole process is automated. You do not have any control over what and how much data is defragmented. Additionally, the process requires an adequate amount of free space to complete. Failing this may lead to data corruption. For small-scale organizations having a few user mailboxes, manually moving each mailbox to new database is doable. But what if you have thousands of mailboxes to move? Copying them all together will cause severe downtime issues. This will result in a decrease in your productivity, and since the majority of the resources will be utilized during the mailbox copy, your server performance will also be heavily affected.
Remove White Space Using a Professional Tool
To remove white space in Exchange Server without any downtime issues, you must use our reliable Kernel for Exchange Server tool. It allows you to safely migrate multiple user mailboxes from an offline or online EDB file to any Exchange Server version (On-Premises or Online). Migrate all your mailboxes in one go or do a batch migration.
The Exchange data recovery tool also helps with repairing Exchange database files damaged during a failed database defragmentation job or by virus attacks. You can repair EDB files of any size with complete mailbox data, including emails, attachments, contacts, calendars, tasks, etc.
Features of Exchange Recovery Tool:
- Repair and migrate EDB to Live Exchange and Office 365.
- Recover mailbox data lost due to human error or virus attacks.
- Complete or selective mailbox recovery.
- Built-in mapping for accurate mailbox migration between Exchange Servers.
- Allows fixing various Exchange issues like Dirty Shutdown, EDB mounting issues, etc.
Conclusion
White space in the Exchange database can make it difficult to accommodate new data. Use the methods discussed above to remove white space in the Exchange database. The first method is helpful when you have a big database with a lot of white spaces, and you need full control over when and where the data will be migrated. Otherwise, you can use the second method.
If you cannot risk downtime and have a damaged EDB file, use the Kernel for Exchange Server to repair EDB files and recover the mailbox from the EDB file. The tool works with offline as well as online EDB files and transfers data without any information loss or modification.
Frequently Asked Questions
Ans. White space is another term used by various Microsoft Exchange Server users to refer to space in an EDB file. In the EDB file, when any data item is deleted, the file size doesn’t show the change in size immediately. The new space is occupied by white spaces that will be overwritten when new data is added to the server.
Ans. To remove the white space from any EDB file, you generally have two methods. Either move mailboxes to the new database & remove the old one, or you can use the eseutil /d command to defragment the database file.
Ans. To access and move data from a corrupt or inaccessible EDB file, you first need to repair EDB files either with Microsoft’s built-in tool, eseutil, or a professional Exchange data recovery tool.