The Ultimate Guide to Move-ActiveMailboxDatabase Cmdlet
Published On - November 15, 2024 by Nasir Khan | Reading Time: 4 minutes
Administrators may need to move mailbox databases to another server when working with the Exchange Servers. This particularly happens in a Database Availability Group (DAG) setup. The cmdlet Move-ActiveMailboxDatabase is a command of Powershell facilitating to shift of mailboxes from one server to another. However, sometimes you might encounter errors such as data sync issues or database corruption. But, the Regain Exchange Recovery Tool is there to help you repair and restore your Exchange database. Let’s go through the article to get detailed information on moving an active mailbox without putting data at risk.
A Quick Overview
In an Exchange Server setup that uses Database Availability Groups (DAG), copies of the mailbox database are stored on multiple servers for backup. The main server keeps the ‘active’ copy, while the others keep ‘passive’ copies. If the main server experiences problems, you need to move-activemailboxdatabase to another server. Here are the possible reasons why it is important:
- To balance the load and prevent interruption in database services. This helps check data loss as well.
- There are instances when a server fails unexpectedly. Users need to shift the active database to a healthy server, ensuring business continuity.
- In addition, it is of great importance during maintenance tasks. This includes hardware replacement, OS updates, or changes in network configuration.
Further, this ‘cmdlet’ is used within the EMS (Exchange Management Shell). This is flexible enough that help admins maintain the system stability.
How Move-ActiveMailboxDatabase Cmdlet Command Works?
You need to specify a few things to use this “Move-ActiveMailboxDatabase Cmdlet”, i.e., the source database and the destination server. Destination Server will be the primary server. Further, here is how to move a database to a different server within the DAG setup:
Basic Command
To move a specific mailbox database from one server to another, use the following simple command:
Move-ActiveMailboxDatabase DB1 -ActivateOnServer Server2
Hence, the switchover is successful. This command (in the box above) will move the database DB1 from the current server to Server2. Thus, Server2 will be the new active server for that database. However, this command will move only a specific database within your DAG setup.
To Move All Active Databases on a Server
Many users want to move all active databases to another server for multiple reasons like server issues or maintenance purposes. In that case, you can adjust the command and furthermore switch over all active databases on your Exchange Server setup. Run the given command to move all active database:
Move-ActiveMailboxDatabase -Server Server1
Hence, this command helps you transfer all active databases from Server 1 to another server with healthy copies in the DAG.
Key Parameters to Use with ‘Move-ActiveMailboxDatabase Cmdlet’
Here are some of the important parameters to be used with the Cmdlet that you must know:
- -ActivatePreferredOnServer
- -ActivateOnServer
- -SkipActiveCopyChecks
- -WhatIf
The Move-ActiveMailboxDatabase Cmdlet command supports these parameters to control the behavior of the database move. Let us explore them in detail:
-ActivatePreferredOnServer
If available, the ‘-ActivatePreferredOnServer’ parameter moves the active mailbox database to the preferred server. In a DAG, each active mailbox database can have a specific preferred Server, assigned as a primary location. So, using this parameter ensures that the database is moved to a healthy and designated server only. The parameter is used as follows:
Move-ActiveMailboxDatabase -ActivatePreferredOnServer
-ActivateOnServer <ServerName>
This command is used to activate all mailbox databases on the specified server, no matter the preferred server. Here is how to use this parameter:
Move-ActiveMailboxDatabase -ActivateOnServer Server3
-SkipActiveCopyChecks
The “-SkipActiveCopyChecks” allows a quick switchover. Before moving a database, the system checks if the active database copy is healthy or currently not seeding. This command cuts off this procedure and lets you do switchover instantly, even if the copy isn’t fully synchronized. However, this can be risky leading to data loss.
Move-ActiveMailboxDatabase -SkipActiveCopyChecks
Caution: Use this command, especially when in an emergency.
-WhatIf
This parameter is extremely helpful, especially during server maintenance. You must check that everything is fine before proceeding. It allows you to test the command in the ‘simulation mode’ that too without introducing any significant change.
Move-ActiveMailboxDatabase -WhatIf
Note: Run this parameter during scheduled maintenance. This ensures that no unexpected problems occur. However, it will not work in case of an emergency or sudden server failure.
Common Issues and Troubleshooting Tips
During the ‘move activemailbox database’ process, you might face unexpected issues as well. Hence, some of the common errors and solutions are as follows:
- You might encounter the error: An Active Manager operation failed. This means that there was an issue while making a database copy active on a server. It has a high queue length or possibly isn’t synchronized. So, you need to run a check to ensure all copies of the database are up-to-date.
- Another possible issue could be database corruption or missing logs. As a result, the process to move-activemailboxdatabase to another server may fail. Therefore, we recommend using Best Exchange Server Recovery.
You can fix the Exchange database corruption or missing log files using the Regain Exchange Server Recovery Tool. It thoroughly scans and repairs damaged files, without needing the original server. You can directly migrate the restored Exchange data to a Live Exchange Server or Office 365.
Here are some measures that you must follow while using the Move-ActiveMailboxDatabase Cmdlet:
- You must plan your move when user activity is low, like maintenance windows.
- It is recommended to run your command with the -WhatIf parameter first.
- Ensure that database copies are healthy to avoid move failures and data loss.
- Once the move is complete, check the health status of your server.
- Also, document and maintain a record of each mailbox database move.
Conclusion
The Move-ActiveMailboxDatabase cmdlet is a very important command in ESM(Exchange Server Management), for administrators working with the DAG environment. It enables users to flexibly move databases from one server to another. Additionally, various parameters make the task easy and efficient. However, there is a risk of data loss, and involves too much of technicalities, Therefore, we have recommended using the reliable Exchange Recovery Tool. Furthermore, you must perform the process with complete knowledge and guidance to avoid data loss.
Related Articles:
- Outlook for Mac Not Syncing With Exchange Server
- Outlook Disconnected from Exchange Server
- Export Exchange Server Mailbox to PST using PowerShell Commands
- Recover Lost Exchange Server from Active Directory
- Fix Exchange Server is Unavailable Error
- Defrag Exchange Mailbox Database Using PowerShell Cmdlets