Issue:
In terms of sizing an Exchange Server environment, it is always advised and recommended to follow the Microsoft Sizing guides, this specifically means that you need to go through the Exchange Sizing Calculator. The tool gives you estimated values of how your databases, logs and transport queues are going to grow. So, if you do not properly plan these sizes, you might end up getting your disks full.
The scenario which I’m going to talk about is such situation where the free space of the C Drive almost got full. While digging in what’s being eating up the storage, we found out that the Exchange Transport queue, or Mail.que file is the culprit.
Exchange Transport Queue
A queue is a temporary holding location for messages that are waiting to enter the next stage of processing or delivery to a destination. Each queue represents a logical set of messages that the Exchange server processes in a specific order. In Exchange 2016, queues hold messages before, during and after delivery. Queues exist in the Transport service on Mailbox servers and on Edge Transport servers.
File | Description |
Mail.que | This queue database file stores all the queued messages. |
Tmp.edb | This temporary database file is used to verify the queue database schema on startup. |
Trn*.log | Transaction logs record all changes to the queue database. Changes to the database are first written to the transaction log and then committed to the database. Trn.log is the current active transaction log file. Trntmp.log is the next provisioned transaction log file that’s created in advance. If the existing Trn.log transaction log file reaches its maximum size, Trn.log is renamed to Trn nnnn.log, where nnnn is a sequence number. Trntmp.log is then renamed Trn.log and becomes the current active transaction log file. |
Trn.chk | This checkpoint file tracks the transaction log entries that have been committed to the database. This file is always in the same location as the mail.que file. |
Trnres00001.jrs Trnres00002.jrs |
These reserve transaction log files act as placeholders. They’re only used when the hard disk that contains the transaction log runs out of space to stop the queue database cleanly. |
Solution:
In simple, we can move the Mail.que database and log files associated to a different location. The below step by step guide will take you through how you can achieve this.
Before going ahead, here are some tips when it comes to moving your queue database.
- Ensure that the destination disk/drive has enough and additional buffer space, remember that during peak times, this can grow. If it’s possible to attach a separate disk for this, go ahead. It’s even better.
- The move process requires the Exchange Transport service to be stopped until the data is moved to the new location. This means that there will be a downtime where mail flow on the server will be interrupted.
- The transport queue files are located in the below path
%ExchangeInstallPath%TransportRoles\data\Queue
Once you have the disk and the downtime planned, we can start the procedure.
- Navigate to the location that you would will be moving the data to.
-
Create a folder where the queue database and transaction logs will be moved. In my case, I’m moving the data do the below path;
"F:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Queue"
- Right click on the above folder “Queue”, select Properties
-
Navigate to Security tab, click on Edit under Change permissions
-
Under Permissions verify that the below accounts are listed and the shown permission level is present. It not, add the user/service account and assign permissions
- Network Service: Full Control
- System: Full Control
- Administrators: Full Control
- Click OK to apply the permissions to the folder.
- Open Notepad using Run as Administrator
-
Using notepad, click Open and Navigate to the below path
%ExchangeInstallPath%Bin\
-
Open the EdgeTransport.exe.config file (you may want to take a backup of the file in case something goes wrong)
-
On the config file lookup for the following content;
<add key="QueueDatabasePath" value="<CurrentLocation>" /> <add key="QueueDatabaseLoggingPath" value="<CurrentLocation>" />
-
Now we need to modify the <CurrentLocation> and replace it with the new path for the queue files. In our case this will be as below;
<add key="QueueDatabasePath" value="F:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Queue" /> <add key="QueueDatabaseLoggingPath" value="F:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Queue" />
-
Save and close notepad.
-
Open Services.msc
-
Stop the Microsoft Exchange Transport Service.
-
Navigate to the below path where the old queue files are located at;
%ExchangeInstallPath%TransportRoles\data\Queue
-
Take a backup of all the files in the folder into a different location just in case.
-
Move existing database files (Mail.que, Trn.chk, Trn.log, Trntmp.log, Trn nnnnn.log, Trnres00001.jrs, Trnres00002.jrs, and Temp.edb) to the new location. This is the location you mentioned in Step 11.
-
Go to Services.msc and Start the Microsoft Exchange Transport service.
-
Monitor the status of the new location and the files.
-
Verify that the old path is empty and no new files are being created.
-
Send a few mails with attachments to verify and monitor mail flow.