Basic Procedure:

  • Create a Temporary Database.
  • Move users from the DB you intent to re-create to the Temp DB.
  • Once complete, dismount the original DB.
  • Delete the .EDB file from the path of Original DB.
  • Mount the Original DB – it will create a blank .EDB file.
  • Move users back to the newly created DB from the Temp DB.
  • Note: You might want to turn on Circular Logging on the Storage Group so that the server won’t run out of space on the log drive while moving users. Remember to turn off Circular Logging after the moves are complete.

Detailed Procedure:

How to create a Temporary Database:
  • Open Exchange Management console.
  • Expand Server Configuration and click on Mailbox.
  • Select the Server.
  • Right click on the Server and select “New storage Group”.
  • Give a name like “TempSG-XX”.
  • Provide the temporary path for Log file and System Files and click New.
  • Right click the newly created “TempSG-XX” and select “New Mailbox Database”.
  • Give a name (like DB-XXTemp) to the new Temp Database and give a temporary location for the EDB file path.
  • Make sure the option “Mount this Database” is selected and click Finish.
  • Open the properties of the Original DB.
  • Select the Limits Tab and copy the values.
  • Apply the same values to the DB-XXTemp.
  • Click on the “Client settings” Tab of the original DB.
  • Apply the same Public folder database to the DB-XXTemp.

Procedure for Moving Mailboxes.

Moving users using Exchange Management console:
  • Open Exchange Management console.
  • Select the Recipient Configuration and click on Create Filter.
  • Select “Database” “Equals” and click on Browse.
  • Search for the Original DB and click OK.
  • Click Apply Filter.
  • Select a group of users, right click and select “Move Mailbox”
  • Click on browse and search for the DB-XXTemp and select it.
  • Click on Move Mailbox. Repeat this till all the users are moved to the Temp DB.
Moving users using Powershell:
  • Logon to any Exchange 2007 Mailbox Server – good to avoid the server you are working on.
  • Open Exchange Management Shell.
  • Type following command:

Get-MailboxDatabase -Identity SourceDatabaseIdentity | Get-Mailbox -ResultSize unlimited | Move-Mailbox  -targetdatabase TargetDatabaseIdentity -baditemLimit 0 -SourceMailboxCleanupOptions DeleteSourceMailbox -MaxThreads 10 -confirm:$false

  • The same command can be run from multiple (say 4) servers simultaneously. Keep an eye on the server performance during the user moves.
  • Make sure all users are moved off of the database.
  • Dismount Original Database, open database path and delete Database file (EDB file)
  • Mount database – it will create a blank .EDB file.
  • Enable Circular logging for Original Storage Group :
  • Dismount and mount Original Database to activate Circular logging.
  • Start moving users from Temp Database to Original Database.
  • Once the moves are over:
    • Disable circular logging on the Original Database. (If your company prefers it that way)
    • Dismount/Mount the Original DB.
    • Once the moves are completed, dismount the temporary Storage Group through Exchange Management Console.
    • Delete the Temporary Database and Temporary Storage Group from Console.
    • Delete all the files from \Logs, \SystemFiles and \TEMPDB.

Post User Move process (Original To Temporary)

  • Make sure all users are moved off of the database.
  • Dismount Original Database, open database path and delete Database file (EDB file)
  • Mount database – it will create a blank .EDB file.
  • Enable Circular logging for Original Storage Group :
  • Dismount and mount Original Database to activate Circular logging.
  • Start moving users from Temp Database to Original Database.
  • Once the moves are over:
    • Disable circular logging on the Original Database. (If your company prefers it that way)
    • Dismount/Mount the Original DB.

Post User Move steps (Temporary To Original)

  • Once the moves are completed, dismount the temporary Storage Group through Exchange Management Console.
  • Delete the Temporary Database and Temporary Storage Group from Console.
  • Delete all the files from \Logs, \SystemFiles and \TEMPDB.

Related: Does Exchange 2007 always use whitespace available in a database?

-Thanks, Jinesh.

Advertisements