August 10, 2020

How to Import Tier 1 box Data backup to Tier 2 Box

Hi Folks,  

All tier 2 server we have to use bacpac file to restore a database from tier 1 server which has .bak file when doing a DB export. In this post, we will see how to restore the database from tier 1 server to tier 2 server.

(Know more about Cloud offering and different tiers)

Step 1: Create a copy of your DB.

Use below script,

BACKUP DATABASE [AxDB] TO DISK = N'D:\Backups\axdb_golden.bak' WITH NOFORMAT, NOINIT,

NAME = N'AxDB_golden-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, COMPRESSION, STATS = 10

GO

RESTORE DATABASE [AxDB_CopyForExport] FROM DISK = N'D:\Backups\axdb_golden.bak' WITH FILE = 1,

MOVE N'AXDBBuild_Data' TO N'F:\MSSQL_DATA\AxDB_CopyForExport.mdf',

MOVE N'AXDBBuild_Log' TO N'G:\MSSQL_LOGS\AxDB_CopyForExport_Log.ldf',

NOUNLOAD, STATS = 5

 

Choose master from the dropdown, so the new DB will create on the root folder on inside the AXDB. Make sure you update all the paths as per your machine. This script must create a new database named AxDB_CopyForExport.

 


Step 2: Now we need to make some changes in this Database. You should run this script for a successful Export/Import of database.

 Here is the complete script, which you need to run on new DB i.e. AxDB_CopyForExport .

update sysglobalconfiguration

set value = 'SQLAZURE'

where name = 'BACKENDDB'

update sysglobalconfiguration

set value = 1

where name = 'TEMPTABLEINAXDB'

drop procedure if exists XU_DisableEnableNonClusteredIndexes

drop procedure if exists SP_ConfigureTablesForChangeTracking

drop procedure if exists SP_ConfigureTablesForChangeTracking_V2

drop schema [NT AUTHORITY\NETWORK SERVICE]

drop user [NT AUTHORITY\NETWORK SERVICE]

drop user axdbadmin

drop user axdeployuser

drop user axmrruntimeuser

drop user axretaildatasyncuser

drop user axretailruntimeuser

drop user axdeployextuser

 

--Tidy up the batch server config from the previous environment

DELETE FROM SYSSERVERCONFIG

 

--Tidy up server sessions from the previous environment

DELETE FROM SYSSERVERSESSIONS

 

--Tidy up printers from the previous environment

DELETE FROM SYSCORPNETPRINTERS

 

--Tidy up client sessions from the previous environment

DELETE FROM SYSCLIENTSESSIONS

 

--Tidy up batch sessions from the previous environment

DELETE FROM BATCHSERVERCONFIG

 

--Tidy up batch server to batch group relation table

DELETE FROM BATCHSERVERGROUP

 

-- Clear encrypted hardware profile merchant properties

update dbo.RETAILHARDWAREPROFILE set SECUREMERCHANTPROPERTIES = null where SECUREMERCHANTPROPERTIES is not null

 Above scrip will; 

I. Set the SysGlobalConfiguration flag to inform the application that the database is Azure-based.

II. Remove a reference to tempDB in the XU_DisableEnableNonClusteredIndexes procedure. References to tempDB aren't allowed in an Azure SQL database. The database synchronization process will re-create the reference later.

III. Drop users, because Microsoft Windows users are forbidden in Azure SQL databases. Other users must be re-created later so that they're correctly linked to the appropriate sign-in on the target server.

IV. Clear encrypted hardware profile merchant properties.

Step 3: Export database as bacpac file.

Open CMD as admin (it will work without cmd as well), and go to path “C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin\”

Run below command,

SqlPackage.exe /a:export /ssn:localhost /sdn: AxDB_CopyForExport /tf: J:\MSSQL_BACKUP\GoldenConfig01082020.bacpac /p:CommandTimeout=1200 /p:VerifyFullTextDocumentTypesSupported=false

·         \ ssn (source server name) – The name of the SQL Server to export from. For the purposes of this topic, the name should always be localhost.

·         sdn (source database name) – The name of the database to export.

·         tf (target file) – The path and name of the file to export to. The folder should already exist, but the export the process will create the file.

 

Check all the default location carefully and run it. Don’t put any space while putting these values, (refer below image) else it will throw an error


Step 4: Upload bacpac file to LCS

Login into lcs.dynamics.com and Go to assets library > database  backup > click on + button

Select your file and select the backup type as ‘Product database (SQL Server or .bak)’ and upload this file.

Step 5: Import database to target tier 2 box.

Go to LCS and select a target T-2 box,

Click on details

Go to maintenance > Move database > Import a bacpac > select your file from the asset library


Further reference; Click here.

Cheers!!!

Harry

August 01, 2020

[Solved] Logic app error with ImportFromPackage - The mapping is incorrect for entity

Error Message: 

Below error message comes when trying to import a data package in D365FO using ImportFromPackage action. 

{

  "status"400,

  "message""An error has occurred.  Exception occurred while executing action ImportFromPackage on Entity DataManagementDefinitionGroup: The mapping is incorrect for entity <EntityName> and field {0000000}.\r\nclientRequestId: 0000000",

  "error": {

    "message""An error has occurred.  Exception occurred while executing action ImportFromPackage on Entity DataManagementDefinitionGroup: The mapping is incorrect for entity <EntityName> and field {0000000}."

  },

  "source""XXXXX.operations.dynamics.com",

  "errors": []

}

 

 Possible reason and solution:

 

Generally, this issue comes when you provide the wrong file format. Check what file format type you mention in your import package you might have provided different file formats.

The most common scenario is when you are supposed to send a CSV file but accidentally passed an excel file and vice versa.

 

-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

July 30, 2020

Say Hello to Microsoft DataFlex

Hi Folks,

Here we go again with a rebranding around CDS which is now known as DataFlex, yes that's right, CDS is now DataFlex - a new low-code data platform for Microsoft Teams. You can create and run thousands of applications, flows, and intelligent agents with a smart, secure, and now with scalable low-code data platform.

What it offers:

DataFlex Pro: Its more or less the same as what we have in CDS today including same licensing i.e.

            $10/app/User/Month

            $40/User/Month – unlimited apps

 

DataFlex: Its basically a new simplified version or I would say lightweight of CDS for building an app on top of Microsoft Team. It includes as free with your Microsoft office 365 license which includes Teams. 

Below is a screenshot for reference, hoe easily you can create different tables and columns to meet business requirements.

 

 

Why DataFlex?

 

i.                    Provides the ability to use model-driven power apps in Teams with no extra licensing cost.

ii.                 Currently, to build an app for Team you need to use the SharePoint list to save some licensing cost that too not a relation Database and without scalability. While DataFlex provides a free relation DB to build a team-based PowerApps

iii.               A low code tool that enables you to build Team apps and bots similar to native apps.

iv.               Streamline identity protection and secure guest access with identity management and multifactor authentication.

v.                  Reduce data management stress and let Dataflex Pro determine your storage needs for relational data, file and blob storage, logs, and search indexing.

vi.               Quickly develop applications your way—either with custom code or using no or low-code—across Azure, Office 365, and Dynamics 365, and with more than 300 connectors.

vii.            Create a solid data foundation using automatic duplication detection and more than 300 data transformations that clean and reshape data

Further references:

Introducing Project Oakdale, a new low-code data platform for Microsoft Teams

> CDS Doc




-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

July 10, 2020

QuickFix -13:[Solved] Error "labelc.exe exited with code -1"

Error message:

warning RG0000: Duplicate resource key!  Name was: "<labelId>"1 warnings(s). 

labelc.exe exited with code -1.

Possible reason:     

This error comes when there are duplicate rows in your label file. There are two or more rows with the same labelId.


Solution: 

Check your respective label file with <LabelId> , there must be some duplicate records and remove one duplicate row there. 

 

-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta