Microsoft Exchange – Move ‘ALL’ Mailboxes From One Database to Another

KB ID 0000864 Dtd 07/10/13

Problem

While replacing an Exchange 2013 Server on my test network last week, I needed to get all the mailboxes moved across to the new one. Exchange gets upset if you try and delete a mailbox database that has data in it.

Solution

1. Launch the Exchange Management Shell > Firstly lets get the names of my Databases, then I can simply copy and paste them into the move mailbox command.

Get-MailboxDatabase

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

PowerShell Move all Mailboxes

2. The Mailbox moves should then be queued, depending on how many there are, this can take some time to complete.

View Mailbox Move Statistics

3. To check on progress issue the following command;

Get-MoveRequestStatistics -MoveRequestQueue “Target Database Name

PowerShell Move all Mailboxes

4. When complete you should remove the movement requests like so;

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

Clear Mailbox Move

5. That's all the 'user' mailboxes, but your source database server may have system mailboxes in it. These will be either Arbitration mailboxes, or Archive Mailboxes (or both). I don't have any archive mailboxes, but I do have Arbitration mailboxes. To find out for your databases, use the following commands;Source Database Name" -Arbitration Get-Mailbox -Database "Source Database Name" -Arbitration [/box]

View Arbitration Mailbox

6. To move Arbitration and Archive mailboxes, use the following commands;

Get-Mailbox -Database "Source Database Name" -Arbitration | New-MoveRequest -TargetDatabase "Target Database Name"

Get-Mailbox -Database "Source Database Name" -Archive | New-MoveRequest -TargetDatabase "Target Database Name"

Move Arbitration Mailbox

7. You can monitor progress with the same command you used in step 3, and remove the move requests with the same command you used in step 4.

Related Articles, References, Credits, or External Links

NA

Author: Migrated

Share This Post On