29 July 2022

How to restore bacpack file in SQL

Work Around: 

You need to Download and install the latest Data Tier Application framework (18.2) (Link:https://www.microsoft.com/en-us/download/confirmation.aspx?id=58207) and run the SQLPACKAGE.exe located in C:\Program Files\Microsoft SQL Server\150\DAC\bin

Open CMD run as admin:

The command would look like below.

CD "C:\Program Files\Microsoft SQL Server\150\DAC\bin"

SqlPackage.exe /a:import /sf:"C:\temp\uatbackup.bacpac" /tsn:localhost /tdn:AxDBFromUAT /p:CommandTimeout=1200


Open Sql server change Database names using below code :

USE master;
GO
ALTER DATABASE AxDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
ALTER DATABASE AxDB MODIFY NAME = AxDB_Old;
GO
ALTER DATABASE AxDB_Old SET MULTI_USER
GO

Do Database Sync ..


Thanks .....

No comments:

Post a Comment

Give me the commetns and solutions

Ledger Voucher creation Framework and x++ code to create ledger voucher

 Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension->...