A user purged a folder weeks ago, or a deleted mailbox is past its retention period, and the only copy left is in a backup. You don't restore over the production database for that. Exchange Server has a recovery database (RDB) for exactly this job. In this post I'll take a restored database from files to mounted RDB, pull out a whole mailbox or just one folder, and clean up afterwards.
Errors this guide fixes
State: Dirty Shutdowneseutil /mh (restored database)+2 more guides-528 JET_errMissingLogFileeseutil /r-1216 JET_errAttachedDatabaseMismatcheseutil /r+1 more guide
How a recovery database works#
- An RDB is a special mailbox database you create in the Exchange Management Shell. You mount a restored copy of a database in it and extract data with
New-MailboxRestoreRequest, either into an existing mailbox or into a folder of one. - It's isolated: mail can't be sent to or from it, Outlook, Outlook on the web and the other client protocols are blocked, and its mailboxes can't be connected to user accounts.
- Mailbox management policies and online maintenance don't run against it, so nothing gets cleaned up while you work. Circular logging can't be enabled.
- Only one RDB can be mounted at a time on a Mailbox server. It doesn't count against the server's database limit, and you can't add database copies of it.
- It works only with databases from Exchange 2016 or later, and the target mailbox must be in the same Active Directory forest.
- Folder permissions (ACLs) aren't carried over when you restore content into a live mailbox.
Prerequisites#
- Database and log files from the backup, restored as files to a disk on the server with enough free space. Some backup products restore straight into an RDB. Windows Server Backup can restore only file-level backups to an RDB, not application-level backups.
- The log prefix of the original database (
E00,E01and so on):Get-MailboxDatabase DB1 | Format-List Name, LogFilePrefix. - An admin account with the permissions Microsoft lists for mailbox recovery in the Exchange Server recipient permissions topic.
Step-by-step#
1. Put the files in place and check the header#
Copy or restore the .edb and its logs into one folder, for example E:\Databases\RDB1. Then dump the header from an elevated prompt (eseutil is in %ExchangeInstallPath%Bin):
eseutil /mh "E:\Databases\RDB1\DB1.edb"A restored database almost always reports State: Dirty Shutdown. That's normal here: it has to be brought to Clean Shutdown before it can mount.
2. Run soft recovery#
eseutil /r E01 /l E:\Databases\RDB1 /d E:\Databases\RDB1Use your database's log prefix instead of E01. Run eseutil /mh again; good is State: Clean Shutdown. If recovery stops with an error such as -528 JET_errMissingLogFile or -1216 JET_errAttachedDatabaseMismatch, the logs don't match the database: check that every log from the backup set is in the folder, that the prefix is right and that /d points at the folder holding the .edb. My Dirty Shutdown and soft recovery guide goes deeper.
3. Create the RDB, restart the store and mount it#
New-MailboxDatabase -Recovery -Name RDB1 -Server EX01 `
-EdbFilePath "E:\Databases\RDB1\DB1.edb" -LogFolderPath "E:\Databases\RDB1"
Restart-Service MSExchangeIS
Mount-Database RDB1Watch out: restarting the Information Store service briefly interrupts every database mounted on that server. Use a server without active copies or a quiet period.
4. Find the mailbox inside the RDB#
Get-MailboxStatistics -Database RDB1 | Sort-Object DisplayName |
Format-Table DisplayName, MailboxGuid, ItemCount, TotalItemSize -AutoSize5. Restore what you need#
The whole mailbox, back into the same user's mailbox, under one folder so nothing mixes with current mail:
New-MailboxRestoreRequest -SourceDatabase RDB1 -SourceStoreMailbox 1d20855f-fd54-4681-98e6-e249f7326ddd `
-TargetMailbox morris@contoso.com -TargetRootFolder "Recovered from backup"Only the Inbox and its subfolders (the #Inbox# syntax finds the well-known folder whatever its localized name):
New-MailboxRestoreRequest -SourceDatabase RDB1 -SourceStoreMailbox "Morris Cornejo" `
-TargetMailbox morris@contoso.com -IncludeFolders "#Inbox#/*" -TargetRootFolder "Recovered Inbox"Into somebody else's mailbox, for example a leaver's data for their manager, add -AllowLegacyDNMismatch. By default the restore checks that the source mailbox's LegacyExchangeDN exists on the target, to stop you restoring into the wrong mailbox. Use -TargetIsArchive to restore into an archive mailbox, and give it a -TargetRootFolder so the content is visible.
If the request fails on corrupt items, retry with a small -BadItemLimit (Microsoft recommends 10 or lower); the default of 0 fails on the first bad item.
6. Watch the request#
Get-MailboxRestoreRequest | Get-MailboxRestoreRequestStatistics |
Format-Table Name, TargetAlias, StatusDetail, PercentComplete, ItemsTransferred -AutoSizeVerify#
- The request shows
Completed, with no bad or large items skipped that you didn't expect. - The target folder exists and holds the expected number of items:
PowerShell
Get-MailboxFolderStatistics morris@contoso.com | Where-Object { $_.FolderPath -like "/Recovered*" } | Format-Table FolderPath, ItemsInFolder -AutoSize - The user opens the mailbox in Outlook or Outlook on the web and confirms the recovered items are there.
Clean up#
Get-MailboxRestoreRequest -Status Completed | Remove-MailboxRestoreRequest -Confirm:$false
Dismount-Database RDB1 -Confirm:$false
Remove-MailboxDatabase RDB1 -Confirm:$falseRemove-MailboxDatabase removes the database object, not the files. Delete the RDB folder yourself once you're sure nothing else is needed, because restored mail is sensitive data sitting outside your normal controls.
Tips & gotchas#
- Restore into a folder like Recovered from backup rather than merging: users find items faster and you avoid duplicates. The default conflict handling (
KeepSourceItem) applies when items match. - Restored content arrives without the original folder permissions; re-share folders if needed.
- A mailbox deleted within the retention period doesn't need a backup at all: see Recover a deleted mailbox in Exchange Server.
- Plan disk space for the full restored database plus logs, and keep the RDB on a volume separate from production databases.

