Moving Exchange Mailboxes to Another Database

Exchange administrator can move user mailboxes in the Active Directory forest from one database to another between Exchange servers, or between mailbox databases on the same server through the Exchange Admin Center web interface or PowerShell CLI. Consider how to migrate mailboxes between databases using Exchange Management PowerShell in Exchange 2016/2013/2010.

To move the mailbox from one database to another, you need to create a move request (if a migration occurs within the same Active Directory forest, this is called a local move request, if you want to move a mailbox between AD forests—this is a remote move request). To move user mailbox the New-MoveRequest cmdlet is used.

To create a local move request for a specific user’s mailbox, run the following command:

New-MoveRequest -Identity jsmith@theitbros.com -TargetDatabase lonDB2 -BadItemLimit 100

new-moverequest

The TargetDatabase parameter specifies the name of the mailbox database to which the mailbox should be moved. The BadItemLimit parameter indicates the number of corrupted items that can be skipped when moving a mailbox. If you specify BadItemLimit 0, it means that if there are any corrupted items in the mailbox, the move request will end with an error and the mail will remain in the original mail database.

If the mailbox size is quite large, it can move between mailboxes for quite a long time. To track the percentage of mailbox migration, you can use the Get-MoveRequestStatistics cmdlet. For example, to get the status of the jsmith@theitbros.com mailbox transfer, run the command:

Get-MoveRequestStatistics -Identity jsmith@theitbros.com

exchange move mailbox to another database

Pay attention to the PercentComplete column—it indicates the percentage of the task completion. The total mailbox size is listed in the TotalMailboxSize column.

READ ALSO  How to Recreate/Reset IIS Virtual Directories (ECP, OWA) on Exchange Server 2019/2016/2013?

You can get statistics on all move requests as follows:

Get-MoveRequest | Get-MoveRequestStatistics

You can move all mailboxes in a specific database to another database. For the convenience of tracking the status of a move, you can specify the name of the batch move task (BatchName parameter):

Get-Mailbox -Database lonDB1 | New-MoveRequest -BatchName "lonDB1tolonDB2” -TargetDatabase lonDB2 -Priority High -BadItemLimit 50 –AcceptLargeDataLoss

The status of batch move task can be obtained as follows:

Get-MoveRequest -BatchName lonDB1tolonDB2 | Format-List DisplayName,Alias,Status,*database*

You can temporarily suspend the transfer of mailboxes with the command:

Get-MoveRequest | ? {$_.Batchname –like “*lonDB1tolonDB2”}|Set-MoveRequest –SuspendWhenReadytoCompleate

To continue the mailbox transfer run:

Get-MoveRequest | ? {$_.Batchname –like “*lonDB1tolonDB2”}|Resume-MoveRequest

move mailbox to another database exchange 2016 powershell

To migrate all mailboxes from a specific MBX server, use the command:

Get-Mailbox -Server exlonmbx1 | New-MoveRequest -TargetDatabase nyDB2

If the database has system mailboxes, they need to be transferred separately:

Get-Mailbox -Database lonDB1 -Arbitration | New-MoveRequest -TargetDatabase lonDB2

You can batch move multiple mailboxes using a CSV file. To do this, use the New-MigrationBatch cmdlet (available in Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online).

New-MigrationBatch -Local -AutoStart -AutoComplete -Name "lonDBMove01" -CSVData ([System.IO.File]::ReadAllBytes("C:\PS\lonDBMove01.csv")) -TargetDatabases lonDB2 -BadItemLimit 10

The CSV file lonDBMove01.csv must contain a list of mailboxes to move (if you want to transfer only the archive mailbox, use the MailboxType parameter—ArchiveOnly, if the main mailbox—PrimaryOnly).

READ ALSO  Office 365 - "This message could not be sent. Try sending the message again later"
Cyril Kardashevsky

One comment

  1. hi,
    i have exchange 2016 with 4 mailbox databases
    do i need to transfer the monitoring mailboxes to which new 4 databases in exchange 2019

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.