Move Mailboxdatabase and other logs to different drive in Exchange 2013/2016/2019

Microsoft Exchange Server – Network Encyclopedia
By MAS MVE Exchange Server, Windows Server, Active Directory, Virtu alization, Skype for Business Expert.
This article explains how to move an Exchange 2013/2016/2019 mailbox database and logs to a different drive.
When Exchange Server 2013/2016/2019 installation is completed it creates a database on the server. If you installed Exchange to the default path then the mailbox will be stored in C:\Program Files\Microsoft\Exchange Server\V15\Mailbox.

To get the details of the current location please use the below command.

Get-MailboxDatabase | fl Name,EdbFilePath,LogFolderPath

The default location can create problems in future if your server HDD is not properly sized. Another common scenario is that the database will grow and the current volume ends up being too low on free disk space, so you’ll need to move it to a new, larger volume. It is always recommended to have database and logs on different drives other than OS drive. So you would likely want to move this database to the volumes that you’ve provisioned for your Exchange database and log files.

Before you proceed, consider that the move requires the database to be dismounted and taken offline, so it will not be accessible to your mailbox users during the move. This is fine if the server has just been set up and there are no mailboxes on it, but if you’re moving a database with active mailbox users, a better option would be to create a new database on the new volume and perform the mailbox moves which means zero downtime. The command shown below will help you move to a different database in bulk.

Get-Mailbox -Database “Source Database Name” " -ResultSize Unlimited | New-MoveRequest -TargetDatabase “Target Database Name”

Do not forget to clear the move request once all move requests are completed. You can check the move request status by using the command below


The next command will remove all completed move requests.

Get-MoveRequest | where {$_.status -eq “Completed”} | Remove-MoveRequest

Before I move the database, I am first going to rename it. The uniquely generated name of “Mailbox Database 0430860505” is not desirable so I will rename it to “MailboxDatabase-01” instead.

Set-MailboxDatabase "Mailbox Database 0430860505" -Name "MailboxDatabase-01"

Move database and logs to a different drive or folder.
This is the command to move the mailbox database to another drive and rename the EDB file name while moving.

Move-DatabasePath MailboxDatabase-01 -EdbFilePath D:\Mailboxdatabases\MailboxDatabase-01.edb -LogFolderPath E:\Logs\MailboxDatabase-01

The database will be temporarily dismounted, the files are copied to the new locations, and then the database is mounted again. The time this operation takes will depend on the size of the database and size of the logs, as well as the speed of the source and destination disks.

Generally speaking, the more data you have the longer it will take, In short, a very long outage for your users if your database is big, hence why I recommend considering moving mailboxes to a new database instead.

We are now done with the mailbox database and its logs movement.

How to ensure the it is moved? Please run the below command to make sure it is moved to a different folder/drive.

Get-MailboxDatabase | fl name,edbfilepath,logfolderpath

Move transport logs to different folder.Now there are cases where C drive space is used because of connectivity logs, Message tracing logs and IIS logs.

You can change this from the GUI. Go to Servers–>Click Server name and click Edit/pencil button–> Transport logs.

See the following Screenshot.

We are now set with the transport log location.

Move IIS logs to a different folderNow next chance for logs is IIS logs i.e. C:\inetpub

You can change the location from IIS as below.

Default Website

Here you can use either the browse button or type the desired path manually.

Click on Apply.

Exchange Backend

Here you can use either the browse button or type the desired path manually.

Click on Apply.

We have now moved mailboxdatabase, Databaselogs, Transport logs and IIS logs to a different drive.

Leave a Reply

Your email address will not be published. Required fields are marked *