Microsoft has recently activated the feature for downloading a backup of a Dynamics 365 Business Central SaaS tenant. A database can be exported from a selected environment as a .bacpac file, can be automatically saved into an Azure Storage account and from there you can download it offline and restore it into your on-premise network (multi-tenant database).
How this feature works?
As a first step, you need to have an active Azure subscription and here you need to create an Azure Storage account (you can do that directly from the Azure Portal in few easy steps).
Then, from your Azure Storage account click on Shared Access Signature in order to create a key for a secure access to your storage:
Here, create the shared access signature key with the permissions as follows:
A shared access signature usually have a starting and ending date and the key to access the storage account is valid in this date range (from – to). Here you should create a key with a time range that permits you to perform the environment backup (I’ve set it to 1 day).
Then click on Generate SAS and connection string and you will have your generated keys:
You need to copy the Blob service SAS URL key.
You’re ready to start the tenant backup. Now go to your Dynamics 365 Business Central Admin center, select an environment to export (here I’ve chosen my Production environment) and click on Database|Create Database Export:
In the Create Database Export window, select a file name for your backup file (.bacpac), insert the SAS URI previously copied and select a Blob container (Container Name) from your storage account (this is the container where the backup file will be saved). If you don’t have a container, it will be created for you:
Click Create and after a bit of time (it depends on the database size) the .bacpac file will be saved into your Azure Storage account. Quite easy isn’t it?
Only some important notes to remember:
- Each environment is actually limited to 10 exports per months.
- Create the Azure Storage Account in the same Azure Region where your Dynamics 365 Business Central tenant is located (this is a recommendation mainly for performance reasons).
- You cannot export a database if you have a trial tenant. In this case, you receive the following message if you try to execute the Create Database Export feature:
Hi Stefano,
How did you get around Data Encryption Management, SaaS has this enabled by default and when we restore to on-prem it is disabled. We need the key from SaaS but do not know how to get it.
Any help appreciated.
Thanks
Darren
LikeLike
The key is removed, data are in clear format. You should be able to restore without problems.
LikeLike
Hi Stefano,
Thanks for this post.
Is there automatic back up of the production database done by Microsoft ?
Besauce in case of crash of the server, Microsoft can restore the database, do you know the procedure ?
Thanks,
Steven.
LikeLike
Yes the Production environment has an automatic backup policy in place. To restore a backup actually you need to raise a support ticket to Microsoft but in the upcoming feature there are plans for permitting point in time restore.
LikeLiked by 1 person
Do you know where I can see a log or history of this export in Azure? I tried to export the backup twice. The export history in admin center says it was exported, but it never “arrived”. A container was created, but there is no file in it…and I waited more than 1 day, so the time should be sufficient.
LikeLike
Normally all database export activities are logged for auditing purposes. To view the history, choose Database, then choose View Export History on the environment details page of the environment.
LikeLike
Yes, that’s the part that works fine.
The export history in Database -> View Export History on the environment details page tells me it was exported.
I still cannot see any blob/backup in my storage account. This is where I am stuck. I do not know why it is not in my storage account – I do not see any logs or error messages that tell me what went wrong.
Any idea?
LikeLike
Hi Demiliani, thanks for sharing this.
For data warehousing/bullk data extraction, do you think this export&restore better than using web API? Is there any alternative option for Azure data factory specifically?
LikeLike
For creating a DW with tons of data recommendations are 2: 1) initial DW creation via export and restore 2) API based on query objects with filter on LastModifiedDate for retrieving deltas
LikeLike
Are there any legal problems with downloading a BC SaaS copy into a local environment for better development? GDPR? ISO?
LikeLike
I’m not a GDPR expert, but you can also obfuscate sensitive data if needed.
LikeLike
Hi, Is this can be automated? example, every week is automatically exported.
LikeLike
You can do that with Automation API. Use the following: Content-Type: application/json
POST /admin/v2.7/exports/applications/{applicationFamily}/environments/{environmentName} and you can export to an Azure Storage account.
LikeLike