Exchange 2010 Backup and Restore (powershell)

In Exchange 2010 you can’t use ExMerge anymore. In Exchange 2010 you can create a backup from your database (with windows backup), you can then restore it in case of an emergency and attach it to Exchange as a seperate database (recovery database). You can then restore a mailbox’s content.

Prerequisites:

  • Make sure your server has the Windows Backup Feature installed
    note: this is based on a windows 2008R2 Server
  • Start the Windows service “Microsoft Exchange Server Extension for Windows Server Backup” and set its Startup Type  to automatically

Backup

First of all you have to make a backup of your exchange environment.

  • Start Windows Backup
  • Click “Backup Schedule” (or Backup Once, if you don’t want the backup to be scheduled and run every night). In the Getting Started Screen click [Next]

    image

  • You can make a Full Backup of your server or just choose your Exchange directory. I opted to go for the latter one. Choose [Custom] and then click [Next]

    image

  • Next screens asks you to select the items to backup. Click [Add Items] and add the location where you’re Exchange is installed (mine was D:\Exchange Server). Then Click [Advanced Settings] and make sure you select “VSS full Backup” underneath the tab “VSS Settings”, then click [Next]

    image
    image

  • If you choose the “Backup Schedule” option  in the beginning, you will now be presented with a dialog box in which you can create your schedule. If you created one then click [Next]

    image

  • The next screen asks for a destination for your backup files.  I chose the “Back up to a shared network folder” option. Then click [Next]

    image

  • Next is to specify the remote shared folder. Choose one and click [Next]

    image

  • You will then be prompted with a username and a password question. Fill in an  account which has access to the shared folder you’re backing up to. Click [Finish]

    image

  • The wizard will create your backup schedule, and then will return the status. It should read “You have successfully created the backup schedule”. Then click [Close].

Ok, you’re backup should be scheduled now. Now let’s see what you have to do whenever you want to restore a mailbox.

Restore

  • First of all off course, you have to restore your latest backup. Again start Windows Backup en choose the option [Recover]. On the Recovery Wizard screen that opens select “A backup stored on another location”, then click [Next]
  • Specify “Remote Shared Folder” as the location type. Click [Next]
  • Enter the remote shared folder location and click [Next]
  • On the next screen you have to select the date of the backup you want to recover. Pick one and click [Next]
  • Select ”Files and Folders” as the recovery type, then click [Next]
  • Now you have to select the Exchange Folder that you created a backup from. Then Click [Next].
  • Choose to restore the database to a different location. Click [Next]
  • Confirm the restore by clicking [Recover]
  • After the restore is done, open up Exchange Management Shell and change the directory to the location where the edb file and the log files are located.
  • Run the command: “eseutil /r e00 /d <full path to restore folder>”

    image

  • Next run the command “eseutil /mh <edb filename.edb>”. In the output you must verify that the state of the database is “Clean Shutdown”

    image

  • You can now create a new recovery database, named RestoreDB. Execute the command:
    “new-mailboxdatabase –recovery -name RestoreDB -server <ServerName>
    -EdbFilePath <path to edbfile.edb> –logfolderpath <path to folder with logfiles>”

    image

  • Next is to mount the database with the command:
    ”mount-database –identity RestoreDB”

    image

  • To restore a mailbox you can now execute the command:
    ”restore-mailbox –identity <mailboxname> –RecoveryDatabase RestoreDB”

That’s it.

  • To clean up: dismount the database en then remove the database
    a. ”dismount-database –identity RestoreDB”

    image

    b. ”remove-mailboxdatabase –identity RestoreDB”

    You only have to delete the files on the file system manually.

2 thoughts on “Exchange 2010 Backup and Restore (powershell)

  1. Michael,

    Can you explain a little more what you mean? Is there a step missing here? I am running into a problem where when I try to restore subsequent mailboxes it only sees my first db restore when I get the database statistics.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>