MS Exchange Server is quite an excellent platform for managing emails, data, and communication. But, it also needs continuous maintenance to preserve the resources that acquire storage space. When you deploy Exchange in your organization, you will notice that the disk space is decreasing quickly. It doesn’t happen due to the increasing mailboxes, but the log files consume a lot of storage space on Exchange Server.
Whether you’re using Exchange 2013, 2016, or 2019, it’s normal for log files to take up huge space on your server. This is why it’s necessary to clear Exchange log files to free space for better performance. In this practical guide, we will explain how you can purge MS Exchange log files quickly. These log files are not database files, so you can delete them safely without compromising any data.
Why do You need to Purge Exchange Log Files?
Purging Exchange log files allows you to save storage space and keep your environment stable in various situations, including:
- You didn’t create a backup for Exchange data, which kept the logs untouched
- When you need to shrink storage space consumed by log files due to any issue in the server
- To store essential data rather than filling it up with log files
Microsoft suggests using circular logging to clean log files; we also recommended some manual methods to remove or purge log files in Exchange Server.
Ways to Purge Microsoft Exchange Log Files
You can use multiple ways to remove log files from the Exchange server based on your requirements and preferences. Here, we have covered the most effective ways of removing MS Exchange log files.
- Remove Log Files after Dismounting Database
While dismounting the database, Exchange commits all the log files, ensuring that the log files you want to delete are already in the database. Now, to remove these log files, you can follow the below steps:
- Go to Exchange Management Shell (EMS) and proceed to Organization Configuration – Mailbox
- Now, identify and select the database that includes the log files. Right-click on the database and select Dismount Database in the context menu
- To ensure that data is dismounted successfully, open CMD on your computer and run the following command:
- If the database is dismounted successfully, a ‘Clean Shutdown’ state will appear in the CMD output
- Now, you can purge all the log files linked to the Exchange database with File Explorer and mount the database again
- Remove Log Files without Dismounting Database
This approach doesn’t assure whether the deleted log files are committed to the database before deleting. We don’t recommend using this approach unless
- You cannot perform VSS simulated backups with the first method described above
- You cannot dismount the database to commit all log files
- You don’t worry about the loss of the data created since the last full backup
If the above points don’t concern you, then follow the below steps to remove the log files:
- Open File Explorer on the system where Exchange Server is installed and go to the folder that contains the Exchange database
- Sort the folder’s content by date so that you can see the data based on the latest dates
- Select all the log files older than N days and delete them at once. The higher the value of N, the lower the chance of data corruption
To check the integrity state of the databases, run the below command in the CMD, which will only work if the database is dismounted properly.eseutil/mh <Path_to_.EDB_file>
If running this command provides accurate results, you have successfully deleted the log files.
- Take Regular Backups
The above methods are pretty simple to use but don’t offer any guarantee of the complete deletion of log files. The ideal approach to ensure the log files are removed from Exchange Server is to take regular backup of Exchange mailboxes. If you create a regular backup of Exchange mailboxes, you don’t need to clear the log files manually, as they are purged automatically if committed to the database.
However, if you find that the log files are not being purged, there is an issue with your backup process, or the backup tool is incompatible with the Exchange Server. Besides, if the database is damaged or some logs are corrupt, you won’t be able to use the manual methods. Thus, it is suggested to use a tool that offers complete backup of Exchange mailboxes. For instance, Recoveryfix for Exchange Server is an excellent tool for recovering corrupt/damaged Exchange EDB files and saving them in PST format or moving them to Live Exchange destinations. It also supports in EDB to Office 365 migrations.
It conducts a smooth repairing of corrupt EDB files and allows you to retrieve mailbox content quickly. Besides, the data is recovered in the same hierarchy that helps you find the log files easily and delete them permanently.It also helps you recover lost and deleted public folders from Exchange. Recoveryfix for Exchange Server Recovery is ideal for all versions of Exchange, including 2000, 2003, 2010, 2013, 2016, and 2019.
Removing log files from Exchange Server is crucial to managing your Exchange Server properly. Also, if you don’t want to pay for additional storage space, it is necessary to delete the log files regularly. However, the methods to purge log files in Exchange are not always helpful. In this article, we talked about general strategies that can be used to remove log files from Exchange and recommended an automated solution to backup Exchange Server.
- How to Fix Exchange Error Content Index State Failed and Suspended
- Fix the ‘mailbox export request stuck in queued’ issue in Exchange
- How to Resolve Exchange Error 1018?