There are several reasons Exchange mailboxes need to be moved from one database to another, including mailbox migration, relocation of a user to a different location with a separate Exchange server, or when the current database runs out of disk space.
To move mailboxes from one Exchange database to another, there are multiple options available, including using the Exchange admin center (EAC), PowerShell cmdlets, or third-party Exchange migration tool.
This post will demonstrate the methods for moving mailboxes to another database using the EAC and PowerShell.
Note. This tutorial will be using an Exchange Server 2019. But the examples may be similar to Exchange Server 2013 and 2016.
Table of Contents
Type of Exchange Mailbox Moves
Exchange has three different mailbox move types depending on the location and purpose.
- Local move: This type is used when the source and destination mailbox databases are within the same Active Directory forest. The databases may be on the same or different Exchange servers.
- Cross-forest move: This move is used when the source and destination mailbox databases are in different Active Directory forests. The move is performed over a trust relationship between the forests and requires using the Active Directory Migration Tool (ADMT) to migrate the user’s account.
- Remote move: This type is mostly associated with a hybrid setup where mailboxes are moved from Exchange On-premises to Exchange Online (and vice-versa). This move is performed over the network and requires a migration endpoint.
This post will cover the local move type, where mailboxes are moved between databases within a single AD forest.
Note. Learn how to move contacts from Exchange to iCloud.
Using the Exchange Admin Center
The Exchange Admin Center (EAC) is a web-based management console for managing Exchange Server environments. EAC provides a graphical user interface (GUI) for administrators to perform various tasks, which include moving mailboxes to another database and more.
It was introduced in Exchange Server 2013 as a replacement for the Exchange Management Console (EMC) and the Exchange Control Panel (ECP).
To move mailboxes between Exchange databases, follow these steps.
Create a Local Move Request
Open the Exchange Admin Center in your web browser. The EAC URL would look like this – https://server_fqdn/ecp/.
Navigate to Recipients > Migration.
Click the plus sign and Move to a different database.
Select the Mailboxes to Move
On the new local mailbox move pop-up, you have two options to select the mailboxes to move – manual selection or CSV upload. Let’s see both in action.
OPTION1: Manual Selection
Choose the “Select the users you want to move” option and click the plus sign.
Select one or more mailboxes to move and click the “add ->” button. To select multiple items, hold CTRL+CLICK. In this example, we are selecting four mailboxes that are on DB1.
Tip. When moving multiple mailboxes, do not select the ones already on the target database.
Once the mailboxes are added to the list, click Next.
OPTION 2: CSV Upload
Instead of selecting mailboxes to move manually, you can create a CSV file with the list of those mailboxes. In the below example, I created a CSV called mailboxList.csv with only the EmailAddress header and the primary SMTP addresses as entries.
Once you have the CSV file, click the Specify the users with a CSV file option and click Choose File.
Choose the CSV file and click Open.
Once EAC reads the CSV file, it shows the number of mailboxes it found in the CSV file. Click Next.
Customize the Migration Configuration
On the Move configuration step:
- Type the name to identify this mailbox move batch.
- Select what happens to the archive mailbox.
- Move the primary mailbox and the archive mailbox if one exists.
- Move the primary mailbox only without moving the archive.
- Move the archive mailbox only.
- Select the target mailbox database. This box is disabled if the “Move the archive mailbox only” is selected.
- Select the target archive database. This box is disabled if the “Move the primary mailbox only without moving the archive” is selected.
- Set the bad item limit. This value determines how many item errors will be tolerated before the move fails.
- Click Next.
Start the Batch Migration
On the next page (Start the batch):
- Select the recipient(s) who’ll receive the report after completing the batch.
- Select whether you want to manually start the move or automatically start it after creating the batch.
- Select whether you prefer to complete the migration batch manually or to let the migration complete automatically.
- Choosing the Manual option will cause the migration batch to pause each mailbox move before it reaches 100%.
- Click new.
You’ll see the following alert in EAC.
To view the migration status, click the View Details link.
You’ll see the status of each mailbox being moved.
Wait until the status changes to Completed. But if the status is other than Completed, you can view the details here.
The mailboxes have been moved to another database.
Post-Migration Clean Up
Once the mailbox move is finished, don’t forget to delete the migration batch.
Click Yes to delete the migration batch.
Using the Exchange Management Shell (PowerShell)
Moving mailboxes using Exchange PowerShell delivers a more flexible experience. Doing so gives you more customization options that you cannot get in the EAC.
In PowerShell, you can use two cmdlets to move mailboxes to another database.
- New-MoveRequest — Moves individual mailboxes.
- New-MigrationBatch — Moves mailboxes in batches. A migration batch consists of one or more mailbox move requests.
But since we’re only doing local move requests, using the New-MoveRequest command makes more sense. It is faster and does not require a migration mailbox. The only difference is the New-MigrationBatch command produces a detailed report that the New-MoveRequest command does not.
Note. Creating a mailbox migration batch in EAC uses the New-MigrationBatch command in the background.
Basic Parameters
The essential parameters for a local move request are:
- Identity: This parameter specifies the identity of the mailbox to be moved. It can be specified as a mailbox alias, user principal name (UPN), distinguished name (DN), or email address.
- TargetDatabase: This parameter specifies the name of the target database where the mailbox will be moved. It can be specified as the database name, GUID, or object.
- ArchiveTargetDatabase: This parameter specifies the name of the target archive database where the mailbox archive will be moved. It can be specified as the database name, GUID, or object.
- PrimaryOnly: This parameter specifies whether to move only the primary mailbox.
- ArchiveOnly: This parameter specifies whether to move only the archive mailbox.
Example 1: Move the Primary and Archive Mailbox
This example moves the primary and archive mailbox of the user owilson@theitbros.com to DB2.
New-MoveRequest -Identity owilson@theitbros.com -TargetDatabase DB1
Moving large mailboxes can take a long time. To view the move request progress, run the following command.
Get-MoveRequest
Example 2: Move the Primary Mailbox Only
To move only the primary mailbox, append the PrimaryOnly switch.
New-MoveRequest -Identity owilson@theitbros.com -TargetDatabase DB1 -PrimaryOnly
Example 3: Move the Archive Mailbox Only
To move only the archive mailbox, specify the ArchiveTargetDatabase parameter and append the AchiveOnly switch.
New-MoveRequest -Identity owilson@theitbros.com -ArchiveTargetDatabase DB1 -ArchiveOnly
Example 4: Move All Mailboxes from One Database to Another
Sometimes, you may need to move all mailboxes from one database to another. This scenario is useful when you plan to perform maintenance on a database and want to ensure it is empty. Or when you plan to decommission the old database.
Suppose you want to move all mailboxes from DB2 to DB1. You can do so by running Get-Mailbox command.
Get-Mailbox -Database DB2 | New-MoveRequest -TargetDatabase DB1
You can monitor the progress by running this command:
Get-MoveRequest
You can also get the move statistics per mailbox like so:
Get-MoveRequest | Get-MoveRequestStatistics
Other Useful Parameters for Local Move Requests
Apart from the Identity, TargetDatabase, PrimaryOnly, ArchiveTargetDatabase, and ArchiveOnly switches, below are the other useful parameters for the local mailbox move request.
- Suspend: This parameter specifies whether to suspend the move request. If this parameter is specified, the move request will be suspended and can be resumed later. If you specify this switch, the move request will be created in a suspended state. When you’re ready to start the move, you can run the Resume-MoveRequest cmdlet.
- BadItemLimit: This parameter specifies the maximum number of bad items allowed during the move operation.
- AllowLargeItems: This parameter is a Boolean parameter that specifies whether to allow items larger than the maximum message size limit to be moved. If this parameter is set to $true, the move request will continue even if items in the mailbox are larger than the maximum message size limit. If this parameter is set to $false (the default value), the move request will fail if any items in the mailbox are larger than the maximum message size limit.
- LargeItemLimit: This parameter specifies the maximum size of items that can be moved during the mailbox move operation. This parameter is only applicable if the AllowLargeItems parameter is set to $true
- AcceptLargeDataLoss: This parameter specifies whether to accept large data loss during the move operation. Only use this switch if the BadItemLimit value is 51 or higher.
- Priority: This parameter specifies the priority of the move request. The valid values are: Lowest, Low, Normal, High, and Highest.
- When the Mailbox Replication service (MRS) looks for new move requests in the queue to be processed, it first processes the move requests by priority and then LastUpdatedTimeStamp.
- Exchange moves boxes with a nominal priority by default. Add the -Priority High parameter to the end to increase the priority of a specific mailbox move.
Post-Move Clean Up
Once the mailbox move is completed, remove the mailbox move request from the queue. You canfilterg the move requests whose StatusDetail property value is Completed.
Get-MoveRequest -MoveStatus Completed
You can then pipe this output to the Remove-MoveRequest cmdlet. The Confirm:$false parameter suppresses the confirmation prompt.
Get-MoveRequest -MoveStatus Completed | Remove-MoveRequest -Confirm:$false
Conclusion
Moving mailboxes to another database in Exchange is a simple and straightforward process that can be accomplished using various methods such as PowerShell and EAC. It’s essential to understand why you may want to move a mailbox, such as server maintenance or balancing the load on a database.
If done correctly, the process can be completed with minimal disruption to end-users, ensuring that email communication remains uninterrupted. When moving mailboxes, it’s crucial to ensure that you have a solid backup and restore strategy if something goes wrong.
Overall, it’s important to follow best practices, perform testing before implementing changes, and seek guidance from experienced professionals if needed.