D365 F&O Data Refresh from Tier 2 to Tier 1


Download bacpac file from LCS

select project->asset library-> database backup


1. Download the  DacFramework.msi installer for Windows. Install it 

2. download sqlpackage for Windows. "https://learn.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage-download?view=sql-server-ver15"

        extract the zip file  in below path

        extract here: C:\Program Files\Microsoft SQL Server\SQL Packages

3.      Copy your bacpac file in "J:\MSSQL_BACKUP"

4.      Open command prompt as admin and do below steps.

        cd C:\Program Files\Microsoft SQL Server\SQL Packages

SqlPackage.exe /a:import /sf:"I:\MSSQL_BACKUP\axbackup.bacpac" /tsn:localhost /tdn:AXDB_0111 /p:CommandTimeout=800 /TargetTrustServerCertificate:True


5  Execute the commands to swap the db names

a. To rename the existing db to new db 

USE [master];

GO

ALTER DATABASE [AxDB] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;

GO

EXEC sp_renamedb N'AxDB', N'AxDB_Old_0111'--- if it thow error stop. Turn off the Microsoft batch services and world wide web publishing service


b.Rename the new db with the AxDB

EXEC sp_renamedb N'AXDB_0111', N'AxDB';

go

c. Set db in multiuser mode

USE [master];

GO

ALTER DATABASE [AxDB] SET multi_USER WITH ROLLBACK IMMEDIATE;

GO



6.We can do adminprovisioning from below 

>>Go to K>AOS>packagelocaldirectory>bin > AdminUserprovicsioning


7 Then do full build and synchronise the database 

8 check the below services 

  1.world wide web publishing service

  2.Microsoft Dynamics 365 Unified Operations: Batch Management Service

  3. IIS AOS services

if status is showing as stopped just start the service


9. check the client. It should be accessible.

 

D365 F&O Data refresh from Tier 1 to Tier 2 environment

RESTORE DATABASE [AxDB_Copyexport] FROM DISK = N'J:\MSSQL_BACKUP\DHG_datadrop_2_20210916.bak' WITH REPLACE, FILE = 1,

MOVE N'AXDBBuild_Data' TO N'G:\MSSQL_DATA\AxDB_Copyexport.mdf',

MOVE N'AXDBBuild_Log' TO N'H:\MSSQL_LOGS\AxDB_Copyexport_Log.ldf',

NOUNLOAD, STATS = 5



Use AxDB_Export

update sysglobalconfiguration

set value = 'SQLAZURE'

where name = 'BACKENDDB'



Use AxDB_Export

update sysglobalconfiguration

set value = 1

where name = 'TEMPTABLEINAXDB'



Use AxDB_Export

drop procedure if exists XU_DisableEnableNonClusteredIndexes

drop procedure if exists SP_ConfigureTablesForChangeTracking

drop procedure if exists SP_ConfigureTablesForChangeTracking_V2



Use AxDB_Export

drop schema [NT AUTHORITY\NETWORK SERVICE]



Use AxDB_Export

drop user [NT AUTHORITY\NETWORK SERVICE]



Use AxDB_Export

drop user axdbadmin

drop user axdeployuser

drop user axmrruntimeuser

drop user axretaildatasyncuser

drop user axretailruntimeuser

drop user axdeployextuser



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


cd C:\Program Files (x86)\Microsoft SQL Server\130\DAC\bin

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


D365 F&O delete TFS workspaces and re-assign to new developer

Easy way : 

1- Close Visual Studio


2- Open Run (Win+R) and paste one by one the following and delete anything inside:
    %localappdata%\Microsoft\Team Foundation\6.0\Cache\
    %localappdata%\Microsoft\VisualStudio
    %localappdata%\Microsoft\VSCommon

3- Restart your VM

4- Open visual studio and configure with new account

Painful way:

1- Close Visual Studio

2- Open Run (Win+R) and paste one by one the following and delete anything inside:
    %localappdata%\Microsoft\Team Foundation\6.0\Cache\
    %localappdata%\Microsoft\VisualStudio
    %localappdata%\Microsoft\VSCommon
3- Open command and run following commands:
  • Goto IDE folder where the workspace program exist
    Cd C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
  • Check all the current workspaces
    tf workspaces /server:https://dev.azure.com/{org} /computer:{ComputerName} /owner:* /format:detailed
  • If you see any ghost workspace delete it
    tf workspace /delete /server:https://https://dev.azure.com/{org} '{WorkspaceName};{UserName}

    if above command give error run it with user id instead of username
    tf workspace /delete /server:https://https://dev.azure.com/{org} '{WorkspaceName};{UserId}
  • Run this command to sure it's deleted
    tf workspaces /server:https://dev.azure.com/{org} /computer:{ComputerName} /owner:* /format:detailed

4- Restart your VM

5- Open visual studio and configure with new account

Install and Configure Zpl Printer on D365 F&O

  Setup Zpl Printer On D365 F&O Posted on Recently, I have had an opportunity review the possibilities to print license plates within D3...