Read time 8 minutes
Recovering mailbox databases from Exchange 2016 can be very challenging if you don’t have backups or copies of the mailbox database. Usually, not every user possesses technical knowledge or is capable of restoring a mailbox database in Exchange Server. Recovering or restoring Exchange database in Exchange Server to get deleted mailbox requires in-depth knowledge of Exchange features and retention policies. However, Microsoft offers a reliable facility to recover mailboxes from Exchange Server 2016 and 2019– Recovery Database.
What is a Recovery database?
Recovery Database (RDB) is a unique database that enables users to mount the restored mailbox database and extract data from it as a part of a recovery operation. With RDB, you can recover mailboxes from a backup or a copy of the database without interrupting user access to the data.
Benefits of creating a recovery database
Here are some offered benefits of having a recovery database in your Exchange Server (2016 and 2019):
- Helps to restore lost mailboxes and their items.
- Can’t help in sending or receiving email messages.
- It is not possible to create a copy.
You’ll have to use the New-MailboxRestoreRequest cmdlet to extract data from the recovery database. After retrieving the data, you can restore it to the existing mailbox or a new folder.
Pre-requisites for mailbox recovery using RDB
Before starting the Exchange mailbox recovery with RDB, there are some things that you need to know:
- You need Organization Management permissions to perform this procedure.
- The database and log files with recovered mailboxes must be copied or restored to the RDB folder structure.
- Run mailbox restore requests.
- You might have to use Eseutil /R to restore databases in a clean shutdown state.
- Once database restore is done, remove the recovery database if it’s not in use.
After knowing these things, you can use Exchange Management Shell to recover the data using the Recovery Database.
How to restore Exchange mailboxes?
Go through the sections below to see how you can restore mailboxes in Exchange Server.
Recovering soft deleted user mailboxes
Soft deleted mailboxes in Exchange are the ones that have been removed from the database, but it is still in the recycle bin and under the retention period of 30 days. You can restore the mailbox items from the bin within these 30 days, after which the data will be removed completely from the server. Here is the process to get deleted mailbox using PowerShell scripting:
Step 1. Open Windows PowerShell as an administrator.
Step 2. Run the Undo-SoftDeletedMailbox cmdlet to undo the deletion of the mailboxes that are still in the recycle bin.
You can also run the following cmdlet to restore the mailboxes:
Step 1. Connect to Exchange Online PowerShell and run the following cmdlet to identify the soft deleted mailbox.
Get-Mailbox -SoftDeletedMailbox | Select-Object Name,ExchangeGuid
Step 2. Create a target mailbox where you want to restore these mailbox items
Get-Mailbox -Identity <NameOrAliasOfNewTargetMailbox> | Format-List ExchangeGuid
Step 3. In the following cmdlet, replace the “SoftDeletedMailboxGUID” with the GUID retrieved in step 1.
New-MailboxRestoreRequest -SourceMailbox <SoftDeletedMailboxGUID> -TargetMailbox <NewTargetMailboxGUID>
With this, you have restored your soft deleted mailbox items to a new Exchange mailbox.
Recovering hard deleted user mailboxes
Hard deleted mailbox is a permanently deleted user mailbox whose retention period (30 days) is over and cannot be restored. Any mailbox that gets deleted permanently becomes inactive. Let’s see what are the ways with which we can restore a hard-deleted mailbox.
Step 1. Run the following command in Exchange Online PowerShell to get the list of inactive mailboxes:
Get-Mailbox -InactiveMailboxOnly -ResultSize Unlimited | FT DisplayName,PrimarySMTPAddress,WhenSoftDeleted
Step 2. Create a new variable which has properties similar to the inactive mailbox.
$inactiveMailbox = Get-Mailbox -InactiveMailboxOnly -Identity <identity of inactive mailbox>
Step 3. Show LegacyExchangeDN of the inactive mailbox to add it as a proxy address for the destination mailbox.
$inactiveMailbox.LegacyExchangeDN
Step 4. Add the X500 proxy address to the LegacyExchangeDN
Step 5. With the following cmdlet, all the contents of inactive mailbox will be moved to the target mailbox.
New-MailboxRestoreRequest -SourceMailbox $inactiveMailbox.DistinguishedName -TargetMailbox <identity of target mailbox>
You can use this process to restore hard deleted mailbox. However, the process is quite complicated especially if you are a non-technical Exchange Server user. To avoid making errors, you can use a professional Exchange Server Recovery tool to restore mailboxes to the Exchange database.
Exchange Management Shell to recover mailboxes using the Recovery Database
Follow the below steps to recover deleted mailbox data using Recovery Database:
Step 1. Copy the recovered database and its log files to the location that you’ll use for the recovery database.
Step 2. Now, use Eseutil to put the recovered database in a clean shutdown state:
Eseutil /R Exx /l <RDBLogFilePath> /d <RDBEdbFolder>
Step 3. Create the recovery database and give a unique name to it. Use the name of the database file for the EdbFilePath parameter and the location for the LogFolderPath parameter.
New-MailboxDatabase -Recovery -Name <RDBName> -Server <ServerName> -EdbFilePath <RDBPathandFileName> -LogFolderPath <LogFilePath>
Step 4. Now, restart the Microsoft Exchange Information store service with the following command:
Restart-Service MSExchangeIS
Step 5.Mount the recovery database using the below command:
Mount-database <RDBName>
Step 6. Using the below command, verify whether the mounted database contains the mailbox you want to restore or not:
Get-MailboxStatistics -Database <RDBName> | Format-Table -auto
Step 7. After verifying the restored mailboxes, use the New-MailboxRestoreRequest cmdlet to restore the mailbox to the production mailbox. You can use the below command to perform this action:
New-MailboxRestoreRequest -SourceDatabase -<Database Name> -SourceStoreMailbox -<MaiboxGUID> -TargetMailbox -<MailboxName>
Step 8. You can check the status of mailbox restore using Get-MailboxRestoreRequest. When the restore process is complete, remove the restore request with Remove-MailboxRestoreRequest.
Using this technique, you can restore Exchange mailboxes stored within the database of Exchange Server. But the steps involved in this manual process are very complicated. First, you’ll have to create an RDB, restore the database, and then use a cmdlet to extract data from it. There is no assurance that you get deleted mailbox without any data loss.
The retrieved file might have some of the emails or other data missing or inaccessible. In situations when you are in dilemma to find a reliable mailbox recovery method, we suggest you use a professional Exchange Server recovery tool.
Conclusion
Restoring mailboxes from Exchange database can be daunting especially if you don’t know the exact process to recover the mailboxes. One cannot completely rely on the manual approach because it demands technical knowledge and have the tendency to cause potential data loss. You can use a third-party Exchange Mailbox Recovery software to recover Exchange 2016 mailboxes. Kernel for Exchange Server is one of the top-rated software that streamlines the process to retrieve deleted mailboxes from the database.