Troubleshooting Database Exports

Troubleshooting Database Exports

What to look at if you are having issues exporting databases from Business Central

Exporting databases in the admin center

Exporting Business Central online databases can be done from the BC Admin Center. This allows you to export a production database as BACPAC into an Azure storage account. More info on this is on Exporting databases in the admin center - Microsoft Learn

If you are having issues with this there are some limits which are not mentioned in the documentation, you may be exceeding them. If you try to export the BACPAC simply will not appear in Azure storage. There are no error messages, however there are telemetry events you can query in application insights with KQL. (Scripts for this are at the bottom of the page).

If you are having issues exporting and seeing the error message Operation failed due to unknown error after several days have passed you could have exceeded one of the following:

Export Limits

  • The database is greater than 300GB (this seems very small given the BC online limit is 3TB)
  • The database is very complex, with many tables / entities
  • You have more than 70 companies (again far below the 300 company environment limit)

We have exceeded the number of companies and I had to learn this the hard way with the assistance of MS support team so, if you are experiencing this issue, hopefully this post will save you some time in troubleshooting.

We are still working on an alternative solution and I will update if we find a valid one.

Telemetry Queries in KQL (Application Insights)

LC0139 - Export Started

traces
| where timestamp > ago(30d) // adjust as needed
| where customDimensions.eventId == 'LC0139' 
| project timestamp
, message
// in which environment did it happen
, aadTenantId = customDimensions.aadTenantId
, applicationFamily = customDimensions.applicationFamily
, countryCode = customDimensions.countryCode
, environmentName = customDimensions.environmentName
, environmentType = customDimensions.environmentType
// what happened
, failureReason = customDimensions.failureReason
, blobUrl = customDimensions.blobUrl

LC0140 - Export Succeeded

traces
| where timestamp > ago(30d) // adjust as needed
| where customDimensions.eventId == 'LC0140' 
| project timestamp
, message
// in which environment did it happen
, aadTenantId = customDimensions.aadTenantId
, applicationFamily = customDimensions.applicationFamily
, countryCode = customDimensions.countryCode
, environmentName = customDimensions.environmentName
, environmentType = customDimensions.environmentType
// what happened
, failureReason = customDimensions.failureReason
, blobUrl = customDimensions.blobUrl

LC0141 - Export Failed

traces
| where timestamp > ago(30d) // adjust as needed
| where customDimensions.eventId == 'LC0141' 
| project timestamp
, message
// in which environment did it happen
, aadTenantId = customDimensions.aadTenantId
, applicationFamily = customDimensions.applicationFamily
, countryCode = customDimensions.countryCode
, environmentName = customDimensions.environmentName
, environmentType = customDimensions.environmentType
// what happened
, failureReason = customDimensions.failureReason
, blobUrl = customDimensions.blobUrl
Back to all posts