There are changes in SQL db import it needs additional parameters now Connection Security Improvements in SqlPackage 161 | Microsoft Community Hub
otherwise it will throw following error
*** Changes to connection setting default values were incorporated in a recent release. More information is available at https://aka.ms/dacfx-connection
*** Error importing database:Could not import package.
Unable to connect to target server 'localhost'. Please verify the connection information such as the server name, login credentials, and firewall rules for the target server.
A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.)
The certificate chain was issued by an authority that is not trusted.
*** The settings for connection encryption or server certificate trust may lead to connection failure if the server is not properly configured.
use following query where from lcs you need to provide username password as well with other additional parameters
SqlPackage /Action:Import /TargetServerName:"localhost" /TargetDatabaseName:"AdventureWorksLT" /TargetUser:"your_username" /TargetPassword:"your_password" /TargetTrustServerCertificate:True /SourceFile:"C:\AdventureWorksLT.bacpac" /p:CommandTimeout=2000
for example
K:\sqlpackage-win-x64-en-162.5.57.1\SqlPackage /Action:Import /TargetServerName:"localhost" /TargetDatabaseName:"AxDB_GAT" /TargetUser:"axdbadmin" /TargetPassword:"*****" /TargetTrustServerCertificate:True /SourceFile:"J:\UATbackup.bacpac" /p:CommandTimeout=5000
Comments
Post a Comment