Rolling Databases to other Servers
PS Script – Note: we have a csv file that has the databasenames and the server we want to move to that the script calls. In the csv it has a db and a server column.
import-csv movedb_Ex2010.csv | foreach {Move-ActiveMailboxDatabase $_.DB -ActivateOnServer $_.Server -MountDialOverride:Lossless -confirm:$false}
Status of Script: Check mounted databases
Get-MailboxServer | Where {$_.Name -like “Server*”} | Get-MailboxDatabaseCopyStatus | Where {$_.Status -like “Mounted”}
Troubleshooting:
- Check the health of the database copies: Get-MailboxDatabaseCopyStatus database
- Manually roll a database, run the following command: Move-ActiveMailboxDatabase databasename –ActivateOnServer servername –MountDialOverride:Lossless –confirm:$false
Redistributing Databases
.RedistributeActiveDatabases.ps1 -DagName dagname -BalanceDbsByActivationPreference –ShowFinalDatabaseDistribution –Confirm:$false
Troubleshooting:
If the databases did not mount on the server they should have, check for databasecopystatus on that server or give it some time to try again.
You can run Get-MailboxDatabaseCopyStatus databasename to check to see the database copy health.
You can run Move-ActiveMailboxDatabase databasename –ActivateOnServer servername –MountDialOverride:Lossless –confirm:$false to manually move the database to another server.
If the ContentIndexState is failed on the databasecopies with the same server, you may have to restart that server again.
To run a report on the Health of the databasecopies after a redistribute is finished, run the following:
Get-MailboxServer | Where {$_.name -like “server*”} | Get-MailboxDatabaseCopyStatus | Select Name, Status, ContentIndexState