Rolling and Redistributing Databases
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
PS command: From the <exchange dir>\scripts directory, run the following:
.\RedistributeActiveDatabases.ps1 -DagName dagname -BalanceDbsByActivationPreference –ShowFinalDatabaseDistribution
–Confirm:$falseIf 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 on the database copies is failed and it does become healthy after time, you could reseed just the ContentIndex by using this command: update-mailboxdatabasecopy databasename\servername –CatalogOnly
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