HOW TO IMPORT A DATABASE (bacpac format) INTO YOUR CLOUD HOSTED ENVIRONMENT. (D365FO)

HOW TO IMPORT A DATABASE (bacpac format) INTO YOUR TIER 1 CLOUD HOSTED ENVIRONMENT. (D365FO)

BEFORE YOU IMPORT, MAKE SURE:

1. Move the new database (bacpac) into the system environment (local computer) from which you are importing.


2. Download the zip file of SQLPackage. NET Core for Windows from Download and install SQL Server | Microsoft Docs

Link: https://learn.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage-download?view=sql-server-ver16

Ref: https://learn.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage-download?view=sql-server-ver16#windows-net-8

3. Extract the file by right-clicking on the file in Windows Explorer, and selecting 'Extract All...', and select the target directory


4. Open a new Terminal window/CMD and cd to the location where SqlPackage was extracted:


SqlPackage.exe /a:import /sf:D:\Exportedbacpac\my.bacpac /tsn:localhost /tdn:<target database name> /p:CommandTimeout=1200



You can also use the command below.

C:\Program Files\Microsoft SQL Server\160\DAC\bin\SqlPackage.exe /Action:Import /SourceFile:"<J:\MSSQL_BACKUP\my.bacpac>" /TargetConnectionString:"Data Source=<database Servername>;Initial Catalog=<NEW DB Name>;TrustServerCertificate=True;" /p:CommandTimeout="0"


Note:

tsn (target server name) – The name of the Microsoft SQL Server instance to import into.

tdn (target database name) – The name of the database to import into. The database should not already exist.

sf (source file) – The path and name of the file to import from.

You are good to go, Relax while the importing takes time.

After success import 

It may not sync 1st stop and restart the MSSMS service
















Comments

Popular posts from this blog

Creating a class, the best practice way in D365F&O

Package Deployment using LCS for Microsoft Dynamics 365 Finance & Operations

How to remove deployed model in Tier2 environment in D365FO