skip to Main Content

Move all mailboxes from one database to another

Sometimes you have to move all mailboxes from one database to another database in Exchange Server. The new target database can be an existing or a new mailbox database. What is the best way to do it? In this article, you will learn how to move all mailboxes from one database to another. Did we tell you that it’s just one single cmdlet to run?

Information about moving all mailboxes

Some examples why you like to move all mailboxes from one mailbox database to another mailbox database:

Find the mounted mailbox databases

We already know the source and target mailbox databases. If you don’t have the names of the mailboxes databases, check which databases are mounted in Exchange Server. Run Exchange Management Shell as administrator. Add the -IncludePreExchange switch if you like to get the mailbox database in previous Exchange versions.

[PS] C:\>Get-MailboxDatabase -IncludePreExchange -Status | Sort Name | Format-Table Name, Server, Mounted

Name Server    Mounted
---- ------    -------
DB01 EX01-2016    True
DB02 EX01-2016    True

We can see that we have two mailbox databases. We are going to move the mailboxes from the source mailbox database DB01 to the target mailbox database DB02.

Move all mailboxes from one database to another database with PowerShell

You don’t have to create an export of mailboxes to CSV and then create a move request to move the mailboxes. You can do it faster. The following cmdlet applies to Exchange Server 2010/2013/2016/2019.

[PS] C:\>Get-Mailbox -Database "DB01" -ResultSize Unlimited | New-MoveRequest -TargetDatabase "DB02"

DisplayName       StatusDetail        TotalMailboxSize         TotalArchiveSize PercentComplete
-----------       ------------        ----------------         ---------------- ---------------
Administrator     WaitingForJobPickup 694.2 KB (710,903 bytes)                  0
Christopher Payne WaitingForJobPickup 805.7 KB (825,070 bytes)                  0
Mary Walsh        WaitingForJobPickup 53.4 KB (54,682 bytes)                    0
Benetiz Anees     WaitingForJobPickup 411.4 KB (421,233 bytes)                  0
Larson Tevin      WaitingForJobPickup 40.93 KB (41,913 bytes)                   0
Jake Cornish      WaitingForJobPickup 40.93 KB (41,913 bytes)                   0

In the next step, we will check if the mailbox moves finished.

Check move request to another database

Have a look at the progress of the mailbox moves. Make use of the Get-MoveRequestStatistics to check the move request.

[PS] C:\>Get-MoveRequestStatistics -MoveRequestQueue "DB02" | Sort DisplayName

DisplayName              StatusDetail TotalMailboxSize         TotalArchiveSize PercentComplete
-----------              ------------ ----------------         ---------------- ---------------
Administrator            Completed    694.2 KB (710,903 bytes)                  100
Ali Tajran               Completed    418.1 KB (428,159 bytes)                  100
Amanda Morgan            Completed    728.2 KB (745,692 bytes)                  100
Anna Welch               Completed    60.56 KB (62,017 bytes)                   100
Benetiz Anees            Completed    411.4 KB (421,233 bytes)                  100
Boris Campbell           Completed    427.9 KB (438,136 bytes)                  100

Remove completed move request

Remove completed move requests in Exchange when finished. This will give you a clear view the next time you are moving mailboxes.

[PS] C:\>Get-MoveRequest -MoveStatus Completed | Remove-MoveRequest

Confirm
Are you sure you want to perform this action?
Removing completed move request "Administrator".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [?] Help (default is "Y"): A

Now that we moved the mailboxes, we can remove the source mailbox database DB01.

Conclusion

You learned how to move all mailboxes from one database to another database in Exchange Server. First, get all the mailbox databases that are created in Exchange Server. Write down which mailbox database is the source and which is the target. Run the cmdlet, as shown in the article, to move all mailboxes from one database to another. Check the mailbox move request status, and when it’s completed, clean the completed move requests.

Did you enjoy this article? You may also like Pause all mailbox move request in Exchange. Don’t forget to follow us and share this article.

ALI TAJRAN

ALI TAJRAN

ALI TAJRAN is a passionate IT Architect, IT Consultant, and Microsoft Certified Trainer. He started Information Technology at a very young age, and his goal is to teach and inspire others. Read more »

This Post Has 8 Comments

      1. Thanks for confirming! Would there be any other types of mailboxes that would need to be migrated?

        We currently have 1 single database where all the user mailboxes have been migrated to Exchange Online. Would love to free up 500+ gigs of space it’s taking up.

        So basically I’m looking to move EVERYTHING to a new DB 🙂

        1. Creating a new mailbox database is the correct approach to free up space.

          You have to move the audit log mailbox too.

          As long as you can dismount the mailbox database and remove it, everything is okay. If not, you will get an error that the database contains one or more mailboxes.

          Also, I recommend you enable circular logging on the new mailbox database.

          I explained the above and more in the following article: Keep last Exchange Server in organization.

  1. I have tried following your instructions and all moves got Stalled. I was able to somewhat cancel the move and now status on all mailboxes that I was trying to move is WaitingForJobPickup. How do I clear it up?

    1. Hi Arnold,

      There will be a short downtime (disconnect) at the end of the mailbox move.

      The user will get a notification in Outlook (only if Outlook is open) when the mailbox finishes moving to the other database. So it’s good to let the user know that they will get a popup in Outlook and then need to restart their Outlook.

      Another option is to move the mailbox after working hours, so the users do not get that message in Outlook, and they don’t even know that the mailbox moved to another database.

  2. Hola Ali, te agradezco mucho los tips que haz publicado en tu página realmente son muy útiles y de gran ayuda para poder optimizar Exchange 2013, el cual estoy aprendiendo y en la repartición el cual trabajo no nos han capacitado y realmente es todo buscar en las redes y ver que sirve y que no. Desde ya muchisimas gracias, saludos desde Argentina.

Leave a Reply

Your email address will not be published.