Introduction

A lot of people who want to know how to restore a mailbox from .edb file.

There are many tools out there that can do it and mostly they cost. With this article I want to show you how to do it with built in commands (cmd and Exchange PowerShell).

Requirements

  • Log files
  • Space to store the .edb file

Setup

  • Mail server with mailbox role
  • Enough space for .edb file and log
  • New mailbox for import
  • Path to export pst file (if required)

Steps

Overview

  1. Check .edb state
  2. Repair .edb file
  3. Create recovery database by using the old .edb file
  4. Mount recovery database
  5. List all mailboxes in that database
  6. Restore mailbox to a New or an existing mailbox (only supported way)
  7. Check restore status and remove it
  8. Export mailbox to pst (if needed)
  9. Check export status
  10. Remove completed export
  11. Delete mailbox (if needed)
  12. Remove and delete recovery database

Details

  1. Login to mailserver where database was recovered to  and start CMD as administrator. Navigate to path where .EDB file is and run the following command to check its status for dirty shutdown: eseutil /mh EXDB14.edb (where EXDB14 is database name that was restored)

  2. Run the following command to repair database:

    eseutil /r E02 /l "E:\EXDB12\Exchange Server\EXDB14\Logs" /d "E:\EXDB12\Exchange Server\EXDB14\File"

    ( where E02 is the file name of check file)

  3. Then run this command (In Exchange Powershell) to create RecoveryDB

    New-MailboxDatabase -Server mail01 -Name RecoveryDB01 -Recovery -EdbFilePath "E:\EXDB12\Exchange Server\EXDB14\File\EXDB14.edb" -LogFolderPath "E:\EXDB12\Exchange Server\EXDB14\Logs"

  4. Run the following command to mount the RecoveryDB

    Mount-Database RecoveryDB01

  5. Run the following command (Exchange powershell) to get a list of mailboxes

    Get-MailboxStatistics -Database RecoveryDB01 | ft –auto

  6. Run the following command to Restore mailbox to an existing user (only supported way)

    New-MailboxRestoreRequest -SourceDatabase RecoveryDB01 -SourceStoreMailbox "Doe, Jon" -TargetMailbox newuser –AllowLegacyDNMismatch

    Where "Doe,Jon" is mailbox you want to restore from the old database and "newuser" is a  new mailbox you created.

  7. Run the following command (In Exchange Powershell) to check status

    Get-MailboxRestoreRequest

  8. When status is completed run the following command to Remove restore request

    Get-MailboxRestoreRequest -Status Completed | Remove-MailboxRestoreRequest

  9. Then run the following command to export mailbox it was restored to into a pst file

    New-MailboxExportRequest -Mailbox jondoe -FilePath //fileshare01/PST/jondoe.pst

  10. Run the following command to check status of export request

    Get-Mailboxexportrequest

  11. Then run the following command to remove completed request

    Get-mailboxexportrequest –status completed | remove-mailboxexportrequest

  12. Delete content from mailbox it was imported to.

    Disable-Mailbox Jon.Doe@domain.com

  13. Remove and Delete Recovery database.

    In Exchange powershell run the following command

    Remove-MailboxDatabase -Identity “RecoveryDB01”

    Then manually delete the file from its location (database and log).