In recent articles we’ve looked at how to backup an Exchange 2013 mailbox server, how to restore databases to an Exchange 2013 mailbox server, and how to create a recovery database in Exchange 2013.

In this article I will demonstrate how to use the recovery database to restore data to a mailbox.

Obviously the first step in this process is to restore the database that has the data you’re interested in into a recovery database. You can find the steps for performing that task using Windows Server Backup here.

Here is my recovery database ready to go.

[PS] C:\>Get-MailboxDatabase | where recovery

Name                           Server          Recovery        ReplicationType
----                           ------          --------        ---------------
RecoveryDB                     E15MB1          True            None

The mailbox I need to restore is Alan Reid, and I can verify that the mailbox is available in the recovery database by using Get-MailboxStatistics.

[PS] C:\>Get-MailboxStatistics -Database RecoveryDB | where displayname -eq "Alan Reid"

DisplayName               ItemCount    StorageLimitStatus
-----------               ---------    ------------------
Alan Reid                 16971

Restoring from a recovery database involves creating a mailbox restore request, using the New-MailboxRestoreRequest cmdlet.

New-MailboxRestoreRequest requires you to specify:

  • A source database (in this case, the recovery database)
  • A source mailbox
  • A target mailbox

The source and target don’t necessarily need to be the same, and there are a variety of other parameters available to handle situations such as including/excluding specific mailbox folders, handling corrupt items, conflict resolution, and so on.

Let’s take a look at some recovery scenarios to demonstrate how you can use mailbox restore request.

Scenario – Restoring Sent Items Folder

In this scenario Alan Reid has lost all of this sent items older than 3 weeks, and for the sake of demonstration let’s also assume they can’t be restored from the recoverable items folder.

exchange-2013-mailbox-restore-scenario-1-01

At the moment he has 869 items in his sent items folder.

[PS] C:\>Get-MailboxFolderStatistics alan.reid -FolderScope SentItems | fl name,items*

Name                       : Sent Items
ItemsInFolder              : 869
ItemsInFolderAndSubfolders : 869

To restore the sent items folder from the recovery database we create a mailbox restore request.

[PS] C:\>New-MailboxRestoreRequest -SourceDatabase RecoveryDB -SourceStoreMailbox "Alan Reid" -TargetMailbox Alan.Reid -
IncludeFolders "#SentItems#"

Name                                           TargetMailbox                                  Status
----                                           -------------                                  ------
MailboxRestore                                 exchange2013demo.com/Company/People/Sydney/... Queued

Monitoring the Mailbox Restore Request

Notice that the mailbox restore request is created initially with a status of “Queued”. We can monitor the progress of the restore request using Get-MailboxRestoreRequest and Get-MailboxRestoreRequestStatistics.

[PS] C:\>Get-MailboxRestoreRequest

Name                                           TargetMailbox                                  Status
----                                           -------------                                  ------
MailboxRestore                                 exchange2013demo.com/Company/People/Sydney/... InProgress

[PS] C:\>Get-MailboxRestoreRequest | Get-MailboxRestoreRequestStatistics

Name           StatusDetail    TargetAlias PercentComplete
----           ------------    ----------- ---------------
MailboxRestore CopyingMessages alan.reid   50

While the restore is in progress you might be interested to know the percent completed, and the numbers of items transferred so far compared to how many are estimated to be transferred in total.

[PS] C:\>Get-MailboxRestoreRequest | Get-MailboxRestoreRequestStatistics | fl percentcomplete,itemstransferred,*count*

PercentComplete            : 71
ItemsTransferred           : 4765
BadItemsEncountered        : 0
LargeItemsEncountered      : 0
EstimatedTransferItemCount : 7866

When the restore has finished the status will change to “Completed”.

[PS] C:\>Get-MailboxRestoreRequest | Get-MailboxRestoreRequestStatistics

Name           StatusDetail TargetAlias PercentComplete
----           ------------ ----------- ---------------
MailboxRestore Completed    alan.reid   100

After the restore Alan Reid’s sent items folder has a much larger item count.

[PS] C:\>Get-MailboxFolderStatistics alan.reid -FolderScope SentItems | fl name,items*

Name                       : Sent Items
ItemsInFolder              : 8120
ItemsInFolderAndSubfolders : 8120

Note: The default behaviour for conflict resolution is to keep the source item (ie the item being restored from the recovery database). You can use the -ConflictResolutionOption parameter to specify KeepLatestItem or KeepAll instead if you wish.

Scenario – Restoring Entire Mailbox

In this example a staff member has left the organization some months or years ago, then been re-hired, and wants their old emails, contacts, and calendar items back. Because the mailbox was deleted when they left the organization their new mailbox is empty on arrival.

[PS] C:\>Get-MailboxStatistics "ann parker"

DisplayName               ItemCount    
-----------               ---------    
Ann Parker                0

A recovery database is created from a backup taken while the original mailbox still existed.

[PS] C:\>Get-MailboxStatistics -Database RecoveryDB | where displayname -eq "ann parker"

DisplayName               ItemCount    
-----------               ---------    
Ann Parker                6107

A new mailbox restore request is used to restore the entire mailbox contents from the recovery database. Because the LegacyExchangeDN is different for the new mailbox an additional -AllowLegacyDNMisMatch parameter is required to allow the restore to occur. This would be the same situation if you were trying to restore a person’s mailbox data into a complete different person’s mailbox.

[PS] C:\>New-MailboxRestoreRequest -SourceDatabase RecoveryDB -SourceStoreMailbox "Ann Parker" -TargetMailbox Ann.Parker -AllowLegacyDNMismatch

When the restore is complete Ann Parker’s mailbox has the recovered items in it.

[PS] C:\>Get-MailboxStatistics "ann parker"

DisplayName               ItemCount    Stor
-----------               ---------    ----
Ann Parker                6103

Scenario – Restoring to a Different Folder

In this example David Abbott knows he has lost some emails but isn’t sure exactly what or when. He has asked that his Inbox be restored to a different folder so that he can look through it and recover any items he finds in there that he needs.

A new mailbox restore request is created using the -TargetRootFolder parameter to specify where to recover the items to, and including only the Inbox and any subfolders of the Inbox.

[PS] C:\>New-MailboxRestoreRequest -SourceDatabase RecoveryDB -SourceStoreMailbox "David Abbott" -TargetMailbox David.Abbott -TargetRootFolder "Restored Items" -IncludeFolders "#Inbox#/*"

David will be able to see the folder in Outlook or OWA almost as soon as the restore request begins processing.

exchange-2013-mailbox-restore-scenario-3-01

Cleaning Up Mailbox Restore Requests

You may notice that completed mailbox restore requests are left in place and are not automatically removed. This is so you can do any analysis or reporting you need to do on them before they are removed.

[PS] C:>Get-MailboxRestoreRequest -Status Completed

Name                                           TargetMailbox                                  Status
----                                           -------------                                  ------
MailboxRestore1                                exchange2013demo.com/Company/People/Melbour... Completed
MailboxRestore                                 exchange2013demo.com/Company/People/Sydney/... Completed
MailboxRestore                                 exchange2013demo.com/Company/People/Melbour... Completed
MailboxRestore                                 exchange2013demo.com/Company/People/Melbour... Completed

When you are happy to remove the completed mailbox restore requests you can use Remove-MailboxRestoreRequest.

[PS] C:>Get-MailboxRestoreRequest -Status Completed | Remove-MailboxRestoreRequest

Summary

Restoring mailbox items from a recovery database involves the creation of mailbox restore requests. As you can see from the example scenarios above there are many different ways that the mailbox restore request can be configured to run to suit almost any situation that you encounter.

About the Author

Paul Cunningham

Paul is a former Microsoft MVP for Office Apps and Services. He works as a consultant, writer, and trainer specializing in Office 365 and Exchange Server. Paul no longer writes for Practical365.com.

Comments

  1. P Henry

    Paul,

    I was wondering if it is possible to restore a mailbox to a different exchange server for disaster recovery purposes. We have two Exchange 2013 servers in two different sites. They are both backed up every night. If one of the sites went down permanently (or for an extended period of time), would we be able to restore the mailboxes from that server to the other one?

    Thanks,
    P Henry

  2. Jerome Buenavista

    Hi sir i read the article from your post it is very helpful to restore email, may i also ask if it is also possible if the one that restoring is from a dead server trying to retrieve sent items email from exchanger outlook the owa, appreciated if can share some information of how to restore it,thank you in advance.

  3. maxwell

    Hi there

    This was very helpful in helping me restore a db, thank you

  4. Otmane

    Hello,

    Great article thank you, I have a question, my users allways create subfolder so they can do some classification of the email. It happen tha we lost one of those folders. is there a way to recover a specific folder inside the mailbox.

    Thank you

  5. Matt Hall

    I have a user that had various email removed from various folders. I want to restore all of her email from the night of a backup without interrupting the mail she has received since the backup.

    When I restore the data from previous date does it simply merge in the emails they deleted on accident from various folders, or will it replace the mailbox and all emails it received prior. My gut says merge, but don’t want to find out the hard way.

    1. Avatar photo
      Paul Cunningham

      If you’re ever unsure about things like this then the correct approach is to set up a test case and do a test.

      1. Matt

        yep. that is what I am going to do. Just curious if someone had experience and knows the outcome. You would think that TechNet would say this command will merge or replace.

  6. Alex

    A user have

    Inbox – 9000 emails
    InboxPM – 50 emails
    InboxPM2 – 20 emails
    InboxPM3 – 10 emails
    etc etc etc

    How I can recover only subfolders and not the Inbox content?

    I mean: I don’t need the 9000 emails from Inbox, only the 50 + 20 + 10 from the PM folders.

    Can I exclude INBOX and include PM subfolders? Can I use wildcards?

  7. Castelo

    please i have question , i wanna to restore Mailbox dc2 but it give me at last

    “Mailbox ‘dc2’ is a connected mailbox. Only soft-deleted and disabled mailboxes can be restored.”

  8. Tamer

    Hi Paul,
    Nice article.

    Can I use a passive copy of a DAG to extract mailboxes to PSTs files?

    Ex. I have active database on Srv1 replicated to Srv2(remote location),
    Can I extract the mailboxes from the passive copy on Srv2?

  9. Bianca

    Just one question, how do I prevent reminders for old calendar items when restoring to an online mailbox? I assume exclude folder Recoverable Items (perhaps Recoverable ItemsCalendar logging), but all my test have failed.

    Thanks !

  10. Frank

    Hi Paul, this is a great article. I came across it when searching for ” restore data exchange 2013 calendar resource “, as I need o restore calendar appointments from a shared calendar that disappeared. I’m hoping this will allow me to restore that, I’ll post back. Thanks

  11. Fabian

    Hi…

    How I can restore a mailbox with a date range…???

    Regards..

    Fabian

  12. Kent R. Nilsen

    Hello,

    I accidentally deleted a user 3 days too early, and need to restore it. But this returns an error:

    New-MailboxRestoreRequest -SourceDatabase MailboxDB -SourceStoreMailbox d6ee629c-9543-443d-a6fc -22cf1b7b7ad9 -TargetMailbox workers.name -AllowLegacyDNMismatch

    This returns the following error, though the user has been created in AD:

    The operation couldn’t be performed because object ‘workers.name’ couldn’t be found on ‘domaincontroller.ourdomain.com’.

    Any ideas what I’m doing wrong?

    1. Avatar photo
      Paul Cunningham

      It seems that the mailbox ‘workers.name’ can’t be found… if you run Get-Mailbox workers.name does that return a result?

  13. saurabh sharma

    Hi , i have a question .
    we we want to recover the archive of the soft deleted mailbox ,

    then could be use the below command

    New-mailboxrestorerequest -sourcemailbox -SourceisArchive -Targetmailbox -targetisarchive

  14. James G

    First off thank you for all the direction and help. Secondly I’ve gotten stuck on restoring a mailbox from a recovered Database, When I do The Get-mailboxstatistics command I am getting 1 mailbox that is showing up 4 times. So when I go to migrate the email its telling me that the mailbox is not unique on the database and thus cannot complete the request.

    Anyhelp would be much appreciated! Thank you.

    James

  15. Mike

    How to Exclude multiple folders? Say I want to exclude Contacts and JunkEmails.
    Should I do it this way: -ExcludeFolders “Contacts/*,JunkEmails/*”?

    1. Real Dore

      After many trials, this worked for me:

      -excludefolders “#Inbox,SentITems,DeletedItems#”

      I did not try the -includefolders, but I would expect this would work as well.

      Real

  16. Ron

    Absolutely great article

  17. Tiscy

    Hi Paul,

    great Article, many thanks.
    I am not following your Guide to restore an example Mailbox (with 10 items).
    I used the command, to recover the whole Mailbox into a different Folder, called “Recovered”
    The command executed successfully, but it remains in “Queued” Status, with the percentage of 0.
    SO it does not start.. why could that happen?
    Any possibility to force the start of check the logs?

  18. indrapal

    Really Great Articles…..However when I was restoring mailbox in my scenario and ran this CMD,

    New-MailboxRestoreRequest -SourceDatabase REC5 -SourceStoreMailbox “User1” -TargetMailbox User1 -IncludeFolders “#Inbox#”

    Then I am receiving this error…

    The call to ‘net.tcp://vm2.mkt.local/Microsoft.Exchange.MailboxReplicationService VM2.mkt.local (15.0.620.24 caps:3F)’
    failed. Error details: must be logging in with GUIDs, not legDN
    Parameter name: owner.
    + CategoryInfo : NotSpecified: (:) [New-MailboxRestoreRequest], CommunicationErrorTransientException
    + FullyQualifiedErrorId : 89298C60,Microsoft.Exchange.Management.RecipientTasks.NewMailboxRestoreRequest
    + PSComputerName : vm2.mkt.local

    So plz could u let me know exactly where is the problem..

    Thanks

  19. Greg

    Paul – Great articles on how to create a 2013 Recovery Database and how to recover items from the Recovery Database back into Production. We’ve used these today to successfully recover 3 mailboxes today – thanks very much!
    So to cleanup my server, just dismount the Recovery DB and delete the 2 folders I created??
    Cheers

    1. Avatar photo
      Paul Cunningham

      Correct. Dismount, remove-mailboxdatabase for the RDB, then delete the files from disk to finish the cleanup.

  20. JC

    Ah, I see. Well that’s good to know. Thank you!

  21. JC

    Quick question, I have the Exchange 2010 mbx in a netapp iscsi lun but want to move that data over to an nfs drive instead. Is that possible and do you know of any helpful best practices or docs I can use to get a better understanding on how to do this. I can’t seem to find anything relevant.

    Thank you!

    JC

  22. itworkedinthelab

    Great article
    Thanks

Leave a Reply