Migrate mailboxes from a dismounted Exchange Database

Marshal HubsEmail Consultant
Let us take a look at the scenario, you have a database that is corrupt and you run the ESEUTIL command only to find you are unable to repair it. How do you now get the data back?

You don’t have any backups for Exchange so what is next?

  1. Backup the corrupted logs and database by copying the data to a different directory.
  2. Create a dial tone database
  3. Re-home all user accounts to the new dial tone database
  4. Create a recovery database
  5. Mount/Dismount Recovery Database
  6. Move log files and database
  7. Restore email from the dial tone database back into the production database.
  8. Use Stellar Phoenix Exchange Recovery tool

Firstly, copy the corrupt database and logs to another directory in case you need it later.

Well the first step would be to create a Dial Tone Database, you may wonder how this is done, well it is rather simple. Run the following command to create a new database:

  • New-MailboxDatabase -Name NEWDB -EdbFilePath D:\DialTone\NEWDB.EDB

The next step would be to rehome all the user mailboxes to the above Database that you just created. This will ensure that users have connectivity in outlook while you try and recover the data. If you do not want to run this long 14-15 step process, you can always get in touch with Stellar Phoenix and get a copy of the Mailbox Exchange Recovery tool to export all the Mail to a .PST file or back into Exchange.

Right, to re-home user’s mailboxes, you need to run the following command:

  • Get-Mailbox -Database Database1 | Set-Mailbox -Database NEWDB

The next step would be to create a recovery database in Exchange and perform a restore or copy the database and log files you want to recover into the Recovery Database.

Do not mount the recovery database just yet, you will need to copy all the log files from the corrupted database to the log folder where the recovery database resides so that they can be played against the restored database.

The step is to mount the database; you can do so using the following command:

  • Mount-Database -Identity RecoveryDB

After the recovery database has mounted, you must then dismount the database, you can do so using the following command:

  • Dismount-Database -Identity RecoveryDB

You might be wondering why we are performing a dismount after mounting the database, well after the recovery database has been dismounted, you need to move the database and log files within the Recovery Database directory to another location. This is done for swopping the recovered database with the dial tone database created earlier.

The next step is to dismount the dial tone database, take note that the users will be disconnected once you dismount the database, you can do so by running the following command:

  • Dismount-Database -Identity NEWDB

The next step is to move the database and log files from the dial tone database folder into the folder where the Recovery Database resided.

After that you will need to move the database and log files from the location where you moved the Recovery database and logs to into the dial tone folder.

Once the above is complete, you can now mount the dial tone database again, you can do so running the following command:

  • Mount-Database -Identity NEWDB

What happens now, is that that service is restored back to your users. They will now be able to access the original database and send/receive mail.

The next step is to mount the Recovery Database again; you can do so running the following command:

  • Mount-Database -Identity RecoveryDB

One of the final steps is to use the New-MailboxRestoreRequest cmdlet to export data from the Recovery Database into the recovered database. What this does is import all messages sent and received when the dial tone database was in use to the new production database.

You could use the two commands below as an example to import mail or you can write your own PowerShell commands that work for you, here are the commands:

  • $mailboxes = Get-Mailbox -Database NEWDB
  • $mailboxes | %{ New-MailboxRestoreRequest -SourceStoreMailbox $_.ExchangeGuid -SourceDatabase RecoveryDB -TargetMailbox $_ }

Depending on the size of your database and the number of users and all the mail that took place during the time you were using the dial tone database, it can take some time.

Once you have completed the restore, you can now dismount the Recovery database and remove it, to do this you can run the two commands below:

  • Dismount-Database -Identity RecoveryDB
  • Remove-MailboxDatabase -Identity RecoveryDB

As you can see above, it is quite a lengthy process and if you are not comfortable using the steps above, you can use Stellar Phoenix Exchange Recovery Tool which will allow you to open the corrupt database and export all mail to where you want it to go. If you wish to start with a fresh mailbox for all users and just export mail to .PST for keeping, then you can or if you want to restore it back to Exchange you can do so as well.

The tool is very simple to use, you will need a licensed copy to be able to extract all data and not just a portion. High level Overview:

  1. Purchase Stellar Phoenix Exchange Recovery
  2. Copy the corrupted database to a location where the software is installed/run from.
  3. Open and locate the database.
  4. Select all the mailboxes and how you want to restore them, where it is .PST or directly into Exchange and start the process.
  5. Mail is restored and you have a no data loss.

Also take a note, you can look at Stellar and get a copy of the Mailbox Exchange Recovery tool if you wanted to restore exchange database without any data loss.


Comments (0)

Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.