What is the exchange database mandatory error?
Exchange servers 2016 and 2019 are considered to be the updated versions of the legacy systems and many businesses are migrating to Exchange 2016 and 2019 to take advantage of the new features and stay up to date with security patches. However, when you upgrade Exchange 2013 to 2016 or 2019, you might encounter the following error messages.
The following error was generated when “$error.Clear();
if(($server -eq $null) -and ($RolelsDatacenter -ne $true))
{
Update-RmsSharedIdentity -ServerName $RoleNetBIOSName
}
was run :Microsoft.Exchange.Data.DataValidationException: Database is mandatory on UserMailbox
You might see the following warning message when you navigate to the Exchange admin center (EAC).
This error is caused when there is no database associated with the usermailbox or when the homeDB attribute in the Active Directory Services is not set. In Exchange 2016 and higher versions a mandatory database is required for all mailboxes and when the database is missing, you might get the error message. A second possible reason is that the Exchange database (EDB) file is corrupted and fails to mount to the Exchange server.
How to resolve the error Exchange database is mandatory on UserMailbox?
You can resolve the error with the following three methods
- Set the HomeMDB attribute in the Active Directory Services Interface
- Move the mailbox to a Database Availability Group (DAG)
- Recover and convert the corrupted EDB to PST with EdbMails
Method 1: Set the HomeMDB attribute in the ADSI
- Step 1: Install AD DS on your computer
Install the Active Directory Domain Services (AD DS) on your Windows Server operating system where you have installed the Exchange server.
See steps to install Active Directory Domain Services- After you install the AD DS, click the 'Start menu' > 'Administrative Tools' > 'ADSI Edit'.
- Right click ADSI Edit from the left and select 'Connect to…'
- Step 2: Open the Connection Settings in ADSI Edit
The ADSI is the Active Directory Services Interface Editor which enables you to edit or modify any object in Microsoft’s AD DS. Select the Default naming context and click OK in the Connection Settings window.
- Step 3: Go to the User Properties and check for the homeMDB value
- Expand the ADSI to see all the Organizational units (OU)
- Navigate to the user mailbox name which shows the error
- Right click on the user > click Properties > homeMDB
The value for the homeMDB attribute will be shown as
. The homeMDB value contains the mailbox database whose object is associated with the mailbox. - Step 4: Set the homeMDB value if it shows not set
Look for a user in the Organizational unit whose mailbox has a valid database and does not show the error. Right click on this user > click 'Properties' and in the homeMDB copy the value that is shown CN=DB02, CN=Databases, CN=Microsoft Exchange, CN=Services, CN=Configuration, DC=domain_name, DC=local
Go back to the user whose mailbox shows
and paste the value for the homeMDB attribute. See steps to set the homeMDB attribute in the String Attribute Editor and steps to fix the inconsistent state of the user mailbox.
- Step 5: Restart the Exchange Information Store and check the usermailbox
The changes may take a couple of hours. Click on Start menu> Services> Microsoft Information Store and restart the service. Now, login and navigate to the Exchange admin center and you should no longer see the warning message for the user mailbox.
- Step 1: Install AD DS on your computer
Method 2: Move the mailbox to a Database Availability Group
If your Exchange server is configured to use a Database Availability Group (DAG), you must create a new database on the DAG and move all your mailboxes to the database as described in the following steps.
- Step 1: Start the Exchange Management Shell (EMS)
Launch EMS on your Exchange 2016 or 2019 server as an administrator
- Step 2: Create a new mailbox database on the DAG
Type the following command in the EMS to create a new mailbox database
New-MailboxDatabase -Name -Server -EDB_File_Path -Log_folder_path
Replace the EDB_File_Path and Log_folder_path with the respective folder path on your computer. - Step 3: Move the mailbox to the new database
Type the following command in the EMS to move the mailbox to the new database you just created.
New-MoveRequest -Identity 'johndoe@example.com' -TargetDatabase "DB01"
See steps to move mailbox to a new database
The limitation of the aforementioned methods is that when the EDB file of the Exchange server is severely corrupted or damaged, you cannot resolve the database error. Moving the mailbox to a different database requires PowerShell scripts and technical expertise. In the following section, we explain the best method to safely recover the Exchange database file with EdbMails.
- Step 1: Start the Exchange Management Shell (EMS)
Method 3: Recover and convert the corrupted EDB to PST with EdbMails
In this method, we describe the steps to convert a corrupted EDB file to PST with EdbMails EDB to PST converter. It is a Microsoft partnered application which also enables you to directly migrate mailboxes from the EDB to the Exchange server without requiring any PowerShell cmdlets.
- Download EdbMails Exchange recovery tool and install the application on any computer that is connected to the source and target environment. You can also perform the mailbox recovery and migration by installing EdbMails on any non-Exchange server computer.
- Launch the application and click 'Login' or 'Start Your Free Trial'
- Select the recovery technique as EDB to PST. EDB to Office 365. EDB to Exchange.
See a detailed list of EdbMails system requirements and make sure you have Outlook installed if you want to recover and convert the EDB to PST file. If you want to directly migrate the EDB file to a live Exchange server, you do not require Outlook. Take a complete backup of the EDB file before you proceed with the export or migration operation.
- Step 1: Select the offline and corrupted EDB file for recovery
Select the corrupted Exchange EDB file that shows the error ‘Exchange database is mandatory on UserMailbox’. EdbMails recovers the corrupted EDB file and displays all your mailboxes where you can preview individual mail items and convert the EDB to PST. The application can convert mailbox.edb, pub.edb, priv.edb and STM files.
- Step 2: Select the mailboxes to perform the export or migration operation
Select the mailboxes, folders and mailbox items and click 'Export to Outlook PST'. If you want perform Exchange migration to an on-premises/Live Exchange server, click 'Migrate to Live Exchange'.
You can apply the advanced filter settings to export the Exchange emails to PST by specific Date, Subject, Attachment and so on.
- The 'Exclude Standard / Custom folders' option enables you to exclude the folders such as Junk, Conversation History from the export operation.
- EdbMails comes with other additional settings such as splitting a PST file during the export and excluding emails whose size is greater than a specified limit.
- Step 3: Verify the mailboxes and add a label to the export job
After you select the mailboxes and folders, you can verify them for export and give the task a name for future reference. This activity enables you to save and use the same application settings for future export operations.
- Step 4: Start the EDB to PST export operation
Browse the location on your computer and ensure that you have enough disk space to save the PST file. Finally, start the export operation from the EDB file to PST. You can pause and resume the operation and view the export details under 'View Log'.
To restore all your mailboxes and mail items from the corrupted EDB file, add the exported PST file in Outlook. If you have migrated the EDB to Office 365 or Exchange server, add the domain name and configure the MX records to point to the new server.
The migration and export operation with EdbMails does not cause downtime or data loss. EdbMails can recover EDB without log files and also does not require an Exchange server for database recovery. It has advanced built-in filter settings for selecting specific folders, emails, and mail items for export and migration.
Concluding Words
The error ‘Exchange database is mandatory’ occurs when the database for a user mailbox is missing or corrupted. The first method to resolve the problem is to set the value for the homeMDB attribute in the Active Directory Services. If your Exchange server is a part of the DAG, you must create a new database and move mailboxes to the new one with PowerShell scripts. If the EDB file is corrupted or if you are unable to access your mailboxes, you must restore the EDB file using an Exchange repair tool such as EdbMails. The application can help you export all your mailboxes and folders from the EDB to PST. You can also perform migration to a Live Exchange server or Office 365 in a few clicks.