Restoring Exchange Environment using Database file (edb file)
Exchange server crashed but no harm to the drive where database and logs files were stored. Have installed new Exchange server in same domain. How can we make use of this database file to recover all mailboxes from log files and data files
Solutions:
Seems like your AD is intact and if your Exchange server was not Domain Controller then you could use Disaster Recovery switch to restore whole Exchange server details back using Active Directory. This could be achieved by manually starting setup in /disasterrecovery command-line option. Setup /Disaster recovery will install Exchange, configuring the server automatically with the server information already in Active Directory.
Then you can use Database Portability option if the following is True :
Exchange Organization and Administrative Group name should be same for a database to get mount. This means the new server installed should be in same Exchange Organization and Administrative as that of the database file. Now if this doesn’t match the Database will fail to mount with Error 1088. If your Exchange version is 2007/2010 then you don’t need to really worry about Administrative Group.
From the command prompt run the command:
Find /i “/o=” “Your database path\Your Database Name.edb”
Also if you have your Outlook Clients in cached mode then you have all your data cached on client machine which can be exported as PST and imported back to new mailbox created on new Exchange server. The only issue users will face is while replying to these old mails imported from PST.
Now once your Exchange is installed, first is to get the database file and log file on to this new server where you want to mount it and this could by copying files to local drive or attaching the same storage to new server. Before mounting the database we need to make sure that database file is in clean Shutdown and to check this status, in Exchange Management Shell, navigate to location where database file is present and run the following command against the database file.
Eseutil /mh MB01.edb | find str “State:”
If the output is clean shutdown then you can mount the database and reconnect user mailboxes but if the output is Dirty Shutdown then we need to run soft recovery and replay all the required log files to get database into Clean Shutdown.
Create new Mailbox Database using the below command by specifying new database and log file location as that of the current location. Now copy the cleaned shutdown database file to new location. Mark the database as overwritten and mount the database by running the following command:
New-MailboxDatabase -Server NewServerName -Name NewMailboxDatabasename -LogFolderPath F:\Logs\NewMailboxDatabasename -EdbFilePath H:\Data\NewMailboxDatabasename\NewMailboxDatabasename.edb
Set-MailboxDatabase NewMailboxDatabasename -AllowFileRestore:$true
Mount-Database NewMailboxDatabasename
Now database is mounted but the user mailboxes are still pointing to old server name which could be viewed using following command:
Get-Mailbox -Database NewMailboxDatabasename
So the last step would be to point all the mailboxes to new Exchange server name which could be achieved using the following command:
Get-Mailbox -Database MailboxDatabasename | Set-Mailbox -Database NewMailboxDatabasename
And now if we check for the mailboxes it would show up New Exchange Server name.