{"id":33633,"date":"2019-03-22T20:10:58","date_gmt":"2019-03-22T16:10:58","guid":{"rendered":"https:\/\/www.msp360.com\/resources\/?p=33633"},"modified":"2025-05-07T13:20:10","modified_gmt":"2025-05-07T09:20:10","slug":"exchange-truncate-logs","status":"publish","type":"post","link":"https:\/\/www.msp360.com\/resources\/blog\/exchange-truncate-logs\/","title":{"rendered":"Microsoft Exchange Log Truncation Guide"},"content":{"rendered":"<p>In this guide, we explain how to truncate exchange logs on Microsoft Exchange. Doing so is useful in the event that you are running out of disk space for storing logs, and there is no way to create a full regular backup.<!--more--><\/p>\n<p>Microsoft Exchange Server uses a write-ahead approach to commit new data to the database. This means that when you create new Exchange items (emails, calendar events, etc.), data is written to the log file. After some time, these logs are committed to the database, and Exchange then truncates logs by marking them as recyclable.<\/p>\n<p>These log files consume storage space. Normally, the logs are truncated (which makes them shorter and saves space) whenever you run a full backup of Exchange. However, sometimes you cannot run a full backup. Fortunately, it is still possible to truncate Exchange logs in order to save space.<\/p>\n<!--HubSpot Call-to-Action Code --><span class=\"hs-cta-wrapper hs-cta-deferred\" id=\"hs-cta-wrapper-565257f1-bf91-414b-823e-d9b7a213232b\" data-portal=\"5442029\" data-id=\"565257f1-bf91-414b-823e-d9b7a213232b\"><span class=\"hs-cta-node hs-cta-565257f1-bf91-414b-823e-d9b7a213232b\" id=\"hs-cta-565257f1-bf91-414b-823e-d9b7a213232b\"><!--[if lte IE 8]><div id=\"hs-cta-ie-element\"><\/div><![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/5442029\/565257f1-bf91-414b-823e-d9b7a213232b\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" class=\"hs-cta-img\" id=\"hs-cta-img-565257f1-bf91-414b-823e-d9b7a213232b\" style=\"border-width:0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/5442029\/565257f1-bf91-414b-823e-d9b7a213232b.png\" alt=\"CTA\"><\/a><\/span><\/span><!-- end HubSpot Call-to-Action Code -->\n<p>&nbsp;<\/p>\n<h2>Why Do You Need to Truncate Exchange Logs Without a Backup?<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-29140 size-full\" src=\"https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2019\/02\/log-truncation.png\" alt=\"Exchange log files cleanup illustration\" width=\"216\" height=\"279\" \/><br \/>\nPerforming manual transaction log truncation allows you to keep your environment stable in the following situations:<\/p>\n<ul>\n<li>The backup software failed to perform a backup job, and logs remain untouched. You may be forced to shrink storage space consumed by Exchange logs if you need additional time to find the issue.<\/li>\n<li>If you run the Exchange test environment you can save storage space by deleting unnecessary log files. Microsoft suggests using <a href=\"https:\/\/www.msp360.com\/resources\/blog\/exchange-circular-logging\/\">circular logging<\/a> for this scenario, but you may have reasons not to do that.<\/li>\n<\/ul>\n<p id=\"last\">We strongly recommend against using circular logging because, in the case of failure of the host disk, you will only be able to restore data to the point of the last backup. All subsequent changes will be lost. You should delete log files manually only in a dire situation, or when running a non-production environment.<\/p>\n<p><span class=\"further-reading \">Further reading<\/span> <a href=\"https:\/\/www.msp360.com\/resources\/blog\/microsoft-exchange-exporting-mailboxes-to-pst\/\">Microsoft Exchange: Exporting Mailboxes to PST<\/a><\/p>\n<div id=\"slidebox\"><span class=\"close\">\u00a0<\/span><!--HubSpot Call-to-Action Code --><span class=\"hs-cta-wrapper hs-cta-deferred\" id=\"hs-cta-wrapper-09b0265a-a5a1-41bd-9699-418982b48e90\" data-portal=\"5442029\" data-id=\"09b0265a-a5a1-41bd-9699-418982b48e90\"><span class=\"hs-cta-node hs-cta-09b0265a-a5a1-41bd-9699-418982b48e90\" id=\"hs-cta-09b0265a-a5a1-41bd-9699-418982b48e90\"><!--[if lte IE 8]><div id=\"hs-cta-ie-element\"><\/div><![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/5442029\/09b0265a-a5a1-41bd-9699-418982b48e90\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" class=\"hs-cta-img\" id=\"hs-cta-img-09b0265a-a5a1-41bd-9699-418982b48e90\" style=\"border-width:0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/5442029\/09b0265a-a5a1-41bd-9699-418982b48e90.png\" alt=\"CTA\"><\/a><\/span><\/span><!-- end HubSpot Call-to-Action Code --><\/div>\n<p>Remember that you cannot perform an <a href=\"https:\/\/www.msp360.com\/resources\/blog\/exchange-incremental-backup\/\">incremental backup of Exchange Server<\/a> if transaction logs were deleted manually.<\/p>\n<div class=\"call-to-action\">\n<div class=\"call-to-action__left\" style=\"width: 70%;\">\n<div class=\"call-to-action__tag\">FREE WHITEPAPER<\/div>\n<div class=\"call-to-action__title\">The Ultimate MSP's Guide to MS Exchange Server Backup and Recovery<\/div>\n<div class=\"call-to-action__text\">Tips, tricks, and best practices<\/div>\n<!--HubSpot Call-to-Action Code --><span class=\"hs-cta-wrapper hs-cta-deferred\" id=\"hs-cta-wrapper-36bd5884-cacf-4ed7-9356-d3488a0f543e\" data-portal=\"5442029\" data-id=\"36bd5884-cacf-4ed7-9356-d3488a0f543e\"><span class=\"hs-cta-node hs-cta-36bd5884-cacf-4ed7-9356-d3488a0f543e\" id=\"hs-cta-36bd5884-cacf-4ed7-9356-d3488a0f543e\"><!--[if lte IE 8]><div id=\"hs-cta-ie-element\"><\/div><![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/5442029\/36bd5884-cacf-4ed7-9356-d3488a0f543e\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" class=\"hs-cta-img\" id=\"hs-cta-img-36bd5884-cacf-4ed7-9356-d3488a0f543e\" style=\"border-width:0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/5442029\/36bd5884-cacf-4ed7-9356-d3488a0f543e.png\" alt=\"CTA\"><\/a><\/span><\/span><!-- end HubSpot Call-to-Action Code -->\n<\/div>\n<div class=\"call-to-action__right\" style=\"width: 30%;\"><img decoding=\"async\" src=\"https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2019\/07\/Exchange_WP_icon-1.png\" alt=\"WP icon\" \/><\/div>\n<\/div>\n<h2><a name=\"truncate\"><\/a> How to Truncate Exchange Logs Manually<\/h2>\n<p>There are three basic ways to truncate Exchange log files manually:<\/p>\n<ul>\n<li><strong>[Does not require DB dismount]<\/strong> Simulate the backup process by using a VSS writer. This is similar to a standard backup scenario, but you actually do not capture the data and do not wait for the backup to be completed.<\/li>\n<li><strong>[Requires DB dismount]<\/strong> Dismount the database to trigger commits for all remaining logs, then remove the log files manually.<\/li>\n<li><strong>[Does not require DB dismount]<\/strong>, is potentially dangerous. Using File Explorer to remove log files that you are sure to have been committed.<\/li>\n<\/ul>\n<p>Now, let\u2019s explore each of these methods in detail.<\/p>\n<h3>Backup Simulation to Trigger Exchange Logs Truncation<\/h3>\n<p>This is the simplest approach, and it works as long as your Exchange server does not have VSS-related errors. Basically, you can run a backup simulation if you have previously not faced any backup-related errors on the server, including third-party backup tools.<\/p>\n<ul>\n<li>Open the CMD console using elevated privileges (in other words, run as Administrator), and then enter the following command: <b>Diskshadow<\/b><\/li>\n<li>Next, you need to add disk volumes that store Exchange database and logs: <b>add volume C:<\/b><br \/>\nWe assume that \u201cC:\u201d is a single system drive containing all server data.<\/li>\n<li>Create a backup session: <b>begin backup<\/b><\/li>\n<li>And then run VSS writer with the command: <b>create<\/b><\/li>\n<li>After VSS prepares the volume, you will see something similar to the screenshot below:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-26070 size-full\" src=\"https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image4-1.png\" alt=\"Database backup simulation in CMD console\" width=\"677\" height=\"326\" srcset=\"https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image4-1.png 677w, https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image4-1-300x144.png 300w, https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image4-1-624x300.png 624w\" sizes=\"auto, (max-width: 677px) 100vw, 677px\" \/><\/li>\n<li>To tell the Exchange that the simulated backup was completed, run this command: <b>end backup<\/b><\/li>\n<li>If this simulated backup was completed successfully and recognized by the Exchange server, you will see an event with ID 9780 in the Windows Event Viewer:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-26069 size-full\" src=\"https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image3-1.png\" alt=\"Exchange log files cleanup confirmation in Windows Event Viewer\" width=\"636\" height=\"445\" srcset=\"https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image3-1.png 636w, https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image3-1-300x210.png 300w, https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image3-1-624x437.png 624w\" sizes=\"auto, (max-width: 636px) 100vw, 636px\" \/><\/li>\n<\/ul>\n<p>Now your log files will be safely truncated after the next log file creation.<\/p>\n<h3>Removing Logs Manually After Database Dismount<\/h3>\n<p>Exchange normally commits all remaining log files when running the database dismount procedure. It, therefore, allows you to make sure that log files that you want to delete are already in the database. You can perform this procedure using the following steps:<\/p>\n<div class=\"steps\">\n<p><var>1<\/var> Open Exchange Management Console and proceed to Organization Configuration - Mailbox.<\/p>\n<p><var>2<\/var> Select the database that contains the log files you want to delete and choose the <b>Dismount Database<\/b> in the context menu:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-26067 size-large\" src=\"https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image1-1-1024x737.png\" alt=\"Dismounting database in Exchange Management Console before Exchange log files cleanup \" width=\"625\" height=\"450\" srcset=\"https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image1-1-1024x737.png 1024w, https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image1-1-300x216.png 300w, https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image1-1-768x553.png 768w, https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image1-1-624x449.png 624w, https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image1-1.png 1030w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/p>\n<p><var>3<\/var><i> This step is optional - it just ensures that the database was dismounted with no issues<\/i>. Open CMD console and type the following command:<\/p>\n<p><b>eseutil \/mh <\/b><i> &lt;Path_to_.EDB_file&gt; <\/i><\/p>\n<p><var>4<\/var> Replace \u201c <i> Path_to_.EDB_file\u201d <\/i> with a full path to your database. It is simple to accomplish by dragging the \u201c.EDB\u201d file from Files Explorer to the CMD window.<\/p>\n<p><var>5<\/var> If the database was dismounted successfully, you will see a \u201cClean Shutdown\u201d state in the command output:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-26071 size-full\" src=\"https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image5-1.png\" alt=\"\u201cClean Shutdown\u201d confirmation in CMD window before Exchange logs cleanup\" width=\"678\" height=\"565\" srcset=\"https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image5-1.png 678w, https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image5-1-300x250.png 300w, https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image5-1-624x520.png 624w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><\/p>\n<p><var>6<\/var> Now it is safe to delete all LOG files associated with this database using File Explorer . Then you can simply mount the database using Exchange Management Console - Organization Configuration - Mailbox.<\/p>\n<\/div>\n<h3>Removing Logs Manually WITHOUT Database Dismount<\/h3>\n<p>This is the most dangerous approach since it does not provide a way to check if the deleted logs were actually committed to the database before deleting them. Instead, we just assume that Exchange has committed all log files older than a few days after the creation date.<\/p>\n<p>Please use this approach only if:<\/p>\n<ul>\n<li>You cannot perform VSS simulated backups using the first approach described above.<\/li>\n<li>There is absolutely no way to dismount the database to commit all logs.<\/li>\n<li>You don't need to be concerned about the loss of data created since the last full backup.<\/li>\n<\/ul>\n<p>Here is how to remove log files with no database dismount:<\/p>\n<div class=\"steps\">\n<p><var>1<\/var> Open File Explorer and navigate to the folder that contains your database:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-26072\" src=\"https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image6.png\" alt=\"File Explorer\" width=\"902\" height=\"607\" srcset=\"https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image6.png 902w, https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image6-300x202.png 300w, https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image6-768x517.png 768w, https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image6-624x420.png 624w\" sizes=\"auto, (max-width: 902px) 100vw, 902px\" \/><\/p>\n<p><var>2<\/var> Now you need to sort folder contents by date. Click the \"Date modified\" column:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-26068\" src=\"https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image2-1.png\" alt=\"Date modified column\" width=\"979\" height=\"643\" srcset=\"https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image2-1.png 979w, https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image2-1-300x197.png 300w, https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image2-1-768x504.png 768w, https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2018\/11\/image2-1-624x410.png 624w\" sizes=\"auto, (max-width: 979px) 100vw, 979px\" \/><\/p>\n<p><var>3<\/var> Select all LOG files older than N days and delete them. The higher the value of N, the lower the chance of data corruption. We suggest selecting at least one week.<\/p>\n<p><var>4<\/var> You can check your database integrity state by running <code><\/code> <b>eseutil \/mh <\/b><i> &lt;Path_to_.EDB_file&gt; <\/i> command, which works only after the database dismount.<\/p>\n<h3>Discover more resources from MSP360<\/h3>\n<p><span style=\"font-weight: 400;\">Streamlining IT infrastructure demands expertise in system optimization, cloud services, and data protection. For Linux administrators, tasks like <\/span><a href=\"https:\/\/www.msp360.com\/resources\/blog\/linux-resize-partition\/\"><span style=\"font-weight: 400;\">resizing partitions<\/span><\/a><span style=\"font-weight: 400;\"> and adopting a robust <\/span><a href=\"https:\/\/www.msp360.com\/resources\/blog\/guide-to-linux-patching-management\/\"><span style=\"font-weight: 400;\">Linux patching management<\/span><\/a><span style=\"font-weight: 400;\"> approach are essential for security and efficiency. In AWS environments, securely accessing services by <\/span><a href=\"https:\/\/www.msp360.com\/resources\/blog\/how-to-find-your-aws-access-key-id-and-secret-access-key\/\"><span style=\"font-weight: 400;\">finding your AWS Access Key ID and Secret Access Key<\/span><\/a><span style=\"font-weight: 400;\"> and understanding the differences between <\/span><a href=\"https:\/\/www.msp360.com\/resources\/blog\/amazon-ec2-vs-amazon-s3\/\"><span style=\"font-weight: 400;\">Amazon EC2 and S3<\/span><\/a><span style=\"font-weight: 400;\"> are critical for resource allocation. For database management, executing <\/span><a href=\"https:\/\/www.msp360.com\/resources\/blog\/sql-server-transaction-log-backup\/\"><span style=\"font-weight: 400;\">SQL Server transaction log backups<\/span><\/a><span style=\"font-weight: 400;\"> and mastering <\/span><a href=\"https:\/\/www.msp360.com\/resources\/blog\/sql-server-backup-and-restore\/\"><span style=\"font-weight: 400;\">SQL Server backup and restore<\/span><\/a><span style=\"font-weight: 400;\"> processes safeguard data integrity. Additionally, e<\/span><span style=\"font-weight: 400;\">nsuring Windows reliability by <\/span><a href=\"https:\/\/www.msp360.com\/resources\/blog\/windows-troubleshooting-checking-and-enabling-recovery-environment\/\"><span style=\"font-weight: 400;\">enabling the recovery environment<\/span><\/a><span style=\"font-weight: 400;\"> mitigate risks. MSP360\u2019s comprehensive guides empower IT professionals to maintain resilient systems.<\/span><\/p>\n<\/div>\n<h2>Conclusion on how to truncate exchange logs without a backup<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29136 alignleft\" src=\"https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2019\/02\/exchange-first-pic.png\" alt=\"Exchange log truncation\" width=\"246\" height=\"142\" \/>We've provided tips on how to truncate Exchange logs manually to avoid running out of storage space. The approaches described above are not recommended for use in your daily routine; they are disaster-recovery solutions that are useful in the event that something goes completely wrong.<\/p>\n<p>Of course, it is always better to avoid a problem than to deal with the consequences after the problem occurs. That is why we suggest implementing Exchange backup using Windows Server Backup or Exchange-aware third-party solutions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, we explain how to truncate exchange logs on Microsoft Exchange. Doing so is useful in the event that you are running out of disk space for storing logs, and there is no way to create a full regular backup.<\/p>\n","protected":false},"author":59,"featured_media":44423,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[886,878],"tags":[928],"class_list":["post-33633","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-backup-and-dr-guides","category-msp-university","tag-exchange-backup"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.msp360.com\/resources\/wp-json\/wp\/v2\/posts\/33633","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.msp360.com\/resources\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.msp360.com\/resources\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.msp360.com\/resources\/wp-json\/wp\/v2\/users\/59"}],"replies":[{"embeddable":true,"href":"https:\/\/www.msp360.com\/resources\/wp-json\/wp\/v2\/comments?post=33633"}],"version-history":[{"count":5,"href":"https:\/\/www.msp360.com\/resources\/wp-json\/wp\/v2\/posts\/33633\/revisions"}],"predecessor-version":[{"id":60085,"href":"https:\/\/www.msp360.com\/resources\/wp-json\/wp\/v2\/posts\/33633\/revisions\/60085"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.msp360.com\/resources\/wp-json\/wp\/v2\/media\/44423"}],"wp:attachment":[{"href":"https:\/\/www.msp360.com\/resources\/wp-json\/wp\/v2\/media?parent=33633"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.msp360.com\/resources\/wp-json\/wp\/v2\/categories?post=33633"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.msp360.com\/resources\/wp-json\/wp\/v2\/tags?post=33633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}