Business Central SaaS Exporting Database Backup and Restore it on your Sql Server

Business Central SaaS Exporting Database Backup and Restore it on your Sql Server

Since some days, Microsoft has activated the feature for downloading a backup of a Business Central SaaS Azure SQL Database directly from Admin Center.

A selected database (in this case a BC v15 Wave 2 production database) can be backuped and exported as a “.bacpac” file; this file will be saved into an “Azure Storage account” and after this, you will able to download it and restore into your local SQL Server Environment (SQL Server 2017 Express Edition in my case).

Microsoft Docs Page link https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/tenant-admin-center-database-export

#1 – How-to Download a Backup File

You need only to have an active “Azure subscription” and here you need to create an “Azure Storage account”.

Create an Azure Storage Account

After from your Azure Storage account, click on “Shared Access Signature” in order to create a “key for a secure access”.

Assigning Permissions to Shared Access Signature

Configure the Shared Access Signature

You have to activate:

  • BLOB Storage Services (BLOB Storage is used for SaaS and standard for SQL Azure)
  • Container\Object
  • Read\Write\Delete\Create
  • Set Expiration Date (for Sharing Security)
  • Ip Firewalling (if you need to rescript access)
  • HTTPS Only

GENERATE THE KEYS

Click “Generate SAS and connection string” and you will have your keys generated and ready to use, copy all Keys on notepad and save (you can change the configuration as you want in a second time).

Example of Keys:

  • SAS token
  • Blob service SAS URL

CREATE AND SAVE A BACKUP FILE

To save a Backup file from Business Central SAAS you need to copy the Blob service SAS URL key.

Open Admin Center

  • Click on Create Database Export

  • Select a file name for your backup file (.bacpac File) ex: Production**.bacpac file
  • Insert the SAS URI
  • Insert a Container Name (existing or new)

Click CREATE and wait for completition.

TO-DATE LIMITATIONS

  • Max 10 exports per months (you can check and verify how many in EXPORT LOG)
  • You can’t 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
  • NB: SYSTEMS WORKS ONLY FOR V.15 DATABASES (BC SAAS 2009 RELEASE WAVE2), NOT FOR RELEASES BEFORE THAN 15!

EXPORTING BACKUP “IN ACTION”…

WAIT for Completition… check on your Azure Container… your backup file will be placed here after exporting completition…

“DOWNLOAD” THE BACKUP FILE ON YOUY LOCAL SYSTEM

EXPORT HISTORY All exported backup will be recorded on this export log, you can count how many backups you have made in the month for each database.

TIPICAL ERRORS

  • Try to export from v14! ERROR! You are crazy! …Minimum version v15!

  • Export from a Demo Tenant (not licensed environment) 

…and NOW you have the backup file ready to use…. And then?

Restore It!

#2 – How-to Restore a BC SaaS Backup on Business Central On-Premise

The Exported Backup saved on Azure Container is in “.bacpac” file format; what’s the difference between a “.bak” file and a “.bacpac” file in SQL Server ?

Definitions:

“.bak”: Applicable for On-premise databases backups

“.bacpac”: Applicable for Backups/Export Data Tier of Databases to/within Azure SQL Databases

How to restore Azure Database .bacpac file to SQL Server?

#1 – Restoring BACPAC with Microsoft SQL Management Tools  

Restoring a database from a “.bacpac” file is very simple…

  • Right click on Database and click “Import Data-tier Application

  • “Import Data tier Application”

After follow the instructions:

https://www.smarterasp.net/support/AvatarHandler.ashx?radfile=%5cUsers%5c2%5cazuredb3%2epng

Select “the path” to your downloaded “.BACPAC” backup file.

Give the database you are restoring a name and define a location for data and log files.

Run and wait for completition…

After completition, you can check the new database restored

Ex: BCSAASv15-ES-bck-20191107_01

Stay Tuned!

One thought on “Business Central SaaS Exporting Database Backup and Restore it on your Sql Server

  • 13 November 2019 at 6:45 AM
    Permalink

    Hi,

    Is there a way to schedule this backup?

    Regards,
    Jiya Sukhija

    Reply

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: