Post Exchange mailbox database cleanup after migration to Office 365

Post Exchange mailbox database cleanup to Office 365

My initial issue was thus. I had done a cut migration from Exchange 2013 to Office 365. Everything was working fine and I had kept my existing server intact to be used in conjunction with DirSync for a Hybrid solution. The existing on premises server was still using up considerable drive space for the EDB files and I was backing up this considerable data daily. Every article I read on post migration cleanup never did seam to mention what to do with the remaining data. They would say to either decommission the Exchange server or leave it alone as the Hybrid/DirSync combo. No mention of any cleanup of the old data.

The answer in the end was pretty simple and I’m actually a little embarrassed it took me so long to figure it out.

I logged into the on premises Exchange Server and ran the Exchange Management Shell. From there I checked out the databases to see how much white space they had.

Get-MailboxDatabase -Status | ft name,databasesize,availablenewmailboxspace -auto

The AvailableNewMailboxSpace showed me embarrassingly that my databases were mostly white space…

Post Exchange mailbox database cleanup







To release the white space I logged into the Exchange Admin Center -> Servers -> Databases & dismounted the databases.

Then from the shell I navigated to the folder containing the databases and ran ESEUtil to defrag each one.

eseutil /d “databasename.edb”


After that I mounted the databases back up, turned on circular logging and my Exchange server drives were now nice and trim! Just make sure you have enough drive space to perform the defrag as it creates a new file temporarily.

2 responses to “Post Exchange mailbox database cleanup after migration to Office 365

  1. Nice work – yes the articles do not mention cleanup. I assume we can safely take this one further and remove the databases and mailbox role, leaving only CAS for management.

Comments are closed.